Page 1 of 1
How do I change the events script?
Posted: Fri Mar 13, 2020 3:41 am
by Nachtmahr667
Hello all,
I have a problem. I wanted to add a few annexation events in the "_events" text file of the 1939 scenario. I copy-pasted the event "Germany Annexes Poland" (see 1. below) and only changed the numbers and descriptions in the event I added (see 2. below). In the game, the Poland annexation event works, but my added annexation event doesn't. I don't understand why. Can somebody help me? Thanks in advance!
1.
//Germany Annexes Poland
$Annex
if_Date=1/1/1939
if_Country=42
if_Surrender=true
actionCountry=42
targetCountry=6
lifespan=tillTrigger
xyArea=allHexes
changeBorders
addReportTo=All
text=Germany annexes Western Poland into Greater Germany.
$End
2.
//Germany Annexes North Schleswig
$Annex
if_Date=1/1/1939
if_Country=17
if_Surrender=true
actionCountry=17
targetCountry=6
lifespan=tillTrigger
xyArea=152,67
xyArea=153,67
xyArea=153,66
xyArea=154,67
changeBorders
addReportTo=All
text=Germany Annexes North Schleswig
$End
RE: How do I change the events script?
Posted: Tue Mar 17, 2020 1:46 pm
by AlvaroSousa
Should work. I'll test it out and let you know.
RE: How do I change the events script?
Posted: Tue Mar 17, 2020 1:58 pm
by AlvaroSousa
The issue is 3 of the 4 hexes Germany already owns. The 4th one does convert. It works.
xyArea=153,67
RE: How do I change the events script?
Posted: Wed Mar 18, 2020 1:28 am
by Nachtmahr667
ORIGINAL: Alvaro Sousa
The issue is 3 of the 4 hexes Germany already owns. The 4th one does convert. It works.
xyArea=153,67
Thanks for your reply, Alvaro.
However, it doesn't work for me. Not only does the hex not convert, I also do not get a report in the "turn report" overview. It's as if my added event wasn't there at all. Do I have to make more changes than just add a few lines in that text file? Here is my text flow in that file:
[...]
//UK gets manpower from Poland's fall
$ModifyCountry
if_Date=9/15/1939
if_Country=42
if_Surrender=true
actionCountry=1
lifespan=tillTrigger
manpower=20
text=Polish prime minister and commander Wladyslaw Sikorski, evacuates Polish forces to Allied controlled territory as his country falls to the German invasion. England gains 20 manpower.
addReportTo=Allies
$End
//Germany Annexes North Schleswig
$Annex
if_Date=1/1/1939
if_Country=17
if_Surrender=true
actionCountry=17
targetCountry=6
lifespan=tillTrigger
xyArea=153,67
changeBorders
addReportTo=All
text=Germany Annexes North Schleswig
$End
//Remove Maginot Line
$GiveResource
if_Date=1/1/1939
if_Country=2
if_Surrender=true
actionCountry=6
lifespan=tillTrigger
//no resource
xyArea=146,53,0
xyArea=147,53,0
xyArea=148,53,0
xyArea=149,52,0
xyArea=150,49,0
xyArea=150,50,0
xyArea=150,51,0
xyArea=150,52,0
addReportTo=Axis
text=Germany dismantles the Maginot line for 50 production points.
$End
[...]
RE: How do I change the events script?
Posted: Wed Mar 18, 2020 7:13 am
by Nachtmahr667
Actually...
I have just noticed something.
In version 1.05, the event "Germany annexes Poland" is no longer an $Annex action, but a $ChangeTerritory action. In my game, the result of this is that Germany no longer acquires those hexes and no border changes take place. The event still contains the line "changeBorders", but that has no effect in game. I manually overwrote this and changed it back to an $Annex action, but that did not result in any change.
By contrast, the event "Germany and USSR split Poland" is still an $Annex action in v1.05 and happens as written, border changes and all.
I reinstalled version 1.04, where the event "Germany annexes western Poland" is still an $Annex action from the start, and the annexation and border changes happen as written.
I have come to the conclusion that any manual changes to the "_events" file are ignored by the game. There must be some other, deeper place that also requires change. But that exceeds my knowledge.
Funnily enough, manual changes in the "scenarioDescription" and the "scenarioGamePlay" files ARE recognized by the game. But not changes in the "_events" file.
Slightly sad,
Alex
RE: How do I change the events script?
Posted: Wed Mar 18, 2020 8:05 am
by Nachtmahr667
Ok, one final experiment brought certainty: Any manual changes to the "_events" file get indeed completely ignored. First, I completely deleted the "Germany and USSR split Poland" event and the "Germany annexes Poland" event, and then I even renamed the whole file. The game didn't care at all. It was as if I hadn't done anything at all. The game obviously does not access the file. The information it accesses must be stored somewhere else.
I am obviously missing a step. But I don't know what it could be. Something in the scenario file? Something I have to do in the editor? But I don't find anything along the lines of "import" or "update" events in the editor...
Help![&o]
RE: How do I change the events script?
Posted: Wed Mar 18, 2020 3:39 pm
by AlvaroSousa
Are you forgetting to import scripts before saving?
Read the modding manual.
File/Quit -> Load All Scripts (lower right) -> pick name to save -> Save
RE: How do I change the events script?
Posted: Wed Mar 18, 2020 9:43 pm
by Nachtmahr667
Oops... >.<;; That was it. Thank you!
Now that I know there is a modding manual I hope I will never make such a rookie mistake >.<;;