How do I change the events script?

Moderator: AlvaroSousa

Post Reply
Nachtmahr667
Posts: 24
Joined: Fri Nov 01, 2019 10:48 am

How do I change the events script?

Post 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
User avatar
AlvaroSousa
Posts: 11991
Joined: Mon Jul 29, 2013 7:13 pm
Contact:

RE: How do I change the events script?

Post by AlvaroSousa »

Should work. I'll test it out and let you know.
Creator Kraken Studios
- WarPlan
- WarPlan Pacific

Designer Strategic Command
- Brute Force (mod) SC2
- Assault on Communism SC2
- Assault on Democracy SC2
- Map Image Importer SC3
User avatar
AlvaroSousa
Posts: 11991
Joined: Mon Jul 29, 2013 7:13 pm
Contact:

RE: How do I change the events script?

Post by AlvaroSousa »

The issue is 3 of the 4 hexes Germany already owns. The 4th one does convert. It works.

xyArea=153,67

Creator Kraken Studios
- WarPlan
- WarPlan Pacific

Designer Strategic Command
- Brute Force (mod) SC2
- Assault on Communism SC2
- Assault on Democracy SC2
- Map Image Importer SC3
Nachtmahr667
Posts: 24
Joined: Fri Nov 01, 2019 10:48 am

RE: How do I change the events script?

Post 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

[...]
Nachtmahr667
Posts: 24
Joined: Fri Nov 01, 2019 10:48 am

RE: How do I change the events script?

Post 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
Nachtmahr667
Posts: 24
Joined: Fri Nov 01, 2019 10:48 am

RE: How do I change the events script?

Post 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]
User avatar
AlvaroSousa
Posts: 11991
Joined: Mon Jul 29, 2013 7:13 pm
Contact:

RE: How do I change the events script?

Post 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
Creator Kraken Studios
- WarPlan
- WarPlan Pacific

Designer Strategic Command
- Brute Force (mod) SC2
- Assault on Communism SC2
- Assault on Democracy SC2
- Map Image Importer SC3
Nachtmahr667
Posts: 24
Joined: Fri Nov 01, 2019 10:48 am

RE: How do I change the events script?

Post 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 >.<;;
Post Reply

Return to “MODS and Scenarios”