I apologize if this is in the wrong forum, but I figured that the people with the most experience with event scripts would be found here. I don't have a real good grasp of the event script just yet, but I think I may have found a small bug. Just bare with me.
I am playing an isolationist USA, version 1.3b. In September, 1945 AI Germany forced the Bitter Peace with the Soviet Union, but only after I tweaked the event to make it fire. Anyway, after the Bitter Peace Germany just sat there. After several months I loaded up as Germany to see what it was doing. It was still moving troops to the Russian front and not preparing for an invasion of Great Britain like I was expecting.
I decided to look at the save game file and noticed the flag "GERInvadeEngland = 0". I looked closer at Germany's AI file. Event 20020 "Germany goes after England when Russia is gone" looks like it should have fired, but it apparently didn't. Here's the event:
event = {
id = 20020
random = no
country = GER
trigger = {
ai = yes
event = 20010
NOT = { war = { country = GER country = SOV } }
control = { province = 56 data = GER } # Paris
war = { country = GER country = ENG }
}
name = "AI_EVENT"
style = 0
date = { day = 1 month = january year = 1936 }
offset = 1
deathdate = { day = 29 month = december year = 1948 }
action_a = {
command = { type = local_setflag which = GERInvadeSpain }
}
}
The only trigger that would have prevented this event from firing is "event = 20010". Logically, I assume Event 20010 "German vs Russia war setup" never fired. I also notice that event 20010 sleeps event 20007 "Germany invades Russia", which sleeps event 20010. Events 20007 and 20010 both load the GER_Russia.ai file, and they cancel each other out.
Okay, follow my logic here. Germany did invade Russia in my game, so I figure that one of these two events must have fired. Since event 20020 did not fire, that means event 20007 fired and slept 20010. Which means that Germany won't invade Great Britain under these circumstances.
I changed event 20020's trigger to:
trigger = {
ai = yes
OR = {event = 20010 event = 20007}
NOT = { war = { country = GER country = SOV } }
control = { province = 56 data = GER } # Paris
war = { country = GER country = ENG }
}
I loaded up the game and let it run for a few days then checked the save game. Sure enough the flag was changed to "GERInvadeEngland = 1". I'm happy to report that Germany is massing its troops on the French coast.
However, I don't fully understand what the event chains are trying to achieve and why those two events cancel each other out, so someone please point out if I broke something that was working as intended.
Thanks for reading this far.
I am playing an isolationist USA, version 1.3b. In September, 1945 AI Germany forced the Bitter Peace with the Soviet Union, but only after I tweaked the event to make it fire. Anyway, after the Bitter Peace Germany just sat there. After several months I loaded up as Germany to see what it was doing. It was still moving troops to the Russian front and not preparing for an invasion of Great Britain like I was expecting.
I decided to look at the save game file and noticed the flag "GERInvadeEngland = 0". I looked closer at Germany's AI file. Event 20020 "Germany goes after England when Russia is gone" looks like it should have fired, but it apparently didn't. Here's the event:
event = {
id = 20020
random = no
country = GER
trigger = {
ai = yes
event = 20010
NOT = { war = { country = GER country = SOV } }
control = { province = 56 data = GER } # Paris
war = { country = GER country = ENG }
}
name = "AI_EVENT"
style = 0
date = { day = 1 month = january year = 1936 }
offset = 1
deathdate = { day = 29 month = december year = 1948 }
action_a = {
command = { type = local_setflag which = GERInvadeSpain }
}
}
The only trigger that would have prevented this event from firing is "event = 20010". Logically, I assume Event 20010 "German vs Russia war setup" never fired. I also notice that event 20010 sleeps event 20007 "Germany invades Russia", which sleeps event 20010. Events 20007 and 20010 both load the GER_Russia.ai file, and they cancel each other out.
Okay, follow my logic here. Germany did invade Russia in my game, so I figure that one of these two events must have fired. Since event 20020 did not fire, that means event 20007 fired and slept 20010. Which means that Germany won't invade Great Britain under these circumstances.
I changed event 20020's trigger to:
trigger = {
ai = yes
OR = {event = 20010 event = 20007}
NOT = { war = { country = GER country = SOV } }
control = { province = 56 data = GER } # Paris
war = { country = GER country = ENG }
}
I loaded up the game and let it run for a few days then checked the save game. Sure enough the flag was changed to "GERInvadeEngland = 1". I'm happy to report that Germany is massing its troops on the French coast.
However, I don't fully understand what the event chains are trying to achieve and why those two events cancel each other out, so someone please point out if I broke something that was working as intended.
Thanks for reading this far.
Last edited: