• 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.

Stahl-Opa

Marshall & Grossadmiral of Helvetia
72 Badges
Jun 16, 2011
728
150
www.vmods.org
  • Victoria 2: A House Divided
  • Europa Universalis IV: Call to arms event
  • Gettysburg
  • Heir to the Throne
  • King Arthur II
  • Leviathan: Warships
  • Magicka
  • Europa Universalis IV: Res Publica
  • Victoria: Revolutions
  • Crusader Kings II: Charlemagne
  • Victoria 2: Heart of Darkness
  • Warlock 2: Wrath of the Nagas
  • Pillars of Eternity
  • Europa Universalis IV: Mare Nostrum
  • Stellaris: Galaxy Edition
  • Crusader Kings II: Reapers Due
  • Stellaris: Synthetic Dawn
  • Europa Universalis IV: Conquest of Paradise
  • Crusader Kings II
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sword of Islam
  • Darkest Hour
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis III: Chronicles
  • Europa Universalis III Complete
  • Europa Universalis IV: Art of War
  • Divine Wind
  • Europa Universalis III
  • Crusader Kings II: Horse Lords
  • Stellaris: Digital Anniversary Edition
  • Europa Universalis IV: Rights of Man
  • Stellaris Sign-up
  • Europa Universalis IV
  • Stellaris: Nemesis
  • Stellaris
  • Europa Universalis III Complete
  • Crusader Kings II: Conclave
  • Europa Universalis IV: Cossacks
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Way of Life
  • Mount & Blade: Warband
  • Europa Universalis IV: El Dorado
  • 500k Club
  • Warlock 2: The Exiled
  • Europa Universalis III Complete
Hi guys

I just observed a strange issue:

I checked the AI Switch log:

Code:
1941-01-30 : [ Deutsches Reich ] -> [ Mods\Eternal War/ai\switch/GER_Norway.ai ]

so, GER_Norway.ai was activated in 1941 for a second time.
(Invasion of Norway is long over, triggered correctly the first time)

BUT: theres is only ONE single event that activate this ai file.

Code:
################
# Norway Invasion AI
#############################################
event = {
    id = 3003001
    random = no
    country = GER
    persistent = yes
    
    trigger = {
        ai = yes
        NOT = { local_flag = GERInvadeNorway }
        NOT = {    lost_national = { country = GER value = 2 } }
        OR = {
            war = { country = NOR }
            war = { country = SWE }
            war = { country = FIN }
        }
        NOT = {
            AND = { # LOW COUNTRIES
                war = { country = HOL }
                NOT = { control = { province = 122 data = GER } } # Amsterdamm
            }
            AND = {
                war = { country = BEL }
                NOT = { control = { province = 116 data = GER } } # Brussels
            }
            AND = {
                war = { country = FRA }
                NOT = { control = { province = 55 data = GER } } # Paris
                OR = {
                    war = { country = HOL }
                    war = { country = BEL }
                }
            }
            AND = {
                war = { country = SOV }
                NOT = { land_percentage = { country = SOV value = 0.8 } }
                NOT = { lost_national = { country = SOV value = 10 } }
            }
        }
    }

    name = "AI_EVENT"
    style = 0   
    
    date = { day = 1 month = january year = 1933 }
    offset = 4
    deathdate = { day = 29 month = december year = 1963 }

    action_a = {
        command = { type = local_setflag which = GERInvadeNorway }
        command = { type = local_clrflag which = GERSubPatrol }
        command = { type = ai which = "switch/GER_Norway.ai" }
    }
}

(Vanilla event)

Fun thing: Germany is at war with france as this switch was activated. The AI event has triggered even if the conditions where NOT true.
I observed an similar thing with another vanilla AI switch - the GER_Poland_After.ai was activated even if the specific event has "NOT = { local_flag = GERLowCountriesPrepare}" as condition and ingame the flag was set.

I'am just stupid and don't see the point? Are the DH AI switches somehow cursed/bugged/whatever?
 
Hi guys

I just observed a strange issue:

I checked the AI Switch log:

Code:
1941-01-30 : [ Deutsches Reich ] -> [ Mods\Eternal War/ai\switch/GER_Norway.ai ]

so, GER_Norway.ai was activated in 1941 for a second time.
(Invasion of Norway is long over, triggered correctly the first time)

BUT: theres is only ONE single event that activate this ai file.

Code:
################
# Norway Invasion AI
#############################################
event = {
    id = 3003001
    random = no
    country = GER
    persistent = yes
   
    trigger = {
        ai = yes
        NOT = { local_flag = GERInvadeNorway }
        NOT = {    lost_national = { country = GER value = 2 } }
        OR = {
            war = { country = NOR }
            war = { country = SWE }
            war = { country = FIN }
        }
        NOT = {
            AND = { # LOW COUNTRIES
                war = { country = HOL }
                NOT = { control = { province = 122 data = GER } } # Amsterdamm
            }
            AND = {
                war = { country = BEL }
                NOT = { control = { province = 116 data = GER } } # Brussels
            }
            AND = {
                war = { country = FRA }
                NOT = { control = { province = 55 data = GER } } # Paris
                OR = {
                    war = { country = HOL }
                    war = { country = BEL }
                }
            }
            AND = {
                war = { country = SOV }
                NOT = { land_percentage = { country = SOV value = 0.8 } }
                NOT = { lost_national = { country = SOV value = 10 } }
            }
        }
    }

    name = "AI_EVENT"
    style = 0  
   
    date = { day = 1 month = january year = 1933 }
    offset = 4
    deathdate = { day = 29 month = december year = 1963 }

    action_a = {
        command = { type = local_setflag which = GERInvadeNorway }
        command = { type = local_clrflag which = GERSubPatrol }
        command = { type = ai which = "switch/GER_Norway.ai" }
    }
}

(Vanilla event)

Fun thing: Germany is at war with france as this switch was activated. The AI event has triggered even if the conditions where NOT true.
I observed an similar thing with another vanilla AI switch - the GER_Poland_After.ai was activated even if the specific event has "NOT = { local_flag = GERLowCountriesPrepare}" as condition and ingame the flag was set.

I'am just stupid and don't see the point? Are the DH AI switches somehow cursed/bugged/whatever?
Persistent = yes will make the event fire multiple times instead of once
 
Persistent = yes will make the event fire multiple times instead of once
AND =

{ war = { country = FRA }
NOT = { control = { province = 55 data = GER } } # Paris

OR = { war = { country = HOL } war = { country = BEL } }

This condition means Germany is at war with France AND does not control Paris AND is either at war with HOL or BEL.

Since there is a NOT reverse all those conditions

You can be at war with France if at least one of those conditions other conditions aren't fulfilled.

Example: You're at war with France, you don't control Paris, you aren't actively at war with HOL or BEL. You haven't killed off Norway yet so the game says let's kill Norway!

Something is clearing the flag that turns the event off or the flag isn't getting set
 
  • 2
Reactions:
Thanks for answering!

I've changed the event condition do be a deceison:

Unbenannt.jpg


I know it's german but it should be anought to understand the problem. This is exact the same situation as when the AI file was loaded, except that norway no longer exists here. So the first "ODER" (OR) was true. We can ignore that for now.
The flag "GERInvadeNorway" is not set because after annexion, the game correctly loaded the GER_norway_end.ai and removed the flag.
(so: Germany at war with Norway first; since Belgium and Nederlands still existed, GER_Norway.ai loaded correctly the first time. One time during 1940, germany loaded the AI for the low countries/send troops to france (set target = { paris }, invasion of france started. Then, Norway get annexed and the AI executed GER_norway_end.ai, everything how it should be. but THEN, the game loaded GER_norway.ai (without conditions met) and the whole invasion of France stopped... GER_Norway_end.ai fired a day after again (becasue no norway) and removed the flag, yes, but at this point, the targets from the france invasion AI where already overwritten with the Norways targets. (and french invasion AI didn't triggered again because the conditions where no longer true) )

For the NOT you mentioned, all AND conditions have to be wrong the same time (becasue it's an AND and not an OR). As seen here:

- Frankreich ist nicht mit Deuscthes Reich im krieg (NOT France at war with germany)
- Paris steht unter Kontrolle von Deutsche Reich (NOT NOT Paris controlled by germany)
-OR
--Niederlande ist nicht im Krieg (NOT Nederlands at war)
--Belgien nixcht im Krieg (NOT Belgium an war)

But germany do not control Paris and France IS at war with germany. The AI should NOT go for Norway, becaus ethere iss till stuff to do in france.

I became aware of this situation since the germany AI ignored France (total stalement thus germany had superior numbers), so I checked the savegame and saw that the "target = {" section was only filled with Norway provinces (instead of french). After that I checked from which AI files these are coming and figured out it was the Norway.ai that was loaded (while conditions not met).
 
Last edited:
For the NOT you mentioned, all AND conditions have to be wrong the same time (becasue it's an AND and not an OR). As seen here:

- Frankreich ist nicht mit Deuscthes Reich im krieg (NOT France at war with germany)
- Paris steht unter Kontrolle von Deutsche Reich (NOT NOT Paris controlled by germany)
-OR
--Niederlande ist nicht im Krieg (NOT Nederlands at war)
--Belgien nixcht im Krieg (NOT Belgium an war)

But germany do not control Paris and France IS at war with germany. The AI should NOT go for Norway, becaus ethere iss till stuff to do in france.
That is correct, but you miss one detail:
Code:
            AND = {
                war = { country = FRA }
                NOT = { control = { province = 55 data = GER } } # Paris
                OR = {
                    war = { country = HOL }
                    war = { country = BEL }
                }
            }

For the AND above all parts should evaluate to TRUE:
  • war with FRA -> true
  • GER NOT in control of Paris -> true
  • GER at war with HOL or BEL will evaluate to TRUE only if at least one of these exist and is at war with GER, but will be FALSE if both are already annexed (trigger war with no existent country evaluates to FALSE).
So the event could trigger after the annexation of BEL and HOL regardless of the war with FRA and control of Paris given that all other conditions are met.

Thank for reporting this issue, we'll take care of it.
 
Last edited:
  • 1Love
Reactions:
That is correct, but you miss one detail:
Code:
            AND = {
                war = { country = FRA }
                NOT = { control = { province = 55 data = GER } } # Paris
                OR = {
                    war = { country = HOL }
                    war = { country = BEL }
                }
            }

For the AND above all parts should evaluate to TRUE:
  • war with FRA -> true
  • GER NOT in control of Paris -> true
  • GER at war with HOL or BEL will evaluate to TRUE only if at least one of these exist and is at war with GER, but will be FALSE if both are already annexed (trigger war with no existent country evaluates to FALSE).
So the event could trigger after the annexation of BEL and HOL regardless of the war with FRA and control of Paris given that all other conditions are met.

Thank for reporting this issue, we'll take care of it.

Many thanks for take a note!

Was very hard to search out for that issue :D
Just for that I get it right (and can fix it inside my own mod):

How the trigger should be like... with two "exist =" inside the AND?

Code:
            AND = {
                war = { country = FRA }
                  exists = HOL
                  exists = BEL
                NOT = { control = { province = 55 data = GER } } # Paris
                OR = {
                    war = { country = HOL }
                    war = { country = BEL }
                }
            }

I'm currently total out of HoI-Scripting mood, I not really see how to fix that up ^^
 
We think that the NOT part of this trigger is over-complicated and our current idea is to replace it with something simpler like:
Code:
NOT = {
    control = { province = 122 data = -2} } # Amsterdam is controlled by enemy country
    control = { province = 116 data = -2} } # Brussels is controlled by enemy country
    war = { country = SOV }
}
But it is yet to be tested, so use on your risk :)
 
We think that the NOT part of this trigger is over-complicated and our current idea is to replace it with something simpler like:
Code:
NOT = {
    control = { province = 122 data = -2} } # Amsterdam is controlled by enemy country
    control = { province = 116 data = -2} } # Brussels is controlled by enemy country
    war = { country = SOV }
}
But it is yet to be tested, so use on your risk :)
It is a bit complicated (many things in HoI are), but this version would be pretty different logically, right? I'm not 200% sure atm because it's late and I'm sleepy, but NOT = { ... } is by default NOT ALL { ... } and not NOT ANY { ... }, so this condition will only prevent the switch from getting loaded if GER is simultaneously at war with the controllers of 122 + 116 and SOV. Should probably be NOT = { OR = { on the entire thing?