Issue with Assault.BSF script file

Post Reply
kvnrthr
Corporal - 5 cm Pak 38
Corporal - 5 cm Pak 38
Posts: 49
Joined: Sun Sep 20, 2015 8:37 pm

Issue with Assault.BSF script file

Post by kvnrthr » Mon Feb 25, 2019 7:33 am

Recently I was trying to change evasion behavior and was unable to get it to work.

I copied Assault.BSF into CustomCampaignName/Data/Scripts and edited it there.

I modified the function "DoEvadeAndPursuit", specifically this section here:

if ((IsUnitSquadType(me, "Cavalry") == 1) || (IsUnitSquadType(me, "Camelry") == 1)) // Cavalry and camelry can evade if not charged by cavalry or camelry
{
if ((IsUnitSquadType(enemy, "Cavalry") == 0) && (IsUnitSquadType(enemy, "Camelry") == 0))
{
evade = 1;
}
}

Basically I wanted to allow all cavalry/camelry to be able to evade other units, but cavalry would not be able to evade cavalry.

However I tested it in game and could not get it to work. The game didn't crash but the behavior didn't change. Do you know what might be causing this?

I tried testing this in Sengoku Jidai which has a similar file structure and ended up having to change the file in the main game directory rather than the custom campaign folder. Could there be some issue with which file takes precedence?

rbodleyscott
Field of Glory 2
Field of Glory 2
Posts: 21851
Joined: Sun Dec 04, 2005 6:25 pm

Re: Issue with Assault.BSF script file

Post by rbodleyscott » Mon Feb 25, 2019 10:22 am

Look at the chart at the end of this document:

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

Modded scripts are supposed to go in

CustomCampaignName/Data/Battle/Scripts

rather than

CustomCampaignName/Data/Scripts
kvnrthr wrote:
Mon Feb 25, 2019 7:33 am
Could there be some issue with which file takes precedence?
There have been issues with that in the past, but I think they were fixed in ARCHON - possibly not in the STUB engine used by Sengoku Jidai. The old workaround was to add a copy of $DEFAULT.BSF to CustomCampaignName/Data/Battle/Scripts

-------------------------

You can test whether the game is running your modded script as follows:

1) Add the line

DEBUGMODE 1

to

/Documents/My Games/FieldOfGlory2/User.txt

2) Add the code

DebugLog("Yes, it is running this modded script");

after the variable definitions at the start of your DoEvadeAndPursuit() function.

3) Run the game and make something evade (or not evade).

4) Look at

/Documents/My Games/FieldOfGlory2/Error.log

to see if

Yes, it is running this modded script

appears.
Richard Bodley Scott

Image

Post Reply

Return to “Field of Glory II: Modding”