Page 1 of 1

Script modding exemple: vehicles in melee

Posted: Sat Jan 28, 2017 4:10 pm
by Galdred
Here is how to change the scripts to make vehicles not stuck in melee anymore, that should help those unfamiliar with the engine to make other changes to the scripts:

First, create a new campaign by cloning an existing one (aka select the option to copy an existing campaign when you create a new one) in the editor.
Then, create the following folders in the new campaign folder (it should be in my documents/SanctusReach):

MyDocs/SanctusReach/MyCampaig/Data
MyDocs/SanctusReach/MyCampaig/Data/Scripts
MyDocs/SanctusReach/MyCampaig/Data/Battle/Scripts
copy Move.BSF(from your SanctusReach main folder: SteamApps/Common/Warhammer40000SanctusReach/Data/Battle/Scripts/Move.BSF to MyDocs/SanctusReach/MyCampaign/Data/Battle/Scripts

copy Functions.BSF(from your SanctusReach main folder: SteamApps/Common/Warhammer40000SanctusReach/Scripts/Functions.BSF to MyDocs/SanctusReach/MyCampaign/Data/Battle/Scripts

In your copy of
Move.BSF:

in
FUNCTION CHECK_ALL_MOVE(me, tilex, tiley, force)
replace if (IsMeleeEnemyAdjacent2(me) > 0)
with
if (IsMeleeEnemyAdjacent2(me) > 0 && GetAttrib(me, "IsVehicle") == 0)


and in
Functions.BSF
FUNCTION CheckMovePossible ( me, x, y, retreating, showRoute, ignoreUnseen )
replace :
if (IsMeleeEnemyAdjacentToTile(me, GetCheckRouteX(r-1), GetCheckRouteY(r-1)) > 0 )
with
if (IsMeleeEnemyAdjacentToTile(me, GetCheckRouteX(r-1), GetCheckRouteY(r-1)) > 0 && GetAttrib(me, "IsVehicle") == 0)

To enable the new files, copy SteamApps/Common/Warhammer40000SanctusReach/Scripts/$DEFAULT.BSF to MyDocs/SanctusReach/MyCampaign/Data/Battle/Scripts

Unless I forgot something, it should work.
Note that vehicles will also ignore walkers ZoC when moving.

Re: Script modding exemple: vehicles in melee

Posted: Mon Jan 30, 2017 1:30 pm
by GovRorschach
Hello !

Thanks for such a precise definition of where to modify files and functions !

I have a question. If I play this campaign in multi, will my game partner have to
- change these files also (I send him the campaign folder) ?
- just join and the server upload my files so he directly gets them in his game folder ?
- nothing is download by my game partner client and the server manages the rules of the campaign regarding my files only ?

Thanks !

Re: Script modding exemple: vehicles in melee

Posted: Mon Jan 30, 2017 4:17 pm
by pipfromslitherine
Because the mods can get so large (if you have custom gfx or sfx) we require people to have the mods installed before starting a game. You just need to zip the mod folder and send it to your opponent.

Cheers

Pip

Re: Script modding exemple: vehicles in melee

Posted: Mon Feb 06, 2017 4:51 pm
by Mophead
pipfromslitherine wrote:You just need to zip the mod folder and send it to your opponent.
That makes sense. Can you have more than one match setup at a time with a modded multiplayer folder and contents? Could I have one map and two concurrent opponents on two versions of that map?

Editing a Multiplayer folder can mess up an active match using that folder.

Re: Script modding exemple: vehicles in melee

Posted: Mon Feb 06, 2017 5:32 pm
by pipfromslitherine
You are correct that editing a mod after you put it live is not a great idea. You can definitely have >1 folder version of a mod, I would just change the strings (in TEXT1.TXT) to make it simpler to know what version you are trying to play.

Cheers

Pip