Back to Mechstorm.

Mechstorm's Complete Map Making Tutorial or MCM for Short. Covering Mechwarrior4, Mechwarrior4:BK and Mechwarrior4:Mercs. If you have any questions feel free to drop by our Mechstorm Editor/Scripting help Forum after you have registered on our forums.

Back to MCM Menu

Updated Jan 23 2005

External Configuration Files for your Single player or Coop Missions.

A trick Ash showed me is the use of a custom abi file to store mission settings outside of your missions mw4 file. Thus allowing you to tweak your mission and test it without needing to resave your mission all the time and send it others. One server side file is all that needs tweaking. Much cleaner if your making coops for online play and want to change the settings quickly during a test night and still nice option if your just a player and want to liven up or tone down a mission a bit.

Here is the top part of a script. The lines marked in bold type are the ones to look at since these give you a clue how this works. These are dev team abi file entries. Dont touch them.

fsm myscript: integer;

const
#include_ <content\ABLScripts\mwconst.abi>

type
#include_ <content\ABLScripts\mwtype.abi>

Now if you create a folder in your Mechwarrior 4 Mercs folder called Settings and create a file in there called mysettings.abi then add this line below the ones marked in bold above you can tell the above script to use an external settings file.

#include_ <settings\mysettings>

This is only really worth doing on Coop missions and Single player missions since Typical team games gain no real benefit from this other than giving server admins a way of tweaking the scoring to make their server unique.

Your mysettings.abi file may look something like this.

This is a real abi settings file for the Single player Coventry mission available from the Mechstorm site.

// BATTLE OF ST WILLIAM 1 Single player settings.

// Editable Mission Turret settings.
// Turret settings can be tweaked.

attackRange1 = 999; // used to tell help the bots target mechs at these ranges. 0 to 100 (999 = best).
withdrawRange1 = 999; // used to tell help the bots target mechs at these ranges. 0 to 100 (999 = best).
takeOffDistance1 = 160; // Not used by turrets.
piloting1 = 10; // Not used by turrets.
gunnery1 = 60; // Gunnery skill, vital for turrets. 0 to 100 (999 = best).
minDelay1 = 2.0; // Min Number of seconds between shots.
maxDelay1 = 4.0; // Max number of seconds between shots.
eliteLevel1 = 50; // Not used by turrets. 0 to 100.
isShotRadius1 = 100; // I am shot if a shot comes within this distance of me, in meters.
attackThrottle1 = 50; // Not used by turrets.

attackSound = -1; // no sound // ignore these.
deathSound = -1; // no sound // ignore these.
mood1 = AGRESSIVE_END; // Ready to fire sir!
findTypes1 = FT_DEFAULT; // Target everything.
startupradius1 = 1000; // Start up as soon as the enemy gets with in this distance.

// Defenders: Bot lance settings.

attackRange2 = 999; // used to tell help the bots target mechs at these ranges. 0 to 100 (999 = best).
withdrawRange2 = 999; // used to tell help the bots target mechs at these ranges. 0 to 100 (999 = best).
takeOffDistance2 = 160; // Not used by mechs.
piloting2 = 99; // Piloting skill helps the bots navigate. Do not edit. 0 to 100 (999 = best).
gunnery2 = 60; // How good a shot are we ? 0 to 100 (999 = best).
minDelay2 = 2.0; // Min Number of seconds between shots.
maxDelay2 = 4.0; // Max number of seconds between shots. 0 to 100.
eliteLevel2 = 80; // A measure of how good the mech is at chosing different tactics.
isShotRadius2 = 100; // I am shot if a shot comes within this distance of me, in meters.
attackThrottle2 = 100; // Speed i shout chart into combat at.
mood2 = AGRESSIVE_END; // Ready to fire sir!
findTypes2 = FT_DEFAULT; // Target everything.
speed2 = 200; // Speed used when following paths. 0 to 999 kph (999 = best).
targetme = 0; // Should the bots single out the player ? -1 Ignore him, 0 = normal, 1 oh yes baby, kill him first.

///////////////////////////////////////////////////////////////////////
// Developer Settings. Do not touch these or you will break the mission.
//////////////////////////////////////////////////////////////////////

alarmreset = 10; // seconds before the turret control alarm can go off again.

// Turret Alignments: possible options = FA_FRIENDLY, FA_ENEMY, FA_NEUTRAL, FA_ANY
// Alignment settings used for mission testing only.
turrentalignment = FA_ENEMY;
mechalignment = FA_ENEMY;
mechalignmentjade = FA_FRIENDLY;

// timers Settings.
// Alarmreset settings can be tweaked.
timer1 = gti_timer_5; // Sector 1 turret control.
timer2 = gti_timer_6; // Sector 2 turret control.
timer3 = gti_timer_7; // HQ.
CamTimer = gti_timer_8; // movie timer
gametimer = gti_timer_9; // Gametimer
jadetimer2 = gti_timer_10; // jade second wave timer.

As you can see, using this script I can set the turrets alignment to neutral to allow me to test other parts of the mission easily.

If you add your Vars to a abi script in this way you do not need to declare them in your actual mission script or set them up in your functions ini section. You can just use them right away in your states.

When ever Timer1 is called it always looks it up in the abi file and comes back with this line timer1 = gti_timer_5; // Sector 1 turret control.

So you effectively reduce a long line declaring and setting a var to just one word in your script. If you combine a previously setup var with some IF commands then you can change the whole nature of mission by simply editing the abi file AFTER releasing your map. No need to recompile it and release a new version.

The possibilities here for dynamic mission creation are so big most good scripters will see right away just how useful Ashs idea is.