gTurnInfos.scenarioID in mod with crash

Moderator: FOGK Moderators

Post Reply
kronenblatt
General - Carrier
General - Carrier
Posts: 4631
Joined: Mon Jun 03, 2019 4:17 pm
Location: Stockholm, SWEDEN

gTurnInfos.scenarioID in mod with crash

Post by kronenblatt »

I'm creating a scenario mod, basing the SCENARIO.BSF off the Angevine scenario. It's coming along quite nicely, but when I change the gTurnInfos.scenarioID = $ID_SCEN_ANGEVIN to something more arbitrary for my mod (gTurnInfos.scenarioID = $ID_SCEN_EXCOB) in order to decouple it from the start scene and message and the events and settings of the base game Angevin scenario, the mod is now crashing when launched along with the Unexpected token: $ID_SCEN_EXCOB error message and Context: FUNCTION Scenarion_InitMapEntry().

Why is that? And what do I need to do to fix it?
kronenblatt's campaign and tournament thread hub:

https://www.slitherine.com/forum/viewtopic.php?t=108643
kronenblatt
General - Carrier
General - Carrier
Posts: 4631
Joined: Mon Jun 03, 2019 4:17 pm
Location: Stockholm, SWEDEN

Re: gTurnInfos.scenarioID in mod with crash

Post by kronenblatt »

Received answer on Discord server (thanks, Pocus!), so sharing it here as well for future use:

Anything with a $ is an alias, a shortcut/mnemonic to a numerical value.
You can add new ones in aliases.csv, check the $IDSCEN section there.
That would be the proper way to do it, have your own alias for your scenario, and reference it when you need it in the equivalent sections in events.bsf for example.
Many aliases are generated by reading the CSV files, e.g. $ID_FAC_VEN is the alias to the Venice faction.
The game will catalog the aliases it sees in l\Documents\My Games\EmpiresKingdoms\AUTODOCS\ALIASES.TXT, for example $ID_FAC_VEN = 335544504
Normally at all points, the code will replace in memory $ID_FAC_VEN with the value 335544504, but for us fleshbags, $ID_FAC_VEN is easier to remember, but if you were to use faction 335544504, the code would be happy too.
And so, all that to say that $ID_SCEN_SCENARIO_KNB1 = 350 is a valid value, as long as you don't use the same as the others $ID_SCEN values.
kronenblatt's campaign and tournament thread hub:

https://www.slitherine.com/forum/viewtopic.php?t=108643
Post Reply

Return to “Field of Glory: Kingdoms - Modding and Scenarios”