Script modding exemple: vehicles in melee

Post Reply
Galdred
Master Sergeant - U-boat
Master Sergeant - U-boat
Posts: 504
Joined: Tue Nov 15, 2011 5:43 am

Script modding exemple: vehicles in melee

Post 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.
GovRorschach
Lance Corporal - Panzer IA
Lance Corporal - Panzer IA
Posts: 13
Joined: Tue Jan 24, 2017 11:58 am

Re: Script modding exemple: vehicles in melee

Post 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 !
pipfromslitherine
Site Admin
Site Admin
Posts: 9707
Joined: Wed Mar 23, 2005 10:35 pm

Re: Script modding exemple: vehicles in melee

Post 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
follow me on Twitter here
Mophead
Corporal - Strongpoint
Corporal - Strongpoint
Posts: 59
Joined: Sun Jan 29, 2017 7:23 pm

Re: Script modding exemple: vehicles in melee

Post 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.
pipfromslitherine
Site Admin
Site Admin
Posts: 9707
Joined: Wed Mar 23, 2005 10:35 pm

Re: Script modding exemple: vehicles in melee

Post 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
follow me on Twitter here
Post Reply

Return to “Sanctus Reach Mods and Scenario Design”