Page 1 of 1

Custom scripts in scenario folder

Posted: Sat Feb 25, 2023 6:50 pm
by CharlesdeBatz
When creating a scenario that modifies base game scripts (e.g., StartTurn.bsf), should those modified scripts be placed in the scenario folder under campaigns in the corresponding directory? That is, for StartTurn, the modified file should be in My Games\FieldofGlory2\Campaigns\*SCENARIO NAME*\Data\Battle\Scripts?

I am getting a duplicate function error when I use this method, so I am unsure how this would be accomplished properly.

Re: Custom scripts in scenario folder

Posted: Mon Feb 27, 2023 7:37 am
by rbodleyscott
CharlesdeBatz wrote: Sat Feb 25, 2023 6:50 pm When creating a scenario that modifies base game scripts (e.g., StartTurn.bsf), should those modified scripts be placed in the scenario folder under campaigns in the corresponding directory? That is, for StartTurn, the modified file should be in My Games\FieldofGlory2\Campaigns\*SCENARIO NAME*\Data\Battle\Scripts?

I am getting a duplicate function error when I use this method, so I am unsure how this would be accomplished properly.
You appear to be using the correct method.

See the chart at the end of this document:

https://archonwiki.slitherine.com/index.php/Modding

Assuming that the script files have the exactly the same name, the modded one will replace the vanilla one completely. (Or not at all, in the case of Core.bsf and Core/UI items)

So, somewhere you have two functions with the same name. Is the duplicate function name used in another main game script?