Page 1 of 1
Modding events/scripts
Posted: Tue Dec 08, 2015 6:24 am
by MarshalJean
Quick question for you veteran AGEOD modders. I started to get into some really light modding with PoN a year or so ago and really loved creating immersive events. For PoN, it seemed simpler to just jump into a nation's event folder and add an event and then advance a turn and watch it pop up.
But as I've looked at the folders for WoN, it seems much more complicated. I'm sure it's not, I just don't know what I'm looking at. For instance, if I'm playing the August 1805 GC as France, what event folder do I add an event for? Will any 1805 GC folder work as long as my syntax is correct? Does it have to be a French one? Do I have to find the right folder containing the right kind of script? Because WoN has a greater variety of script folders with a lot more categories (some for diplomatic events, different ones for historical flavor, yet others for regional decision cards, etc.) whereas PoN would have just separated script/event folders by nation alone.
Any advice on this would be appreciated by you veterans out there. Thanks in advance.
MJ
Posted: Tue Dec 08, 2015 7:06 am
by lukasberger
MarshalJean wrote:Quick question for you veteran AGEOD modders. I started to get into some really light modding with PoN a year or so ago and really loved creating immersive events. For PoN, it seemed simpler to just jump into a nation's event folder and add an event and then advance a turn and watch it pop up.
But as I've looked at the folders for WoN, it seems much more complicated. I'm sure it's not, I just don't know what I'm looking at. For instance, if I'm playing the August 1805 GC as France, what event folder do I add an event for? Will any 1805 GC folder work as long as my syntax is correct? Does it have to be a French one? Do I have to find the right folder containing the right kind of script? Because WoN has a greater variety of script folders with a lot more categories (some for diplomatic events, different ones for historical flavor, yet others for regional decision cards, etc.) whereas PoN would have just separated script/event folders by nation alone.
Any advice on this would be appreciated by you veterans out there. Thanks in advance.
MJ
I'll try to look at the WON events and let you know what I think fairly soon.
Meanwhile, somewhat off topic, would you be willing to post the PON events you've created in the PON mods forum? I'd love to look at them and maybe add them to my game!
Posted: Tue Dec 08, 2015 11:36 am
by Captain_Orso
There is only one Events folder, and its name is ... Events
Putting a file with an event into the Events folder will not get the game to read it.
There are two options from which you can choose:
- Add the event itself into one of the files which the scenario in question will read.
- Add an Include state naming the event file in the scenario file.
1. is the quickest way to add an event, and it should work in the middle of a running scenario. If you are playing the August 1805 Grand Campaign, for example, look in the 'Events\4 - 1805 August Grand Campaign.sct' file to see all the events which are included in that scenario:
Code: Select all
NULL
GC1805_Leaders.sct
GC1805_MonarchEvents.sct
GC1805_FlavorEvents.sct
RegionsDecisionsRenewal.sct
.
.
.
Here you see that the 'GC1805_FlavorEvents.sct' script file is 'included' in the scenario. Edit this file to add your event (make a backup copy of the file first and store it in a safe place).
2. is the simplest, but I'm not sure if it will work with an already running scenario. Again using the August 1805 Grand Campaign as an example:
- Put your event into its own file; eg: 'My_Special_Events.sct' and put this file into the Events folder.
- Edit 'Events\4 - 1805 August Grand Campaign.sct' to include your events file:
Code: Select all
NULL
[U]My_Special_Events.sct[/U]
GC1805_Leaders.sct
GC1805_MonarchEvents.sct
GC1805_FlavorEvents.sct
RegionsDecisionsRenewal.sct
.
.
.
In both cases your added event(s) will only be recognized during the next turn execution.
Remember, your special event(s) my be included in other scenarios which you did not intend to have it if you are not careful and know all the ins-and-outs of how scripting of scenarios works. Caveat Emptor!!
Posted: Wed Dec 09, 2015 5:03 pm
by MarshalJean
Thank you, Captain Orso. Very helpful. I've located the proper event file. I knew enough to know that I couldn't just add a file to the Events folder (that doesn't work in PoN, either). I just wasn't sure which file was the right one to edit, in this case GC 1805 FlavorEvents.sct. Very helpful.
One more thing, if you know. Where do I go to get help on syntax for script commands to use for WoN? I know there will be a lot of crossover with other games (PoN being the one I am familiar with), but I'm sure there are new scripts for this game that aren't included in others, as well. For instance, how to add more horses or conscripts or money, or make sure sure a treaty fires? I am not asking you to give me the syntax yourself, just a wiki site or something else, if you know of one.
Thank you, sir.
MJ
Quick EDIT here...
I just looked through the various event files in the folder and found a lot to work with regarding syntax. I can start with this. Thanks again for your help! I may be back for more later...

Posted: Wed Dec 09, 2015 5:30 pm
by lodilefty
MarshalJean wrote:Thank you, Captain Orso. Very helpful. I've located the proper event file. I knew enough to know that I couldn't just add a file to the Events folder (that doesn't work in PoN, either). I just wasn't sure which file was the right one to edit, in this case GC 1805 FlavorEvents.sct. Very helpful.
One more thing, if you know. Where do I go to get help on syntax for script commands to use for WoN? I know there will be a lot of crossover with other games (PoN being the one I am familiar with), but I'm sure there are new scripts for this game that aren't included in others, as well. For instance, how to add more horses or conscripts or money, or make sure sure a treaty fires? I am not asking you to give me the syntax yourself, just a wiki site or something else, if you know of one.
Thank you, sir.
MJ
Quick EDIT here...
I just looked through the various event files in the folder and found a lot to work with regarding syntax. I can start with this. Thanks again for your help! I may be back for more later...
All AGEOD games use the same scripting language.
Documentation is at the Wiki:
http://www.ageod.net/agewiki/Main_Page
We try to keep it current!
Also, note that many game concepts are described under the "Definitions" group.
Posted: Wed Dec 09, 2015 7:57 pm
by MarshalJean
Thank you, Captain Orso.
One problem I'm already having. After making a copy of the GC 1805 FlavorEvents.sct Event file and placing it in another location, and after adding a script to the original GC 1805 FlavorEvents.sct event file, I then tried to save the file over the same file name. I assume that this is very important as the game will look for the file that has this name. But when I tried to save over the designated name, an alert message came up and said "Access Denied." I tried it a few more times, but got the same message. So how do you add a script to this event file?
Posted: Wed Dec 09, 2015 8:20 pm
by MarshalJean
Okay. I figured out the problem. It was a security thing and I changed the permissions, letting me edit the files. I can save Event files, now.
But my added event still didn't fire. There could be a lot of reasons for this, so I will have to do some more testing, when I have time. But I'm hoping that the problem isn't that the GC 1805 FlavorEvents.sct file is the wrong file to add events to. If so, then I'm back to square one on figuring out the right file. But I'm far from proving this. I'll try some simpler events with a lot less conditions, just to make sure this file is the right one, first.
Thanks.
MJ
Posted: Wed Dec 09, 2015 10:12 pm
by lodilefty
Look in the ScriptReport for that turn, see what your event did.....
Posted: Wed Dec 09, 2015 11:53 pm
by MarshalJean
Hi, lodilefty. Thanks for this. To be honest, I'm not sure where this ScriptReport for the last turn is found.
With my most recent test (in an attempt to get more horses), it did nothing. This is what I put in the GC 1805 FlavorEvents.sct file:
SelectFaction = FRA
StartEvent = evt_nam_FRA_Horses for the Emperor!|1|2|$Paris|NULL
Actions
SelectFaction = FRA
SelectFaction = FRA
ChangeResStock = $resHorses;500
EndEvent
Is there something wrong in it? If not, should it go into a different event folder besides the GC 1805 FlavorEvents.sct ??
Posted: Thu Dec 10, 2015 12:11 am
by MarshalJean
Quick addition...
Trust tried the same script in the GC 1805 FRA FMEvents folder and it didn't work there, either.
Posted: Thu Dec 10, 2015 2:14 am
by Captain_Orso
MarshalJean wrote:Hi, lodilefty. Thanks for this. To be honest, I'm not sure where this ScriptReport for the last turn is found.
With my most recent test (in an attempt to get more horses), it did nothing. This is what I put in the GC 1805 FlavorEvents.sct file:
SelectFaction = FRA
StartEvent = evt_nam_FRA_Horses for the Emperor!|1|2|$Paris|NULL
Actions
SelectFaction = FRA
SelectFaction = FRA
ChangeResStock = $resHorses;500
EndEvent
Is there something wrong in it? If not, should it go into a different event folder besides the GC 1805 FlavorEvents.sct ??
There are a couple of things.
First, the format if the StartEvent is missing the event text string and the event graphic. The format of the StartEvent statement is:
StartEvent = evt_nam_FAC_NameOfEvent|Repetion|Scope|evt_txt_FAC_LabelOfEventText|Event-Img_FAC_NameOfEventImage|AliasToFocusScreen|Sound#
Repetition (0-999): how often the event may fire.
Scope (0-2): 0= no report, 1= line event, a line of text is written to the message logs, 2= full event, a clickable line of text is written to the message log. Clicking on the icon of that line will open a window to display the Event-Img_FAC_NameOfEventImage and play the Sound# (See \NGC\Sounds\Sounds.ini for the index of files. May be NULL for no sound.
evt_txt_FAC_LabelOfEventText:
line and full event texts are complicated. I would suggest using |1|0|. You will get no report in the message logs, but you will see the difference in horses, plus you can look in the script report: ..\My Games\Wars of Napoleon\NGC\Scripts\ScriptReportXXXX.txt where XXXX is the engine-turn number. Look in the newest file for the latest report.
Possibly that there's no Conditions statement may also affect it running. BTW multiple SelectFaction statements inside the event are superfluous.
Try this:
SelectFaction = FRA
StartEvent = evt_nam_FRA_Horses for the Emperor!|1|0|NULL|NULL|$Paris|NULL
Conditions
MinDate = 1805/01/01
Actions
SelectFaction = FRA
ChangeResStock = $resHorses;500
EndEvent
Posted: Thu Dec 10, 2015 6:05 am
by MarshalJean
It finally worked. Thank you, my friend. I was even able to write another more complicated event, with text that was linked to the event (newspaper) opening. Worked fine. Now I just need to figure out if I can get the Treaty of Pressburg to fire. I met the conditions a long time ago. I want to dig around and see if I can force it to fire, along with all of its benefits to my (the French player).
Thanks again!
MJ