Horde wrote: ↑Thu Nov 17, 2022 2:36 pm
How could I mod the game to forbid evasion to a particular unit that does it under normal rules? In this case, a cavalry unit that I don´t want to evade lancers in an scenario. Thanks in advance.
One way would be to give the cavalry 1% heavy_lancers capability (in addition to their other capabilities).
As far as I can tell from a look through the scripts, this would not have any effect on combat, but would prevent them from being able to evade.
Alternatively they could be 1% light_lancers, which might look more plausible in their unit card, but would only prevent evasion if they have less than 100% bowmen. A unit with 1% light_lancers and 99% Bowmen capabilites would not be able to evade.
The simplest way to make these changes would be to put a modded version of Squads.csv in your user content folder, with one of the aboves change made to the unit(s) concerned. This would only work for you provided that you wanted all units of that type not to evade.
A less simple, but more flexible, way would be to code the change for certain units in CustomiseUnits() in the scenario script.
Alternatively, in your custom folder, in /Data/Battle/Scripts, you could put a modded version of Assault.BSF with changed conditions near the top of the DoEvadeAndPursuit() function.
But that would risk your scenario possibly ceasing to work due to script errors if ever a future update makes other incompatible alterations to Assault.BSF.