• We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.

Cyanitem

Recruit
2 Badges
Nov 4, 2020
5
2
  • Crusader Kings II
  • Hearts of Iron IV: Cadet
So I was invading poland as germany and took warsaw and this message popped
 

Attachments

  • Ekran Alıntısı.PNG
    Ekran Alıntısı.PNG
    3,1 MB · Views: 0
  • 1Like
Reactions:

bitmode

1st Reverse Engineer Battalion
Nov 10, 2016
3.824
7.024
You briefly lost control of Warsaw during your attack. Despite what the text says, the news can be triggered by either the Soviet Union or Poland.
 
  • 1Like
  • 1
Reactions:

bitmode

1st Reverse Engineer Battalion
Nov 10, 2016
3.824
7.024
announcements can be weird.

I got this one, playing as the UK, when war broke out:
View attachment 666889
The trigger looks like this:
Code:
    mean_time_to_happen = { days = 2 }
    trigger = {
        any_country = {
            has_naval_treaty_trigger = yes
            has_war = yes
            any_enemy_country = {
                is_major = yes
                NOT = { tag = event_target:WTT_current_china_leader} #special exception
            }
        }
    }
This is weird not just on one level:
  • A MTTH of 2 days has no effect (https://hoi4.paradoxwikis.com/Event_modding#mean_time_to_happen)
  • wrapping the trigger in any_country is not necessary (and bad for performance) because every country evaluates it anyway. Currently, half a dozen countries each day check the conditions for every country that exists.
  • has_war = yes is covered by the next check. It is also not effective as an early out in the most common case of peace because any_enemy_country's small overhead in that case is less than what has_war does.
  • there is no need to trigger through an event at all, because there are actions for that:
Code:
on_actions = {
  on_declare_war = {  # ROOT = attacker, FROM = defender
    if = {
      limit = {
        is_major = yes
        not = { tag = event_target:WTT_current_china_leader} #special exception
        FROM = { has_naval_treaty_trigger = yes }
      }
      FROM = { effects... }
    }
    else_if = {
      limit = {
        FROM = {
          is_major = yes
          not = { tag = event_target:WTT_current_china_leader} #special exception
        }
        has_naval_treaty_trigger = yes
      }
      effects...
    }
  }
}
 
  • 3Like
  • 1
Reactions: