Question about evasion
Moderator: rbodleyscott
Question about evasion
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.
-
rbodleyscott
- Field of Glory 2

- Posts: 28320
- Joined: Sun Dec 04, 2005 6:25 pm
Re: Question about evasion
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.
Richard Bodley Scott


Re: Question about evasion
Thanks, really a great and detailed answer! I´ll try when my job let me. Two related questions:rbodleyscott wrote: ↑Fri Nov 18, 2022 7:19 am
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.
-Would light spear had some effect in the 1% light lancers/lancers solution? For instance, imagine I have a unit of cavalry 1% lancers but 100% light spear because I want them to have some punch on impact but worse than lancers. Would they evade?
-Is there a way to mod a unit that have limited lancer and knightly lancer capabilities? Let´s say a unit that gets half of POA on impact but has the same interactions with another unit capabilities.
Thanks again.
-
rbodleyscott
- Field of Glory 2

- Posts: 28320
- Joined: Sun Dec 04, 2005 6:25 pm
Re: Question about evasion
Yes, but not if they also had 1% lancers (and less than 100% bow)
Not without modding game scripts. Units with at least 50% lancer capability get 100% lancer capability at impact, and units with less get none.-Is there a way to mod a unit that have limited lancer and knightly lancer capabilities? Let´s say a unit that gets half of POA on impact but has the same interactions with another unit capabilities.
Richard Bodley Scott


Re: Question about evasion
I understand. Thanks!rbodleyscott wrote: ↑Sun Nov 20, 2022 8:04 am Yes, but not if they also had 1% lancers (and less than 100% bow)
Not without modding game scripts. Units with at least 50% lancer capability get 100% lancer capability at impact, and units with less get none.
