Initial full mirror of c:\VWE (source + assets + toolchain + outputs) via Git LFS

Complete disaster-recovery snapshot: engine/game source, game data assets,
VC6 toolchain + DX SDKs, build outputs, deployed game, and _UNUSED archive.
Large binaries in Git LFS; text preserved byte-for-byte (core.autocrlf=false,
no eol attributes). See RECOVERY.md for the one-clone rebuild procedure.
This commit is contained in:
Cyd
2026-06-24 21:28:16 -05:00
commit 2b8ca921cb
66341 changed files with 7923174 additions and 0 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,382 @@
fsm WussyBot : integer;
const
#include_ <content\ABLScripts\mwconst.abi>
type
#include_ <content\ABLScripts\mwtype.abi>
var
static integer attackRange; // At what range do I start shooting?
static integer withdrawRange; // At what range do I withdraw?
static ObjectID mymech;
static integer mytactic;
static integer pilotskill;
static integer gunneryskill;
static integer commandskill;
static integer hits;
static ObjectID shooter;
static integer bot_activated_timer;
static integer death;
static integer deathbucket;
static integer kills;
static integer killsbucket;
static integer adjust;
function Init;
code
// Editable Settings.
//
// 10 can't hit the barn
// 100 deadly shot
// 999 never miss
pilotskill = 0;
gunneryskill = 0; // 70 is Average
commandskill = 0;
// End of Editable Settings
// script-specific variables
hits = 0;
adjust = 0;
attackRange = 9999;
withdrawRange = 9999;
// driver settings
SetFiringDelay (ME,0.0,0.0);
SetIgnoreFriendlyFire (ME,true);
SetIsShotRadius (ME,200);
SetEntropyMood (ME,AGRESSIVE_END);
SetCurMood (ME,AGRESSIVE_END);
SetSkillLevel (ME,pilotskill,gunneryskill,commandskill);
SetAttackThrottle (ME,100);
SetMinSpeed (ME,100);
EnablePerWeaponRayCasting (ME,TRUE);
bot_activated_timer = gti_Timer_1;
endfunction;
function getmechsettactic;
var
integer i;
code
mymech = GetMechType(me);
mytactic = TACTIC_PICK_BEST;
switch (mymech)
Case FirstMechID:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_ArcticWolf:
mytactic = TACTIC_HIT_AND_RUN;
Endcase;
Case M_Ares:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Argus:
mytactic = TACTIC_FAST_CIRCLE;
Endcase;
Case M_Atlas:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Awesome:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_BlackKnight:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_BlackLanner:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Brigand:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Bushwacker:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Catapult:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_CauldronBorn:
mytactic = TACTIC_CIRCLE_OF_DEATH;
Endcase;
Case M_Chimera:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Commando:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Cougar:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Cyclops:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Daishi:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_Deimos:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Dragon:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_Flea:
mytactic = TACTIC_HIT_AND_RUN;
Endcase;
Case M_Fafnir:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_Gladiator:
mytactic = TACTIC_CIRCLE_OF_DEATH;
Endcase;
Case M_Grizzly:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Hauptmann :
mytactic = TACTIC_CIRCLE_OF_DEATH;
Endcase;
Case M_Hellhound:
mytactic = TACTIC_HIT_AND_RUN;
Endcase;
Case M_Hellspawn:
mytactic = TACTIC_HIT_AND_RUN;
Endcase;
Case M_Highlander:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_HollanderII:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_Hunchback:
mytactic = TACTIC_CIRCLE_OF_DEATH;
Endcase;
Case M_Kodiak:
mytactic = TACTIC_CIRCLE_OF_DEATH;
Endcase;
Case M_Loki:
mytactic = TACTIC_CIRCLE_OF_DEATH;
Endcase;
Case M_Longbow:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_Madcat:
mytactic = TACTIC_CIRCLE_OF_DEATH;
Endcase;
Case M_Madcat_MKII:
mytactic = TACTIC_JUMP_AND_SHOOT;
Endcase;
Case M_Masakari:
mytactic = TACTIC_CIRCLE_OF_DEATH;
Endcase;
Case M_Mauler:
mytactic = TACTIC_CIRCLE_OF_DEATH;
Endcase;
Case M_Novacat:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_Osiris:
mytactic = TACTIC_HIT_AND_RUN;
Endcase;
Case M_Owens :
mytactic = TACTIC_HIT_AND_RUN;
Endcase;
Case M_Puma:
mytactic = TACTIC_JUMP_AND_SHOOT;
Endcase;
Case M_Raven:
mytactic = TACTIC_HIT_AND_RUN;
Endcase;
Case M_Ryoken:
mytactic = TACTIC_HIT_AND_RUN;
Endcase;
Case M_Shadowcat:
mytactic = TACTIC_JUMP_AND_SHOOT;
Endcase;
Case M_Solitaire:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Sunder:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_Templar:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_Thanatos:
mytactic = TACTIC_JUMP_AND_SHOOT;
Endcase;
Case M_Thor:
mytactic = TACTIC_JUMP_AND_SHOOT;
Endcase;
Case M_Uller:
mytactic = TACTIC_HIT_AND_RUN;
Endcase;
Case M_Uziel:
mytactic = TACTIC_JUMP_AND_SHOOT;
Endcase;
Case M_Victor:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_Vulture:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_Wolfhound:
mytactic = TACTIC_CIRCLE_OF_DEATH;
Endcase;
Case M_Zeus:
mytactic = TACTIC_SNIPE;
Endcase;
Case NoMechID:
mytactic = TACTIC_PICK_BEST;
Endcase;
Endswitch;
endfunction;
state StartState;
code
StartTimer(bot_activated_timer);
trans CheckTimer;
endstate;
state CheckTimer;
code
//---------------------------------------------
// Time before Bot Wakes up and starts Shooting
//---------------------------------------------
if (TimeGreater(bot_activated_timer,5.0)) then
getmechsettactic;
trans WaitToAmbushState;
endif;
//---------------------------------------------
// Firing upon/near before timer up lets the bot go play
//---------------------------------------------
if (IsShot(ME) == TRUE) then
SetTarget(ME,WhoShot(ME));
getmechsettactic;
trans WaitToAmbushState;
endif;
trans CheckTimer;
endstate;
state WaitToAmbushState;
code
if (Bot_FindEnemy(attackrange)) then
trans AttackState;
endif;
if ((isshot(me)) == true) then
hits = hits + 1;
if (hits > 100) then
hits = 100;
endif;
shooter = Whoshot(me);
SetTarget (me,shooter);
SetTargetDesirability(shooter, hits);
endif;
OrderMoveLookOut;
endstate;
state AttackState;
code
if (LeaveAttackState(withdrawRange)) then
trans WaitToAmbushState;
endif;
if ((isshot(me)) == true) then
hits = hits + 1;
if (hits > 100) then
hits = 100;
endif;
shooter = Whoshot(me);
SetTarget (me,shooter);
SetTargetDesirability(shooter, hits);
endif;
OrderAttackTactic(TACTIC_STARE,TRUE);
endstate;
state DeadState;
code
shooter = WhoDestroyed(me);
SetTargetDesirability(shooter, 20);
orderDie;
endstate;
endfsm.
@@ -0,0 +1,403 @@
fsm DodgeBot : integer;
const
#include_ <content\ABLScripts\mwconst.abi>
type
#include_ <content\ABLScripts\mwtype.abi>
var
static integer attackRange; // At what range do I start shooting?
static integer withdrawRange; // At what range do I withdraw?
static ObjectID mymech;
static integer mytactic;
static integer pilotskill;
static integer gunneryskill;
static integer commandskill;
static integer hits;
static ObjectID shooter;
static integer bot_activated_timer;
static integer death;
static integer deathbucket;
static integer kills;
static integer killsbucket;
static integer adjust;
function Init;
code
// Editable Settings.
//
// 10 can't hit the barn
// 100 deadly shot
// 999 never miss
pilotskill = 75;
gunneryskill = 110; // 70 is Average
commandskill = 60;
// End of Editable Settings
// script-specific variables
hits = 0;
adjust = 0;
attackRange = 9999;
withdrawRange = 9999;
// driver settings
SetFiringDelay (ME,0.0,0.0);
SetIgnoreFriendlyFire (ME,true);
SetIsShotRadius (ME,200);
SetEntropyMood (ME,AGRESSIVE_END);
SetCurMood (ME,AGRESSIVE_END);
SetSkillLevel (ME,pilotskill,gunneryskill,commandskill);
SetAttackThrottle (ME,100);
SetMinSpeed (ME,100);
EnablePerWeaponRayCasting (ME,TRUE);
bot_activated_timer = gti_Timer_1;
endfunction;
function getmechsettactic;
var
integer i;
code
mymech = GetMechType(me);
mytactic = TACTIC_PICK_BEST;
switch (mymech)
Case FirstMechID:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_ArcticWolf:
mytactic = TACTIC_HIT_AND_RUN;
Endcase;
Case M_Ares:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Argus:
mytactic = TACTIC_FAST_CIRCLE;
Endcase;
Case M_Atlas:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Awesome:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_BlackKnight:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_BlackLanner:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Brigand:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Bushwacker:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Catapult:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_CauldronBorn:
mytactic = TACTIC_CIRCLE_OF_DEATH;
Endcase;
Case M_Chimera:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Commando:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Cougar:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Cyclops:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Daishi:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_Deimos:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Dragon:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_Flea:
mytactic = TACTIC_HIT_AND_RUN;
Endcase;
Case M_Fafnir:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_Gladiator:
mytactic = TACTIC_CIRCLE_OF_DEATH;
Endcase;
Case M_Grizzly:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Hauptmann :
mytactic = TACTIC_CIRCLE_OF_DEATH;
Endcase;
Case M_Hellhound:
mytactic = TACTIC_HIT_AND_RUN;
Endcase;
Case M_Hellspawn:
mytactic = TACTIC_HIT_AND_RUN;
Endcase;
Case M_Highlander:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_HollanderII:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_Hunchback:
mytactic = TACTIC_CIRCLE_OF_DEATH;
Endcase;
Case M_Kodiak:
mytactic = TACTIC_CIRCLE_OF_DEATH;
Endcase;
Case M_Loki:
mytactic = TACTIC_CIRCLE_OF_DEATH;
Endcase;
Case M_Longbow:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_Madcat:
mytactic = TACTIC_CIRCLE_OF_DEATH;
Endcase;
Case M_Madcat_MKII:
mytactic = TACTIC_JUMP_AND_SHOOT;
Endcase;
Case M_Masakari:
mytactic = TACTIC_CIRCLE_OF_DEATH;
Endcase;
Case M_Mauler:
mytactic = TACTIC_CIRCLE_OF_DEATH;
Endcase;
Case M_Novacat:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_Osiris:
mytactic = TACTIC_HIT_AND_RUN;
Endcase;
Case M_Owens :
mytactic = TACTIC_HIT_AND_RUN;
Endcase;
Case M_Puma:
mytactic = TACTIC_JUMP_AND_SHOOT;
Endcase;
Case M_Raven:
mytactic = TACTIC_HIT_AND_RUN;
Endcase;
Case M_Ryoken:
mytactic = TACTIC_HIT_AND_RUN;
Endcase;
Case M_Shadowcat:
mytactic = TACTIC_JUMP_AND_SHOOT;
Endcase;
Case M_Solitaire:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Sunder:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_Templar:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_Thanatos:
mytactic = TACTIC_JUMP_AND_SHOOT;
Endcase;
Case M_Thor:
mytactic = TACTIC_JUMP_AND_SHOOT;
Endcase;
Case M_Uller:
mytactic = TACTIC_HIT_AND_RUN;
Endcase;
Case M_Uziel:
mytactic = TACTIC_JUMP_AND_SHOOT;
Endcase;
Case M_Victor:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_Vulture:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_Wolfhound:
mytactic = TACTIC_CIRCLE_OF_DEATH;
Endcase;
Case M_Zeus:
mytactic = TACTIC_SNIPE;
Endcase;
Case NoMechID:
mytactic = TACTIC_PICK_BEST;
Endcase;
Endswitch;
endfunction;
state StartState;
code
deathbucket = Bucket_DEATHS;
death = FindBucketValue(deathbucket,me);
killsbucket = Bucket_KILLS;
kills = FindBucketValue(killsbucket,me);
adjust = (death - kills);
if (adjust > 10) then
adjust = adjust * 100;
else
adjust = adjust * 10;
endif;
if (adjust < 0) then
adjust = 0;
endif;
pilotskill = pilotskill + adjust;
gunneryskill = gunneryskill + adjust;
commandskill = commandskill + adjust;
SetSkillLevel(ME,pilotskill,gunneryskill,commandskill);
StartTimer(bot_activated_timer);
trans CheckTimer;
endstate;
state CheckTimer;
code
//---------------------------------------------
// Time before Bot Wakes up and starts Shooting
//---------------------------------------------
if (TimeGreater(bot_activated_timer,5.0)) then
getmechsettactic;
trans WaitToAmbushState;
endif;
//---------------------------------------------
// Firing upon/near before timer up lets the bot go play
//---------------------------------------------
if (IsShot(ME) == TRUE) then
SetTarget(ME,WhoShot(ME));
getmechsettactic;
trans WaitToAmbushState;
endif;
trans CheckTimer;
endstate;
state WaitToAmbushState;
code
if (Bot_FindEnemy(attackrange)) then
trans AttackState;
endif;
if ((isshot(me)) == true) then
hits = hits + 1;
if (hits > 100) then
hits = 100;
endif;
shooter = Whoshot(me);
SetTarget (me,shooter);
SetTargetDesirability(shooter, hits);
endif;
OrderMoveLookOut;
endstate;
state AttackState;
code
if (LeaveAttackState(withdrawRange)) then
trans WaitToAmbushState;
endif;
if ((isshot(me)) == true) then
hits = hits + 1;
if (hits > 100) then
hits = 100;
endif;
shooter = Whoshot(me);
SetTarget (me,shooter);
SetTargetDesirability(shooter, hits);
endif;
OrderAttackTactic(mytactic,TRUE);
endstate;
state DeadState;
code
shooter = WhoDestroyed(me);
SetTargetDesirability(shooter, 20);
orderDie;
endstate;
endfsm.
@@ -0,0 +1,382 @@
fsm EasyBot : integer;
const
#include_ <content\ABLScripts\mwconst.abi>
type
#include_ <content\ABLScripts\mwtype.abi>
var
static integer attackRange; // At what range do I start shooting?
static integer withdrawRange; // At what range do I withdraw?
static ObjectID mymech;
static integer mytactic;
static integer pilotskill;
static integer gunneryskill;
static integer commandskill;
static integer hits;
static ObjectID shooter;
static integer bot_activated_timer;
static integer death;
static integer deathbucket;
static integer kills;
static integer killsbucket;
static integer adjust;
function Init;
code
// Editable Settings.
//
// 10 can't hit the barn
// 100 deadly shot
// 999 never miss
pilotskill = 80;
gunneryskill = 10; // 70 is Average
commandskill = 30;
// End of Editable Settings
// script-specific variables
hits = 0;
adjust = 0;
attackRange = 9999;
withdrawRange = 9999;
// driver settings
SetFiringDelay (ME,0.0,0.0);
SetIgnoreFriendlyFire (ME,true);
SetIsShotRadius (ME,200);
SetEntropyMood (ME,AGRESSIVE_END);
SetCurMood (ME,AGRESSIVE_END);
SetSkillLevel (ME,pilotskill,gunneryskill,commandskill);
SetAttackThrottle (ME,100);
SetMinSpeed (ME,100);
EnablePerWeaponRayCasting (ME,TRUE);
bot_activated_timer = gti_Timer_1;
endfunction;
function getmechsettactic;
var
integer i;
code
mymech = GetMechType(me);
mytactic = TACTIC_PICK_BEST;
switch (mymech)
Case FirstMechID:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_ArcticWolf:
mytactic = TACTIC_HIT_AND_RUN;
Endcase;
Case M_Ares:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Argus:
mytactic = TACTIC_FAST_CIRCLE;
Endcase;
Case M_Atlas:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Awesome:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_BlackKnight:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_BlackLanner:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Brigand:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Bushwacker:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Catapult:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_CauldronBorn:
mytactic = TACTIC_CIRCLE_OF_DEATH;
Endcase;
Case M_Chimera:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Commando:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Cougar:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Cyclops:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Daishi:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_Deimos:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Dragon:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_Flea:
mytactic = TACTIC_HIT_AND_RUN;
Endcase;
Case M_Fafnir:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_Gladiator:
mytactic = TACTIC_CIRCLE_OF_DEATH;
Endcase;
Case M_Grizzly:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Hauptmann :
mytactic = TACTIC_CIRCLE_OF_DEATH;
Endcase;
Case M_Hellhound:
mytactic = TACTIC_HIT_AND_RUN;
Endcase;
Case M_Hellspawn:
mytactic = TACTIC_HIT_AND_RUN;
Endcase;
Case M_Highlander:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_HollanderII:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_Hunchback:
mytactic = TACTIC_CIRCLE_OF_DEATH;
Endcase;
Case M_Kodiak:
mytactic = TACTIC_CIRCLE_OF_DEATH;
Endcase;
Case M_Loki:
mytactic = TACTIC_CIRCLE_OF_DEATH;
Endcase;
Case M_Longbow:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_Madcat:
mytactic = TACTIC_CIRCLE_OF_DEATH;
Endcase;
Case M_Madcat_MKII:
mytactic = TACTIC_JUMP_AND_SHOOT;
Endcase;
Case M_Masakari:
mytactic = TACTIC_CIRCLE_OF_DEATH;
Endcase;
Case M_Mauler:
mytactic = TACTIC_CIRCLE_OF_DEATH;
Endcase;
Case M_Novacat:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_Osiris:
mytactic = TACTIC_HIT_AND_RUN;
Endcase;
Case M_Owens :
mytactic = TACTIC_HIT_AND_RUN;
Endcase;
Case M_Puma:
mytactic = TACTIC_JUMP_AND_SHOOT;
Endcase;
Case M_Raven:
mytactic = TACTIC_HIT_AND_RUN;
Endcase;
Case M_Ryoken:
mytactic = TACTIC_HIT_AND_RUN;
Endcase;
Case M_Shadowcat:
mytactic = TACTIC_JUMP_AND_SHOOT;
Endcase;
Case M_Solitaire:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Sunder:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_Templar:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_Thanatos:
mytactic = TACTIC_JUMP_AND_SHOOT;
Endcase;
Case M_Thor:
mytactic = TACTIC_JUMP_AND_SHOOT;
Endcase;
Case M_Uller:
mytactic = TACTIC_HIT_AND_RUN;
Endcase;
Case M_Uziel:
mytactic = TACTIC_JUMP_AND_SHOOT;
Endcase;
Case M_Victor:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_Vulture:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_Wolfhound:
mytactic = TACTIC_CIRCLE_OF_DEATH;
Endcase;
Case M_Zeus:
mytactic = TACTIC_SNIPE;
Endcase;
Case NoMechID:
mytactic = TACTIC_PICK_BEST;
Endcase;
Endswitch;
endfunction;
state StartState;
code
StartTimer(bot_activated_timer);
trans CheckTimer;
endstate;
state CheckTimer;
code
//---------------------------------------------
// Time before Bot Wakes up and starts Shooting
//---------------------------------------------
if (TimeGreater(bot_activated_timer,5.0)) then
getmechsettactic;
trans WaitToAmbushState;
endif;
//---------------------------------------------
// Firing upon/near before timer up lets the bot go play
//---------------------------------------------
if (IsShot(ME) == TRUE) then
SetTarget(ME,WhoShot(ME));
getmechsettactic;
trans WaitToAmbushState;
endif;
trans CheckTimer;
endstate;
state WaitToAmbushState;
code
if (Bot_FindEnemy(attackrange)) then
trans AttackState;
endif;
if ((isshot(me)) == true) then
hits = hits + 1;
if (hits > 100) then
hits = 100;
endif;
shooter = Whoshot(me);
SetTarget (me,shooter);
SetTargetDesirability(shooter, hits);
endif;
OrderMoveLookOut;
endstate;
state AttackState;
code
if (LeaveAttackState(withdrawRange)) then
trans WaitToAmbushState;
endif;
if ((isshot(me)) == true) then
hits = hits + 1;
if (hits > 100) then
hits = 100;
endif;
shooter = Whoshot(me);
SetTarget (me,shooter);
SetTargetDesirability(shooter, hits);
endif;
OrderAttackTactic(TACTIC_STARE,TRUE);
endstate;
state DeadState;
code
shooter = WhoDestroyed(me);
SetTargetDesirability(shooter, 20);
orderDie;
endstate;
endfsm.
@@ -0,0 +1,403 @@
fsm KillerBot : integer;
const
#include_ <content\ABLScripts\mwconst.abi>
type
#include_ <content\ABLScripts\mwtype.abi>
var
static integer attackRange; // At what range do I start shooting?
static integer withdrawRange; // At what range do I withdraw?
static ObjectID mymech;
static integer mytactic;
static integer pilotskill;
static integer gunneryskill;
static integer commandskill;
static integer hits;
static ObjectID shooter;
static integer bot_activated_timer;
static integer death;
static integer deathbucket;
static integer kills;
static integer killsbucket;
static integer adjust;
function Init;
code
// Editable Settings.
//
// 10 can't hit the barn
// 100 deadly shot
// 999 never miss
pilotskill = 100;
gunneryskill = 110; // 70 is Average
commandskill = 100;
// End of Editable Settings
// script-specific variables
hits = 0;
adjust = 0;
attackRange = 9999;
withdrawRange = 9999;
// driver settings
SetFiringDelay (ME,0.0,0.0);
SetIgnoreFriendlyFire (ME,true);
SetIsShotRadius (ME,200);
SetEntropyMood (ME,AGRESSIVE_END);
SetCurMood (ME,AGRESSIVE_END);
SetSkillLevel (ME,pilotskill,gunneryskill,commandskill);
SetAttackThrottle (ME,100);
SetMinSpeed (ME,100);
EnablePerWeaponRayCasting (ME,TRUE);
bot_activated_timer = gti_Timer_1;
endfunction;
function getmechsettactic;
var
integer i;
code
mymech = GetMechType(me);
mytactic = TACTIC_PICK_BEST;
switch (mymech)
Case FirstMechID:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_ArcticWolf:
mytactic = TACTIC_HIT_AND_RUN;
Endcase;
Case M_Ares:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Argus:
mytactic = TACTIC_FAST_CIRCLE;
Endcase;
Case M_Atlas:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Awesome:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_BlackKnight:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_BlackLanner:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Brigand:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Bushwacker:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Catapult:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_CauldronBorn:
mytactic = TACTIC_CIRCLE_OF_DEATH;
Endcase;
Case M_Chimera:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Commando:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Cougar:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Cyclops:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Daishi:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_Deimos:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Dragon:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_Flea:
mytactic = TACTIC_HIT_AND_RUN;
Endcase;
Case M_Fafnir:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_Gladiator:
mytactic = TACTIC_CIRCLE_OF_DEATH;
Endcase;
Case M_Grizzly:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Hauptmann :
mytactic = TACTIC_CIRCLE_OF_DEATH;
Endcase;
Case M_Hellhound:
mytactic = TACTIC_HIT_AND_RUN;
Endcase;
Case M_Hellspawn:
mytactic = TACTIC_HIT_AND_RUN;
Endcase;
Case M_Highlander:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_HollanderII:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_Hunchback:
mytactic = TACTIC_CIRCLE_OF_DEATH;
Endcase;
Case M_Kodiak:
mytactic = TACTIC_CIRCLE_OF_DEATH;
Endcase;
Case M_Loki:
mytactic = TACTIC_CIRCLE_OF_DEATH;
Endcase;
Case M_Longbow:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_Madcat:
mytactic = TACTIC_CIRCLE_OF_DEATH;
Endcase;
Case M_Madcat_MKII:
mytactic = TACTIC_JUMP_AND_SHOOT;
Endcase;
Case M_Masakari:
mytactic = TACTIC_CIRCLE_OF_DEATH;
Endcase;
Case M_Mauler:
mytactic = TACTIC_CIRCLE_OF_DEATH;
Endcase;
Case M_Novacat:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_Osiris:
mytactic = TACTIC_HIT_AND_RUN;
Endcase;
Case M_Owens :
mytactic = TACTIC_HIT_AND_RUN;
Endcase;
Case M_Puma:
mytactic = TACTIC_JUMP_AND_SHOOT;
Endcase;
Case M_Raven:
mytactic = TACTIC_HIT_AND_RUN;
Endcase;
Case M_Ryoken:
mytactic = TACTIC_HIT_AND_RUN;
Endcase;
Case M_Shadowcat:
mytactic = TACTIC_JUMP_AND_SHOOT;
Endcase;
Case M_Solitaire:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Sunder:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_Templar:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_Thanatos:
mytactic = TACTIC_JUMP_AND_SHOOT;
Endcase;
Case M_Thor:
mytactic = TACTIC_JUMP_AND_SHOOT;
Endcase;
Case M_Uller:
mytactic = TACTIC_HIT_AND_RUN;
Endcase;
Case M_Uziel:
mytactic = TACTIC_JUMP_AND_SHOOT;
Endcase;
Case M_Victor:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_Vulture:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_Wolfhound:
mytactic = TACTIC_CIRCLE_OF_DEATH;
Endcase;
Case M_Zeus:
mytactic = TACTIC_SNIPE;
Endcase;
Case NoMechID:
mytactic = TACTIC_PICK_BEST;
Endcase;
Endswitch;
endfunction;
state StartState;
code
deathbucket = Bucket_DEATHS;
death = FindBucketValue(deathbucket,me);
killsbucket = Bucket_KILLS;
kills = FindBucketValue(killsbucket,me);
adjust = (death - kills);
if (adjust > 10) then
adjust = adjust * 100;
else
adjust = adjust * 10;
endif;
if (adjust < 0) then
adjust = 0;
endif;
pilotskill = pilotskill + adjust;
gunneryskill = gunneryskill + adjust;
commandskill = commandskill + adjust;
SetSkillLevel(ME,pilotskill,gunneryskill,commandskill);
StartTimer(bot_activated_timer);
trans CheckTimer;
endstate;
state CheckTimer;
code
//---------------------------------------------
// Time before Bot Wakes up and starts Shooting
//---------------------------------------------
if (TimeGreater(bot_activated_timer,5.0)) then
getmechsettactic;
trans WaitToAmbushState;
endif;
//---------------------------------------------
// Firing upon/near before timer up lets the bot go play
//---------------------------------------------
if (IsShot(ME) == TRUE) then
SetTarget(ME,WhoShot(ME));
getmechsettactic;
trans WaitToAmbushState;
endif;
trans CheckTimer;
endstate;
state WaitToAmbushState;
code
if (Bot_FindEnemy(attackrange)) then
trans AttackState;
endif;
if ((isshot(me)) == true) then
hits = hits + 1;
if (hits > 100) then
hits = 100;
endif;
shooter = Whoshot(me);
SetTarget (me,shooter);
SetTargetDesirability(shooter, hits);
endif;
OrderMoveLookOut;
endstate;
state AttackState;
code
if (LeaveAttackState(withdrawRange)) then
trans WaitToAmbushState;
endif;
if ((isshot(me)) == true) then
hits = hits + 1;
if (hits > 100) then
hits = 100;
endif;
shooter = Whoshot(me);
SetTarget (me,shooter);
SetTargetDesirability(shooter, hits);
endif;
OrderAttackTactic(mytactic,TRUE);
endstate;
state DeadState;
code
shooter = WhoDestroyed(me);
SetTargetDesirability(shooter, 20);
orderDie;
endstate;
endfsm.
@@ -0,0 +1,382 @@
fsm RookieBot : integer;
const
#include_ <content\ABLScripts\mwconst.abi>
type
#include_ <content\ABLScripts\mwtype.abi>
var
static integer attackRange; // At what range do I start shooting?
static integer withdrawRange; // At what range do I withdraw?
static ObjectID mymech;
static integer mytactic;
static integer pilotskill;
static integer gunneryskill;
static integer commandskill;
static integer hits;
static ObjectID shooter;
static integer bot_activated_timer;
static integer death;
static integer deathbucket;
static integer kills;
static integer killsbucket;
static integer adjust;
function Init;
code
// Editable Settings.
//
// 10 can't hit the barn
// 100 deadly shot
// 999 never miss
pilotskill = 90;
gunneryskill = 50; // 70 is Average
commandskill = 60;
// End of Editable Settings
// script-specific variables
hits = 0;
adjust = 0;
attackRange = 9999;
withdrawRange = 9999;
// driver settings
SetFiringDelay (ME,0.0,0.0);
SetIgnoreFriendlyFire (ME,true);
SetIsShotRadius (ME,200);
SetEntropyMood (ME,AGRESSIVE_END);
SetCurMood (ME,AGRESSIVE_END);
SetSkillLevel (ME,pilotskill,gunneryskill,commandskill);
SetAttackThrottle (ME,100);
SetMinSpeed (ME,100);
EnablePerWeaponRayCasting (ME,TRUE);
bot_activated_timer = gti_Timer_1;
endfunction;
function getmechsettactic;
var
integer i;
code
mymech = GetMechType(me);
mytactic = TACTIC_PICK_BEST;
switch (mymech)
Case FirstMechID:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_ArcticWolf:
mytactic = TACTIC_HIT_AND_RUN;
Endcase;
Case M_Ares:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Argus:
mytactic = TACTIC_FAST_CIRCLE;
Endcase;
Case M_Atlas:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Awesome:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_BlackKnight:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_BlackLanner:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Brigand:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Bushwacker:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Catapult:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_CauldronBorn:
mytactic = TACTIC_CIRCLE_OF_DEATH;
Endcase;
Case M_Chimera:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Commando:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Cougar:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Cyclops:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Daishi:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_Deimos:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Dragon:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_Flea:
mytactic = TACTIC_HIT_AND_RUN;
Endcase;
Case M_Fafnir:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_Gladiator:
mytactic = TACTIC_CIRCLE_OF_DEATH;
Endcase;
Case M_Grizzly:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Hauptmann :
mytactic = TACTIC_CIRCLE_OF_DEATH;
Endcase;
Case M_Hellhound:
mytactic = TACTIC_HIT_AND_RUN;
Endcase;
Case M_Hellspawn:
mytactic = TACTIC_HIT_AND_RUN;
Endcase;
Case M_Highlander:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_HollanderII:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_Hunchback:
mytactic = TACTIC_CIRCLE_OF_DEATH;
Endcase;
Case M_Kodiak:
mytactic = TACTIC_CIRCLE_OF_DEATH;
Endcase;
Case M_Loki:
mytactic = TACTIC_CIRCLE_OF_DEATH;
Endcase;
Case M_Longbow:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_Madcat:
mytactic = TACTIC_CIRCLE_OF_DEATH;
Endcase;
Case M_Madcat_MKII:
mytactic = TACTIC_JUMP_AND_SHOOT;
Endcase;
Case M_Masakari:
mytactic = TACTIC_CIRCLE_OF_DEATH;
Endcase;
Case M_Mauler:
mytactic = TACTIC_CIRCLE_OF_DEATH;
Endcase;
Case M_Novacat:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_Osiris:
mytactic = TACTIC_HIT_AND_RUN;
Endcase;
Case M_Owens :
mytactic = TACTIC_HIT_AND_RUN;
Endcase;
Case M_Puma:
mytactic = TACTIC_JUMP_AND_SHOOT;
Endcase;
Case M_Raven:
mytactic = TACTIC_HIT_AND_RUN;
Endcase;
Case M_Ryoken:
mytactic = TACTIC_HIT_AND_RUN;
Endcase;
Case M_Shadowcat:
mytactic = TACTIC_JUMP_AND_SHOOT;
Endcase;
Case M_Solitaire:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Sunder:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_Templar:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_Thanatos:
mytactic = TACTIC_JUMP_AND_SHOOT;
Endcase;
Case M_Thor:
mytactic = TACTIC_JUMP_AND_SHOOT;
Endcase;
Case M_Uller:
mytactic = TACTIC_HIT_AND_RUN;
Endcase;
Case M_Uziel:
mytactic = TACTIC_JUMP_AND_SHOOT;
Endcase;
Case M_Victor:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_Vulture:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_Wolfhound:
mytactic = TACTIC_CIRCLE_OF_DEATH;
Endcase;
Case M_Zeus:
mytactic = TACTIC_SNIPE;
Endcase;
Case NoMechID:
mytactic = TACTIC_PICK_BEST;
Endcase;
Endswitch;
endfunction;
state StartState;
code
StartTimer(bot_activated_timer);
trans CheckTimer;
endstate;
state CheckTimer;
code
//---------------------------------------------
// Time before Bot Wakes up and starts Shooting
//---------------------------------------------
if (TimeGreater(bot_activated_timer,5.0)) then
getmechsettactic;
trans WaitToAmbushState;
endif;
//---------------------------------------------
// Firing upon/near before timer up lets the bot go play
//---------------------------------------------
if (IsShot(ME) == TRUE) then
SetTarget(ME,WhoShot(ME));
getmechsettactic;
trans WaitToAmbushState;
endif;
trans CheckTimer;
endstate;
state WaitToAmbushState;
code
if (Bot_FindEnemy(attackrange)) then
trans AttackState;
endif;
if ((isshot(me)) == true) then
hits = hits + 1;
if (hits > 100) then
hits = 100;
endif;
shooter = Whoshot(me);
SetTarget (me,shooter);
SetTargetDesirability(shooter, hits);
endif;
OrderMoveLookOut;
endstate;
state AttackState;
code
if (LeaveAttackState(withdrawRange)) then
trans WaitToAmbushState;
endif;
if ((isshot(me)) == true) then
hits = hits + 1;
if (hits > 100) then
hits = 100;
endif;
shooter = Whoshot(me);
SetTarget (me,shooter);
SetTargetDesirability(shooter, hits);
endif;
OrderAttackTactic(mytactic,TRUE);
endstate;
state DeadState;
code
shooter = WhoDestroyed(me);
SetTargetDesirability(shooter, 20);
orderDie;
endstate;
endfsm.
@@ -0,0 +1,382 @@
fsm RookieDodgeBot : integer;
const
#include_ <content\ABLScripts\mwconst.abi>
type
#include_ <content\ABLScripts\mwtype.abi>
var
static integer attackRange; // At what range do I start shooting?
static integer withdrawRange; // At what range do I withdraw?
static ObjectID mymech;
static integer mytactic;
static integer pilotskill;
static integer gunneryskill;
static integer commandskill;
static integer hits;
static ObjectID shooter;
static integer bot_activated_timer;
static integer death;
static integer deathbucket;
static integer kills;
static integer killsbucket;
static integer adjust;
function Init;
code
// Editable Settings.
//
// 10 can't hit the barn
// 100 deadly shot
// 999 never miss
pilotskill = 10;
gunneryskill = 60; // 70 is Average
commandskill = 30;
// End of Editable Settings
// script-specific variables
hits = 0;
adjust = 0;
attackRange = 9999;
withdrawRange = 9999;
// driver settings
SetFiringDelay (ME,0.0,0.0);
SetIgnoreFriendlyFire (ME,true);
SetIsShotRadius (ME,200);
SetEntropyMood (ME,AGRESSIVE_END);
SetCurMood (ME,AGRESSIVE_END);
SetSkillLevel (ME,pilotskill,gunneryskill,commandskill);
SetAttackThrottle (ME,100);
SetMinSpeed (ME,100);
EnablePerWeaponRayCasting (ME,TRUE);
bot_activated_timer = gti_Timer_1;
endfunction;
function getmechsettactic;
var
integer i;
code
mymech = GetMechType(me);
mytactic = TACTIC_PICK_BEST;
switch (mymech)
Case FirstMechID:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_ArcticWolf:
mytactic = TACTIC_HIT_AND_RUN;
Endcase;
Case M_Ares:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Argus:
mytactic = TACTIC_FAST_CIRCLE;
Endcase;
Case M_Atlas:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Awesome:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_BlackKnight:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_BlackLanner:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Brigand:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Bushwacker:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Catapult:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_CauldronBorn:
mytactic = TACTIC_CIRCLE_OF_DEATH;
Endcase;
Case M_Chimera:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Commando:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Cougar:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Cyclops:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Daishi:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_Deimos:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Dragon:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_Flea:
mytactic = TACTIC_HIT_AND_RUN;
Endcase;
Case M_Fafnir:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_Gladiator:
mytactic = TACTIC_CIRCLE_OF_DEATH;
Endcase;
Case M_Grizzly:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Hauptmann :
mytactic = TACTIC_CIRCLE_OF_DEATH;
Endcase;
Case M_Hellhound:
mytactic = TACTIC_HIT_AND_RUN;
Endcase;
Case M_Hellspawn:
mytactic = TACTIC_HIT_AND_RUN;
Endcase;
Case M_Highlander:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_HollanderII:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_Hunchback:
mytactic = TACTIC_CIRCLE_OF_DEATH;
Endcase;
Case M_Kodiak:
mytactic = TACTIC_CIRCLE_OF_DEATH;
Endcase;
Case M_Loki:
mytactic = TACTIC_CIRCLE_OF_DEATH;
Endcase;
Case M_Longbow:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_Madcat:
mytactic = TACTIC_CIRCLE_OF_DEATH;
Endcase;
Case M_Madcat_MKII:
mytactic = TACTIC_JUMP_AND_SHOOT;
Endcase;
Case M_Masakari:
mytactic = TACTIC_CIRCLE_OF_DEATH;
Endcase;
Case M_Mauler:
mytactic = TACTIC_CIRCLE_OF_DEATH;
Endcase;
Case M_Novacat:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_Osiris:
mytactic = TACTIC_HIT_AND_RUN;
Endcase;
Case M_Owens :
mytactic = TACTIC_HIT_AND_RUN;
Endcase;
Case M_Puma:
mytactic = TACTIC_JUMP_AND_SHOOT;
Endcase;
Case M_Raven:
mytactic = TACTIC_HIT_AND_RUN;
Endcase;
Case M_Ryoken:
mytactic = TACTIC_HIT_AND_RUN;
Endcase;
Case M_Shadowcat:
mytactic = TACTIC_JUMP_AND_SHOOT;
Endcase;
Case M_Solitaire:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Sunder:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_Templar:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_Thanatos:
mytactic = TACTIC_JUMP_AND_SHOOT;
Endcase;
Case M_Thor:
mytactic = TACTIC_JUMP_AND_SHOOT;
Endcase;
Case M_Uller:
mytactic = TACTIC_HIT_AND_RUN;
Endcase;
Case M_Uziel:
mytactic = TACTIC_JUMP_AND_SHOOT;
Endcase;
Case M_Victor:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_Vulture:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_Wolfhound:
mytactic = TACTIC_CIRCLE_OF_DEATH;
Endcase;
Case M_Zeus:
mytactic = TACTIC_SNIPE;
Endcase;
Case NoMechID:
mytactic = TACTIC_PICK_BEST;
Endcase;
Endswitch;
endfunction;
state StartState;
code
StartTimer(bot_activated_timer);
trans CheckTimer;
endstate;
state CheckTimer;
code
//---------------------------------------------
// Time before Bot Wakes up and starts Shooting
//---------------------------------------------
if (TimeGreater(bot_activated_timer,5.0)) then
getmechsettactic;
trans WaitToAmbushState;
endif;
//---------------------------------------------
// Firing upon/near before timer up lets the bot go play
//---------------------------------------------
if (IsShot(ME) == TRUE) then
SetTarget(ME,WhoShot(ME));
getmechsettactic;
trans WaitToAmbushState;
endif;
trans CheckTimer;
endstate;
state WaitToAmbushState;
code
if (Bot_FindEnemy(attackrange)) then
trans AttackState;
endif;
if ((isshot(me)) == true) then
hits = hits + 1;
if (hits > 100) then
hits = 100;
endif;
shooter = Whoshot(me);
SetTarget (me,shooter);
SetTargetDesirability(shooter, hits);
endif;
OrderMoveLookOut;
endstate;
state AttackState;
code
if (LeaveAttackState(withdrawRange)) then
trans WaitToAmbushState;
endif;
if ((isshot(me)) == true) then
hits = hits + 1;
if (hits > 100) then
hits = 100;
endif;
shooter = Whoshot(me);
SetTarget (me,shooter);
SetTargetDesirability(shooter, hits);
endif;
OrderAttackTactic(mytactic,TRUE);
endstate;
state DeadState;
code
shooter = WhoDestroyed(me);
SetTargetDesirability(shooter, 20);
orderDie;
endstate;
endfsm.
@@ -0,0 +1,382 @@
fsm RookieSniperBot : integer;
const
#include_ <content\ABLScripts\mwconst.abi>
type
#include_ <content\ABLScripts\mwtype.abi>
var
static integer attackRange; // At what range do I start shooting?
static integer withdrawRange; // At what range do I withdraw?
static ObjectID mymech;
static integer mytactic;
static integer pilotskill;
static integer gunneryskill;
static integer commandskill;
static integer hits;
static ObjectID shooter;
static integer bot_activated_timer;
static integer death;
static integer deathbucket;
static integer kills;
static integer killsbucket;
static integer adjust;
function Init;
code
// Editable Settings.
//
// 10 can't hit the barn
// 100 deadly shot
// 999 never miss
pilotskill = 30;
gunneryskill = 35; // 70 is Average
commandskill = 30;
// End of Editable Settings
// script-specific variables
hits = 0;
adjust = 0;
attackRange = 9999;
withdrawRange = 9999;
// driver settings
SetFiringDelay (ME,0.0,0.0);
SetIgnoreFriendlyFire (ME,true);
SetIsShotRadius (ME,200);
SetEntropyMood (ME,AGRESSIVE_END);
SetCurMood (ME,AGRESSIVE_END);
SetSkillLevel (ME,pilotskill,gunneryskill,commandskill);
SetAttackThrottle (ME,100);
SetMinSpeed (ME,100);
EnablePerWeaponRayCasting (ME,TRUE);
bot_activated_timer = gti_Timer_1;
endfunction;
function getmechsettactic;
var
integer i;
code
mymech = GetMechType(me);
mytactic = TACTIC_PICK_BEST;
switch (mymech)
Case FirstMechID:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_ArcticWolf:
mytactic = TACTIC_HIT_AND_RUN;
Endcase;
Case M_Ares:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Argus:
mytactic = TACTIC_FAST_CIRCLE;
Endcase;
Case M_Atlas:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Awesome:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_BlackKnight:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_BlackLanner:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Brigand:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Bushwacker:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Catapult:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_CauldronBorn:
mytactic = TACTIC_CIRCLE_OF_DEATH;
Endcase;
Case M_Chimera:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Commando:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Cougar:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Cyclops:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Daishi:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_Deimos:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Dragon:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_Flea:
mytactic = TACTIC_HIT_AND_RUN;
Endcase;
Case M_Fafnir:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_Gladiator:
mytactic = TACTIC_CIRCLE_OF_DEATH;
Endcase;
Case M_Grizzly:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Hauptmann :
mytactic = TACTIC_CIRCLE_OF_DEATH;
Endcase;
Case M_Hellhound:
mytactic = TACTIC_HIT_AND_RUN;
Endcase;
Case M_Hellspawn:
mytactic = TACTIC_HIT_AND_RUN;
Endcase;
Case M_Highlander:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_HollanderII:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_Hunchback:
mytactic = TACTIC_CIRCLE_OF_DEATH;
Endcase;
Case M_Kodiak:
mytactic = TACTIC_CIRCLE_OF_DEATH;
Endcase;
Case M_Loki:
mytactic = TACTIC_CIRCLE_OF_DEATH;
Endcase;
Case M_Longbow:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_Madcat:
mytactic = TACTIC_CIRCLE_OF_DEATH;
Endcase;
Case M_Madcat_MKII:
mytactic = TACTIC_JUMP_AND_SHOOT;
Endcase;
Case M_Masakari:
mytactic = TACTIC_CIRCLE_OF_DEATH;
Endcase;
Case M_Mauler:
mytactic = TACTIC_CIRCLE_OF_DEATH;
Endcase;
Case M_Novacat:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_Osiris:
mytactic = TACTIC_HIT_AND_RUN;
Endcase;
Case M_Owens :
mytactic = TACTIC_HIT_AND_RUN;
Endcase;
Case M_Puma:
mytactic = TACTIC_JUMP_AND_SHOOT;
Endcase;
Case M_Raven:
mytactic = TACTIC_HIT_AND_RUN;
Endcase;
Case M_Ryoken:
mytactic = TACTIC_HIT_AND_RUN;
Endcase;
Case M_Shadowcat:
mytactic = TACTIC_JUMP_AND_SHOOT;
Endcase;
Case M_Solitaire:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Sunder:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_Templar:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_Thanatos:
mytactic = TACTIC_JUMP_AND_SHOOT;
Endcase;
Case M_Thor:
mytactic = TACTIC_JUMP_AND_SHOOT;
Endcase;
Case M_Uller:
mytactic = TACTIC_HIT_AND_RUN;
Endcase;
Case M_Uziel:
mytactic = TACTIC_JUMP_AND_SHOOT;
Endcase;
Case M_Victor:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_Vulture:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_Wolfhound:
mytactic = TACTIC_CIRCLE_OF_DEATH;
Endcase;
Case M_Zeus:
mytactic = TACTIC_SNIPE;
Endcase;
Case NoMechID:
mytactic = TACTIC_PICK_BEST;
Endcase;
Endswitch;
endfunction;
state StartState;
code
StartTimer(bot_activated_timer);
trans CheckTimer;
endstate;
state CheckTimer;
code
//---------------------------------------------
// Time before Bot Wakes up and starts Shooting
//---------------------------------------------
if (TimeGreater(bot_activated_timer,5.0)) then
getmechsettactic;
trans WaitToAmbushState;
endif;
//---------------------------------------------
// Firing upon/near before timer up lets the bot go play
//---------------------------------------------
if (IsShot(ME) == TRUE) then
SetTarget(ME,WhoShot(ME));
getmechsettactic;
trans WaitToAmbushState;
endif;
trans CheckTimer;
endstate;
state WaitToAmbushState;
code
if (Bot_FindEnemy(attackrange)) then
trans AttackState;
endif;
if ((isshot(me)) == true) then
hits = hits + 1;
if (hits > 100) then
hits = 100;
endif;
shooter = Whoshot(me);
SetTarget (me,shooter);
SetTargetDesirability(shooter, hits);
endif;
OrderMoveLookOut;
endstate;
state AttackState;
code
if (LeaveAttackState(withdrawRange)) then
trans WaitToAmbushState;
endif;
if ((isshot(me)) == true) then
hits = hits + 1;
if (hits > 100) then
hits = 100;
endif;
shooter = Whoshot(me);
SetTarget (me,shooter);
SetTargetDesirability(shooter, hits);
endif;
OrderAttackTactic(mytactic,TRUE);
endstate;
state DeadState;
code
shooter = WhoDestroyed(me);
SetTargetDesirability(shooter, 20);
orderDie;
endstate;
endfsm.
@@ -0,0 +1,403 @@
fsm SlaughterBot : integer;
const
#include_ <content\ABLScripts\mwconst.abi>
type
#include_ <content\ABLScripts\mwtype.abi>
var
static integer attackRange; // At what range do I start shooting?
static integer withdrawRange; // At what range do I withdraw?
static ObjectID mymech;
static integer mytactic;
static integer pilotskill;
static integer gunneryskill;
static integer commandskill;
static integer hits;
static ObjectID shooter;
static integer bot_activated_timer;
static integer death;
static integer deathbucket;
static integer kills;
static integer killsbucket;
static integer adjust;
function Init;
code
// Editable Settings.
//
// 10 can't hit the barn
// 100 deadly shot
// 999 never miss
pilotskill = 100;
gunneryskill = 500; // 70 is Average
commandskill = 100;
// End of Editable Settings
// script-specific variables
hits = 0;
adjust = 0;
attackRange = 9999;
withdrawRange = 9999;
// driver settings
SetFiringDelay (ME,0.0,0.0);
SetIgnoreFriendlyFire (ME,true);
SetIsShotRadius (ME,200);
SetEntropyMood (ME,AGRESSIVE_END);
SetCurMood (ME,AGRESSIVE_END);
SetSkillLevel (ME,pilotskill,gunneryskill,commandskill);
SetAttackThrottle (ME,100);
SetMinSpeed (ME,100);
EnablePerWeaponRayCasting (ME,TRUE);
bot_activated_timer = gti_Timer_1;
endfunction;
function getmechsettactic;
var
integer i;
code
mymech = GetMechType(me);
mytactic = TACTIC_PICK_BEST;
switch (mymech)
Case FirstMechID:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_ArcticWolf:
mytactic = TACTIC_HIT_AND_RUN;
Endcase;
Case M_Ares:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Argus:
mytactic = TACTIC_FAST_CIRCLE;
Endcase;
Case M_Atlas:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Awesome:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_BlackKnight:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_BlackLanner:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Brigand:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Bushwacker:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Catapult:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_CauldronBorn:
mytactic = TACTIC_CIRCLE_OF_DEATH;
Endcase;
Case M_Chimera:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Commando:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Cougar:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Cyclops:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Daishi:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_Deimos:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Dragon:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_Flea:
mytactic = TACTIC_HIT_AND_RUN;
Endcase;
Case M_Fafnir:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_Gladiator:
mytactic = TACTIC_CIRCLE_OF_DEATH;
Endcase;
Case M_Grizzly:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Hauptmann :
mytactic = TACTIC_CIRCLE_OF_DEATH;
Endcase;
Case M_Hellhound:
mytactic = TACTIC_HIT_AND_RUN;
Endcase;
Case M_Hellspawn:
mytactic = TACTIC_HIT_AND_RUN;
Endcase;
Case M_Highlander:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_HollanderII:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_Hunchback:
mytactic = TACTIC_CIRCLE_OF_DEATH;
Endcase;
Case M_Kodiak:
mytactic = TACTIC_CIRCLE_OF_DEATH;
Endcase;
Case M_Loki:
mytactic = TACTIC_CIRCLE_OF_DEATH;
Endcase;
Case M_Longbow:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_Madcat:
mytactic = TACTIC_CIRCLE_OF_DEATH;
Endcase;
Case M_Madcat_MKII:
mytactic = TACTIC_JUMP_AND_SHOOT;
Endcase;
Case M_Masakari:
mytactic = TACTIC_CIRCLE_OF_DEATH;
Endcase;
Case M_Mauler:
mytactic = TACTIC_CIRCLE_OF_DEATH;
Endcase;
Case M_Novacat:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_Osiris:
mytactic = TACTIC_HIT_AND_RUN;
Endcase;
Case M_Owens :
mytactic = TACTIC_HIT_AND_RUN;
Endcase;
Case M_Puma:
mytactic = TACTIC_JUMP_AND_SHOOT;
Endcase;
Case M_Raven:
mytactic = TACTIC_HIT_AND_RUN;
Endcase;
Case M_Ryoken:
mytactic = TACTIC_HIT_AND_RUN;
Endcase;
Case M_Shadowcat:
mytactic = TACTIC_JUMP_AND_SHOOT;
Endcase;
Case M_Solitaire:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Sunder:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_Templar:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_Thanatos:
mytactic = TACTIC_JUMP_AND_SHOOT;
Endcase;
Case M_Thor:
mytactic = TACTIC_JUMP_AND_SHOOT;
Endcase;
Case M_Uller:
mytactic = TACTIC_HIT_AND_RUN;
Endcase;
Case M_Uziel:
mytactic = TACTIC_JUMP_AND_SHOOT;
Endcase;
Case M_Victor:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_Vulture:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_Wolfhound:
mytactic = TACTIC_CIRCLE_OF_DEATH;
Endcase;
Case M_Zeus:
mytactic = TACTIC_SNIPE;
Endcase;
Case NoMechID:
mytactic = TACTIC_PICK_BEST;
Endcase;
Endswitch;
endfunction;
state StartState;
code
deathbucket = Bucket_DEATHS;
death = FindBucketValue(deathbucket,me);
killsbucket = Bucket_KILLS;
kills = FindBucketValue(killsbucket,me);
adjust = (death - kills);
if (adjust > 10) then
adjust = adjust * 100;
else
adjust = adjust * 10;
endif;
if (adjust < 0) then
adjust = 0;
endif;
pilotskill = pilotskill + adjust;
gunneryskill = gunneryskill + adjust;
commandskill = commandskill + adjust;
SetSkillLevel(ME,pilotskill,gunneryskill,commandskill);
StartTimer(bot_activated_timer);
trans CheckTimer;
endstate;
state CheckTimer;
code
//---------------------------------------------
// Time before Bot Wakes up and starts Shooting
//---------------------------------------------
if (TimeGreater(bot_activated_timer,5.0)) then
getmechsettactic;
trans WaitToAmbushState;
endif;
//---------------------------------------------
// Firing upon/near before timer up lets the bot go play
//---------------------------------------------
if (IsShot(ME) == TRUE) then
SetTarget(ME,WhoShot(ME));
getmechsettactic;
trans WaitToAmbushState;
endif;
trans CheckTimer;
endstate;
state WaitToAmbushState;
code
if (Bot_FindEnemy(attackrange)) then
trans AttackState;
endif;
if ((isshot(me)) == true) then
hits = hits + 1;
if (hits > 100) then
hits = 100;
endif;
shooter = Whoshot(me);
SetTarget (me,shooter);
SetTargetDesirability(shooter, hits);
endif;
OrderMoveLookOut;
endstate;
state AttackState;
code
if (LeaveAttackState(withdrawRange)) then
trans WaitToAmbushState;
endif;
if ((isshot(me)) == true) then
hits = hits + 1;
if (hits > 100) then
hits = 100;
endif;
shooter = Whoshot(me);
SetTarget (me,shooter);
SetTargetDesirability(shooter, hits);
endif;
OrderAttackTactic(mytactic,TRUE);
endstate;
state DeadState;
code
shooter = WhoDestroyed(me);
SetTargetDesirability(shooter, 20);
orderDie;
endstate;
endfsm.
@@ -0,0 +1,403 @@
fsm SniperBot : integer;
const
#include_ <content\ABLScripts\mwconst.abi>
type
#include_ <content\ABLScripts\mwtype.abi>
var
static integer attackRange; // At what range do I start shooting?
static integer withdrawRange; // At what range do I withdraw?
static ObjectID mymech;
static integer mytactic;
static integer pilotskill;
static integer gunneryskill;
static integer commandskill;
static integer hits;
static ObjectID shooter;
static integer bot_activated_timer;
static integer death;
static integer deathbucket;
static integer kills;
static integer killsbucket;
static integer adjust;
function Init;
code
// Editable Settings.
//
// 10 can't hit the barn
// 100 deadly shot
// 999 never miss
pilotskill = 80;
gunneryskill = 90; // 70 is Average
commandskill = 80;
// End of Editable Settings
// script-specific variables
hits = 0;
adjust = 0;
attackRange = 9999;
withdrawRange = 9999;
// driver settings
SetFiringDelay (ME,0.0,0.0);
SetIgnoreFriendlyFire (ME,true);
SetIsShotRadius (ME,200);
SetEntropyMood (ME,AGRESSIVE_END);
SetCurMood (ME,AGRESSIVE_END);
SetSkillLevel (ME,pilotskill,gunneryskill,commandskill);
SetAttackThrottle (ME,100);
SetMinSpeed (ME,100);
EnablePerWeaponRayCasting (ME,TRUE);
bot_activated_timer = gti_Timer_1;
endfunction;
function getmechsettactic;
var
integer i;
code
mymech = GetMechType(me);
mytactic = TACTIC_PICK_BEST;
switch (mymech)
Case FirstMechID:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_ArcticWolf:
mytactic = TACTIC_HIT_AND_RUN;
Endcase;
Case M_Ares:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Argus:
mytactic = TACTIC_FAST_CIRCLE;
Endcase;
Case M_Atlas:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Awesome:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_BlackKnight:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_BlackLanner:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Brigand:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Bushwacker:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Catapult:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_CauldronBorn:
mytactic = TACTIC_CIRCLE_OF_DEATH;
Endcase;
Case M_Chimera:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Commando:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Cougar:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Cyclops:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Daishi:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_Deimos:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Dragon:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_Flea:
mytactic = TACTIC_HIT_AND_RUN;
Endcase;
Case M_Fafnir:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_Gladiator:
mytactic = TACTIC_CIRCLE_OF_DEATH;
Endcase;
Case M_Grizzly:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Hauptmann :
mytactic = TACTIC_CIRCLE_OF_DEATH;
Endcase;
Case M_Hellhound:
mytactic = TACTIC_HIT_AND_RUN;
Endcase;
Case M_Hellspawn:
mytactic = TACTIC_HIT_AND_RUN;
Endcase;
Case M_Highlander:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_HollanderII:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_Hunchback:
mytactic = TACTIC_CIRCLE_OF_DEATH;
Endcase;
Case M_Kodiak:
mytactic = TACTIC_CIRCLE_OF_DEATH;
Endcase;
Case M_Loki:
mytactic = TACTIC_CIRCLE_OF_DEATH;
Endcase;
Case M_Longbow:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_Madcat:
mytactic = TACTIC_CIRCLE_OF_DEATH;
Endcase;
Case M_Madcat_MKII:
mytactic = TACTIC_JUMP_AND_SHOOT;
Endcase;
Case M_Masakari:
mytactic = TACTIC_CIRCLE_OF_DEATH;
Endcase;
Case M_Mauler:
mytactic = TACTIC_CIRCLE_OF_DEATH;
Endcase;
Case M_Novacat:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_Osiris:
mytactic = TACTIC_HIT_AND_RUN;
Endcase;
Case M_Owens :
mytactic = TACTIC_HIT_AND_RUN;
Endcase;
Case M_Puma:
mytactic = TACTIC_JUMP_AND_SHOOT;
Endcase;
Case M_Raven:
mytactic = TACTIC_HIT_AND_RUN;
Endcase;
Case M_Ryoken:
mytactic = TACTIC_HIT_AND_RUN;
Endcase;
Case M_Shadowcat:
mytactic = TACTIC_JUMP_AND_SHOOT;
Endcase;
Case M_Solitaire:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Sunder:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_Templar:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_Thanatos:
mytactic = TACTIC_JUMP_AND_SHOOT;
Endcase;
Case M_Thor:
mytactic = TACTIC_JUMP_AND_SHOOT;
Endcase;
Case M_Uller:
mytactic = TACTIC_HIT_AND_RUN;
Endcase;
Case M_Uziel:
mytactic = TACTIC_JUMP_AND_SHOOT;
Endcase;
Case M_Victor:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_Vulture:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_Wolfhound:
mytactic = TACTIC_CIRCLE_OF_DEATH;
Endcase;
Case M_Zeus:
mytactic = TACTIC_SNIPE;
Endcase;
Case NoMechID:
mytactic = TACTIC_PICK_BEST;
Endcase;
Endswitch;
endfunction;
state StartState;
code
deathbucket = Bucket_DEATHS;
death = FindBucketValue(deathbucket,me);
killsbucket = Bucket_KILLS;
kills = FindBucketValue(killsbucket,me);
adjust = (death - kills);
if (adjust > 10) then
adjust = adjust * 100;
else
adjust = adjust * 10;
endif;
if (adjust < 0) then
adjust = 0;
endif;
pilotskill = pilotskill + adjust;
gunneryskill = gunneryskill + adjust;
commandskill = commandskill + adjust;
SetSkillLevel(ME,pilotskill,gunneryskill,commandskill);
StartTimer(bot_activated_timer);
trans CheckTimer;
endstate;
state CheckTimer;
code
//---------------------------------------------
// Time before Bot Wakes up and starts Shooting
//---------------------------------------------
if (TimeGreater(bot_activated_timer,5.0)) then
getmechsettactic;
trans WaitToAmbushState;
endif;
//---------------------------------------------
// Firing upon/near before timer up lets the bot go play
//---------------------------------------------
if (IsShot(ME) == TRUE) then
SetTarget(ME,WhoShot(ME));
getmechsettactic;
trans WaitToAmbushState;
endif;
trans CheckTimer;
endstate;
state WaitToAmbushState;
code
if (Bot_FindEnemy(attackrange)) then
trans AttackState;
endif;
if ((isshot(me)) == true) then
hits = hits + 1;
if (hits > 100) then
hits = 100;
endif;
shooter = Whoshot(me);
SetTarget (me,shooter);
SetTargetDesirability(shooter, hits);
endif;
OrderMoveLookOut;
endstate;
state AttackState;
code
if (LeaveAttackState(withdrawRange)) then
trans WaitToAmbushState;
endif;
if ((isshot(me)) == true) then
hits = hits + 1;
if (hits > 100) then
hits = 100;
endif;
shooter = Whoshot(me);
SetTarget (me,shooter);
SetTargetDesirability(shooter, hits);
endif;
OrderAttackTactic(mytactic,TRUE);
endstate;
state DeadState;
code
shooter = WhoDestroyed(me);
SetTargetDesirability(shooter, 20);
orderDie;
endstate;
endfsm.
@@ -0,0 +1,382 @@
fsm UberBot : integer;
const
#include_ <content\ABLScripts\mwconst.abi>
type
#include_ <content\ABLScripts\mwtype.abi>
var
static integer attackRange; // At what range do I start shooting?
static integer withdrawRange; // At what range do I withdraw?
static ObjectID mymech;
static integer mytactic;
static integer pilotskill;
static integer gunneryskill;
static integer commandskill;
static integer hits;
static ObjectID shooter;
static integer bot_activated_timer;
static integer death;
static integer deathbucket;
static integer kills;
static integer killsbucket;
static integer adjust;
function Init;
code
// Editable Settings.
//
// 10 can't hit the barn
// 100 deadly shot
// 999 never miss
pilotskill = 100;
gunneryskill = 999; // 70 is Average
commandskill = 100;
// End of Editable Settings
// script-specific variables
hits = 0;
adjust = 0;
attackRange = 9999;
withdrawRange = 9999;
// driver settings
SetFiringDelay (ME,0.0,0.0);
SetIgnoreFriendlyFire (ME,true);
SetIsShotRadius (ME,200);
SetEntropyMood (ME,AGRESSIVE_END);
SetCurMood (ME,AGRESSIVE_END);
SetSkillLevel (ME,pilotskill,gunneryskill,commandskill);
SetAttackThrottle (ME,100);
SetMinSpeed (ME,100);
EnablePerWeaponRayCasting (ME,TRUE);
bot_activated_timer = gti_Timer_1;
endfunction;
function getmechsettactic;
var
integer i;
code
mymech = GetMechType(me);
mytactic = TACTIC_PICK_BEST;
switch (mymech)
Case FirstMechID:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_ArcticWolf:
mytactic = TACTIC_HIT_AND_RUN;
Endcase;
Case M_Ares:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Argus:
mytactic = TACTIC_FAST_CIRCLE;
Endcase;
Case M_Atlas:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Awesome:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_BlackKnight:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_BlackLanner:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Brigand:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Bushwacker:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Catapult:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_CauldronBorn:
mytactic = TACTIC_CIRCLE_OF_DEATH;
Endcase;
Case M_Chimera:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Commando:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Cougar:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Cyclops:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Daishi:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_Deimos:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Dragon:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_Flea:
mytactic = TACTIC_HIT_AND_RUN;
Endcase;
Case M_Fafnir:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_Gladiator:
mytactic = TACTIC_CIRCLE_OF_DEATH;
Endcase;
Case M_Grizzly:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Hauptmann :
mytactic = TACTIC_CIRCLE_OF_DEATH;
Endcase;
Case M_Hellhound:
mytactic = TACTIC_HIT_AND_RUN;
Endcase;
Case M_Hellspawn:
mytactic = TACTIC_HIT_AND_RUN;
Endcase;
Case M_Highlander:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_HollanderII:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_Hunchback:
mytactic = TACTIC_CIRCLE_OF_DEATH;
Endcase;
Case M_Kodiak:
mytactic = TACTIC_CIRCLE_OF_DEATH;
Endcase;
Case M_Loki:
mytactic = TACTIC_CIRCLE_OF_DEATH;
Endcase;
Case M_Longbow:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_Madcat:
mytactic = TACTIC_CIRCLE_OF_DEATH;
Endcase;
Case M_Madcat_MKII:
mytactic = TACTIC_JUMP_AND_SHOOT;
Endcase;
Case M_Masakari:
mytactic = TACTIC_CIRCLE_OF_DEATH;
Endcase;
Case M_Mauler:
mytactic = TACTIC_CIRCLE_OF_DEATH;
Endcase;
Case M_Novacat:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_Osiris:
mytactic = TACTIC_HIT_AND_RUN;
Endcase;
Case M_Owens :
mytactic = TACTIC_HIT_AND_RUN;
Endcase;
Case M_Puma:
mytactic = TACTIC_JUMP_AND_SHOOT;
Endcase;
Case M_Raven:
mytactic = TACTIC_HIT_AND_RUN;
Endcase;
Case M_Ryoken:
mytactic = TACTIC_HIT_AND_RUN;
Endcase;
Case M_Shadowcat:
mytactic = TACTIC_JUMP_AND_SHOOT;
Endcase;
Case M_Solitaire:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Sunder:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_Templar:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_Thanatos:
mytactic = TACTIC_JUMP_AND_SHOOT;
Endcase;
Case M_Thor:
mytactic = TACTIC_JUMP_AND_SHOOT;
Endcase;
Case M_Uller:
mytactic = TACTIC_HIT_AND_RUN;
Endcase;
Case M_Uziel:
mytactic = TACTIC_JUMP_AND_SHOOT;
Endcase;
Case M_Victor:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_Vulture:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_Wolfhound:
mytactic = TACTIC_CIRCLE_OF_DEATH;
Endcase;
Case M_Zeus:
mytactic = TACTIC_SNIPE;
Endcase;
Case NoMechID:
mytactic = TACTIC_PICK_BEST;
Endcase;
Endswitch;
endfunction;
state StartState;
code
StartTimer(bot_activated_timer);
trans CheckTimer;
endstate;
state CheckTimer;
code
//---------------------------------------------
// Time before Bot Wakes up and starts Shooting
//---------------------------------------------
if (TimeGreater(bot_activated_timer,5.0)) then
getmechsettactic;
trans WaitToAmbushState;
endif;
//---------------------------------------------
// Firing upon/near before timer up lets the bot go play
//---------------------------------------------
if (IsShot(ME) == TRUE) then
SetTarget(ME,WhoShot(ME));
getmechsettactic;
trans WaitToAmbushState;
endif;
trans CheckTimer;
endstate;
state WaitToAmbushState;
code
if (Bot_FindEnemy(attackrange)) then
trans AttackState;
endif;
if ((isshot(me)) == true) then
hits = hits + 1;
if (hits > 100) then
hits = 100;
endif;
shooter = Whoshot(me);
SetTarget (me,shooter);
SetTargetDesirability(shooter, hits);
endif;
OrderMoveLookOut;
endstate;
state AttackState;
code
if (LeaveAttackState(withdrawRange)) then
trans WaitToAmbushState;
endif;
if ((isshot(me)) == true) then
hits = hits + 1;
if (hits > 100) then
hits = 100;
endif;
shooter = Whoshot(me);
SetTarget (me,shooter);
SetTargetDesirability(shooter, hits);
endif;
OrderAttackTactic(mytactic,TRUE);
endstate;
state DeadState;
code
shooter = WhoDestroyed(me);
SetTargetDesirability(shooter, 20);
orderDie;
endstate;
endfsm.
@@ -0,0 +1,381 @@
fsm WussyBot : integer;
const
#include_ <content\ABLScripts\mwconst.abi>
type
#include_ <content\ABLScripts\mwtype.abi>
var
static integer attackRange; // At what range do I start shooting?
static integer withdrawRange; // At what range do I withdraw?
static ObjectID mymech;
static integer mytactic;
static integer pilotskill;
static integer gunneryskill;
static integer commandskill;
static integer hits;
static ObjectID shooter;
static integer bot_activated_timer;
static integer death;
static integer deathbucket;
static integer kills;
static integer killsbucket;
static integer adjust;
function Init;
code
// Editable Settings.
//
// 10 can't hit the barn
// 100 deadly shot
// 999 never miss
pilotskill = 10;
gunneryskill = 15; // 70 is Average
commandskill = 0;
// End of Editable Settings
// script-specific variables
hits = 0;
adjust = 0;
attackRange = 9999;
withdrawRange = 9999;
// driver settings
SetFiringDelay (ME,0.0,0.0);
SetIgnoreFriendlyFire (ME,true);
SetIsShotRadius (ME,200);
SetEntropyMood (ME,AGRESSIVE_END);
SetCurMood (ME,AGRESSIVE_END);
SetSkillLevel (ME,pilotskill,gunneryskill,commandskill);
SetAttackThrottle (ME,100);
SetMinSpeed (ME,100);
EnablePerWeaponRayCasting (ME,TRUE);
bot_activated_timer = gti_Timer_1;
endfunction;
function getmechsettactic;
var
integer i;
code
mymech = GetMechType(me);
mytactic = TACTIC_PICK_BEST;
switch (mymech)
Case FirstMechID:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_ArcticWolf:
mytactic = TACTIC_HIT_AND_RUN;
Endcase;
Case M_Ares:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Argus:
mytactic = TACTIC_FAST_CIRCLE;
Endcase;
Case M_Atlas:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Awesome:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_BlackKnight:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_BlackLanner:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Brigand:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Bushwacker:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Catapult:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_CauldronBorn:
mytactic = TACTIC_CIRCLE_OF_DEATH;
Endcase;
Case M_Chimera:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Commando:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Cougar:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Cyclops:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Daishi:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_Deimos:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Dragon:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_Flea:
mytactic = TACTIC_HIT_AND_RUN;
Endcase;
Case M_Fafnir:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_Gladiator:
mytactic = TACTIC_CIRCLE_OF_DEATH;
Endcase;
Case M_Grizzly:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Hauptmann :
mytactic = TACTIC_CIRCLE_OF_DEATH;
Endcase;
Case M_Hellhound:
mytactic = TACTIC_HIT_AND_RUN;
Endcase;
Case M_Hellspawn:
mytactic = TACTIC_HIT_AND_RUN;
Endcase;
Case M_Highlander:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_HollanderII:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_Hunchback:
mytactic = TACTIC_CIRCLE_OF_DEATH;
Endcase;
Case M_Kodiak:
mytactic = TACTIC_CIRCLE_OF_DEATH;
Endcase;
Case M_Loki:
mytactic = TACTIC_CIRCLE_OF_DEATH;
Endcase;
Case M_Longbow:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_Madcat:
mytactic = TACTIC_CIRCLE_OF_DEATH;
Endcase;
Case M_Madcat_MKII:
mytactic = TACTIC_JUMP_AND_SHOOT;
Endcase;
Case M_Masakari:
mytactic = TACTIC_CIRCLE_OF_DEATH;
Endcase;
Case M_Mauler:
mytactic = TACTIC_CIRCLE_OF_DEATH;
Endcase;
Case M_Novacat:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_Osiris:
mytactic = TACTIC_HIT_AND_RUN;
Endcase;
Case M_Owens :
mytactic = TACTIC_HIT_AND_RUN;
Endcase;
Case M_Puma:
mytactic = TACTIC_JUMP_AND_SHOOT;
Endcase;
Case M_Raven:
mytactic = TACTIC_HIT_AND_RUN;
Endcase;
Case M_Ryoken:
mytactic = TACTIC_HIT_AND_RUN;
Endcase;
Case M_Shadowcat:
mytactic = TACTIC_JUMP_AND_SHOOT;
Endcase;
Case M_Solitaire:
mytactic = TACTIC_PICK_BEST;
Endcase;
Case M_Sunder:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_Templar:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_Thanatos:
mytactic = TACTIC_JUMP_AND_SHOOT;
Endcase;
Case M_Thor:
mytactic = TACTIC_JUMP_AND_SHOOT;
Endcase;
Case M_Uller:
mytactic = TACTIC_HIT_AND_RUN;
Endcase;
Case M_Uziel:
mytactic = TACTIC_JUMP_AND_SHOOT;
Endcase;
Case M_Victor:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_Vulture:
mytactic = TACTIC_SNIPE;
Endcase;
Case M_Wolfhound:
mytactic = TACTIC_CIRCLE_OF_DEATH;
Endcase;
Case M_Zeus:
mytactic = TACTIC_SNIPE;
Endcase;
Case NoMechID:
mytactic = TACTIC_PICK_BEST;
Endcase;
Endswitch;
endfunction;
state StartState;
code
StartTimer(bot_activated_timer);
trans CheckTimer;
endstate;
state CheckTimer;
code
//---------------------------------------------
// Time before Bot Wakes up and starts Shooting
//---------------------------------------------
if (TimeGreater(bot_activated_timer,5.0)) then
getmechsettactic;
trans WaitToAmbushState;
endif;
//---------------------------------------------
// Firing upon/near before timer up lets the bot go play
//---------------------------------------------
if (IsShot(ME) == TRUE) then
SetTarget(ME,WhoShot(ME));
getmechsettactic;
trans WaitToAmbushState;
endif;
trans CheckTimer;
endstate;
state WaitToAmbushState;
code
if (Bot_FindEnemy(attackrange)) then
trans AttackState;
endif;
if ((isshot(me)) == true) then
hits = hits + 1;
if (hits > 100) then
hits = 100;
endif;
shooter = Whoshot(me);
SetTarget (me,shooter);
SetTargetDesirability(shooter, hits);
endif;
OrderMoveLookOut;
endstate;
state AttackState;
code
if (LeaveAttackState(withdrawRange)) then
trans WaitToAmbushState;
endif;
if ((isshot(me)) == true) then
hits = hits + 1;
if (hits > 100) then
hits = 100;
endif;
shooter = Whoshot(me);
SetTarget (me,shooter);
SetTargetDesirability(shooter, hits);
endif;
OrderAttackTactic(TACTIC_STARE,TRUE);
endstate;
state DeadState;
code
shooter = WhoDestroyed(me);
SetTargetDesirability(shooter, 20);
orderDie;
endstate;
endfsm.
@@ -0,0 +1,10 @@
0Wussy
1Easy
2RookieDodge
3RookieSniper
4Rookie
5Dodge
6Sniper
7Killer
8Slaughter
9Uber
@@ -0,0 +1,134 @@
fsm WussyBot : integer;
//------------------------------------------------------------------
// WussyBot: Level 0
// A total pushover, and an easy target even for rank beginners.
//------------------------------------------------------------------
//------------------------------------------------------------------
// Constants
//------------------------------------------------------------------
const
#include_ <content\ABLScripts\mwconst.abi>
//------------------------------------------------------------------
// Types
//------------------------------------------------------------------
type
#include_ <content\ABLScripts\mwtype.abi>
//------------------------------------------------------------------
// Variables
//------------------------------------------------------------------
var
static integer attackRange; // At what range do I start shooting?
static integer withdrawRange; // At what range do I withdraw?
static integer bot_activated_timer;
//------------------------------------------------------------------
// Init: my initialization function
//------------------------------------------------------------------
function Init;
code
// script-specific variables
attackRange = 9999;
withdrawRange = 9999;
// driver settings
SetFiringDelay (ME,3.0,8.0);
SetIgnoreFriendlyFire (ME,true);
SetIsShotRadius (ME,120);
SetEntropyMood (ME,DEFENSIVE_START);
SetCurMood (ME,DEFENSIVE_START);
SetSkillLevel (ME,0,0,0);
SetAttackThrottle (ME,36);
EnablePerWeaponRayCasting (ME,TRUE);
bot_activated_timer = gti_Timer_1;
endfunction;
//------------------------------------------------------------------
// StartState: my initial state
//------------------------------------------------------------------
state StartState;
code
StartTimer(bot_activated_timer);
trans CheckTimer;
endstate;
state CheckTimer;
code
//---------------------------------------------
// Time before Bot Wakes up and starts Shooting
//---------------------------------------------
if (TimeGreater(bot_activated_timer,5.0)) then
trans WaitToAmbushState;
endif;
//---------------------------------------------
// Firing upon/near before timer up lets the bot go play
//---------------------------------------------
if (IsShot(ME) == TRUE) then
SetTarget(ME,WhoShot(ME));
trans WaitToAmbushState;
endif;
trans CheckTimer;
endstate;
//------------------------------------------------------------------
// WaitInAmbushState: wait for someone to come close enough to attack
//------------------------------------------------------------------
state WaitToAmbushState;
code
if (Bot_FindEnemy(attackrange)) then
trans AttackState;
endif;
OrderMoveLookOut;
endstate;
//------------------------------------------------------------------
// AttackState: the ambush is over -- let's kick some ass!
//------------------------------------------------------------------
state AttackState;
code
if (LeaveAttackState(withdrawRange)) then
trans WaitToAmbushState;
endif;
OrderAttack(TRUE);
endstate;
//------------------------------------------------------------------
// DeadState: OK, I kicked the bucket.
//------------------------------------------------------------------
state DeadState;
code
orderDie;
endstate;
endfsm.
@@ -0,0 +1,132 @@
fsm DodgeBot : integer;
//------------------------------------------------------------------
// SniperBot: Level 5
// Very good aim, but not very good at maneuvering.
//------------------------------------------------------------------
//------------------------------------------------------------------
// Constants
//------------------------------------------------------------------
const
#include_ <content\ABLScripts\mwconst.abi>
//------------------------------------------------------------------
// Types
//------------------------------------------------------------------
type
#include_ <content\ABLScripts\mwtype.abi>
//------------------------------------------------------------------
// Variables
//------------------------------------------------------------------
var
static integer attackRange; // At what range do I start shooting?
static integer withdrawRange; // At what range do I withdraw?
static integer bot_activated_timer;
//------------------------------------------------------------------
// Init: my initialization function
//------------------------------------------------------------------
function Init;
code
// script-specific variables
attackRange = 9999;
withdrawRange = 9999;
// driver settings
SetFiringDelay (ME,0.0,2.5);
SetIgnoreFriendlyFire (ME,true);
SetIsShotRadius (ME,160);
SetEntropyMood (ME,NEUTRAL_START);
SetCurMood (ME,NEUTRAL_START);
SetSkillLevel (ME,75,110,60);
SetAttackThrottle (ME,60);
bot_activated_timer = gti_Timer_1;
endfunction;
//------------------------------------------------------------------
// StartState: my initial state
//------------------------------------------------------------------
state StartState;
code
StartTimer(bot_activated_timer);
trans CheckTimer;
endstate;
state CheckTimer;
code
//---------------------------------------------
// Time before Bot Wakes up and starts Shooting
//---------------------------------------------
if (TimeGreater(bot_activated_timer,5.0)) then
trans WaitToAmbushState;
endif;
//---------------------------------------------
// Firing upon/near before timer up lets the bot go play
//---------------------------------------------
if (IsShot(ME) == TRUE) then
SetTarget(ME,WhoShot(ME));
trans WaitToAmbushState;
endif;
trans CheckTimer;
endstate;
//------------------------------------------------------------------
// WaitInAmbushState: wait for someone to come close enough to attack
//------------------------------------------------------------------
state WaitToAmbushState;
code
if (Bot_FindEnemy(attackrange)) then
trans AttackState;
endif;
OrderMoveLookOut;
endstate;
//------------------------------------------------------------------
// AttackState: the ambush is over -- let's kick some ass!
//------------------------------------------------------------------
state AttackState;
code
if (LeaveAttackState(withdrawRange)) then
trans WaitToAmbushState;
endif;
OrderAttackTactic(TACTIC_LOCAL_PATROL,TRUE);
endstate;
//------------------------------------------------------------------
// DeadState: OK, I kicked the bucket.
//------------------------------------------------------------------
state DeadState;
code
orderDie;
endstate;
endfsm.
@@ -0,0 +1,132 @@
fsm EasyBot : integer;
//------------------------------------------------------------------
// RookieDodgeBot: Level 1
// A rookie version of the DodgeBot.
//------------------------------------------------------------------
//------------------------------------------------------------------
// Constants
//------------------------------------------------------------------
const
#include_ <content\ABLScripts\mwconst.abi>
//------------------------------------------------------------------
// Types
//------------------------------------------------------------------
type
#include_ <content\ABLScripts\mwtype.abi>
//------------------------------------------------------------------
// Variables
//------------------------------------------------------------------
var
static integer attackRange; // At what range do I start shooting?
static integer withdrawRange; // At what range do I withdraw?
static integer bot_activated_timer;
//------------------------------------------------------------------
// Init: my initialization function
//------------------------------------------------------------------
function Init;
code
// script-specific variables
attackRange = 9999;
withdrawRange = 9999;
// driver settings
SetFiringDelay (ME,2.0,6.0);
SetIgnoreFriendlyFire (ME,true);
SetIsShotRadius (ME,160);
SetEntropyMood (ME,NEUTRAL_START);
SetCurMood (ME,NEUTRAL_START);
SetSkillLevel (ME,80,10,30);
SetAttackThrottle (ME,90);
bot_activated_timer = gti_Timer_1;
endfunction;
//------------------------------------------------------------------
// StartState: my initial state
//------------------------------------------------------------------
state StartState;
code
StartTimer(bot_activated_timer);
trans CheckTimer;
endstate;
state CheckTimer;
code
//---------------------------------------------
// Time before Bot Wakes up and starts Shooting
//---------------------------------------------
if (TimeGreater(bot_activated_timer,5.0)) then
trans WaitToAmbushState;
endif;
//---------------------------------------------
// Firing upon/near before timer up lets the bot go play
//---------------------------------------------
if (IsShot(ME) == TRUE) then
SetTarget(ME,WhoShot(ME));
trans WaitToAmbushState;
endif;
trans CheckTimer;
endstate;
//------------------------------------------------------------------
// WaitInAmbushState: wait for someone to come close enough to attack
//------------------------------------------------------------------
state WaitToAmbushState;
code
if (Bot_FindEnemy(attackrange)) then
trans AttackState;
endif;
OrderMoveLookOut;
endstate;
//------------------------------------------------------------------
// AttackState: the ambush is over -- let's kick some ass!
//------------------------------------------------------------------
state AttackState;
code
if (LeaveAttackState(withdrawRange)) then
trans WaitToAmbushState;
endif;
OrderAttackTactic(TACTIC_CIRCLE,TRUE);
endstate;
//------------------------------------------------------------------
// DeadState: OK, I kicked the bucket.
//------------------------------------------------------------------
state DeadState;
code
orderDie;
endstate;
endfsm.
@@ -0,0 +1,135 @@
fsm KillerBot : integer;
//------------------------------------------------------------------
// SlaughterBot: Level 7
// A difficult challenger, second only to the dreaded UberBot.
//------------------------------------------------------------------
//------------------------------------------------------------------
// Constants
//------------------------------------------------------------------
const
#include_ <content\ABLScripts\mwconst.abi>
//------------------------------------------------------------------
// Types
//------------------------------------------------------------------
type
#include_ <content\ABLScripts\mwtype.abi>
//------------------------------------------------------------------
// Variables
//------------------------------------------------------------------
var
static integer attackRange; // At what range do I start shooting?
static integer withdrawRange; // At what range do I withdraw?
static integer bot_activated_timer;
//------------------------------------------------------------------
// Init: my initialization function
//------------------------------------------------------------------
function Init;
code
// script-specific variables
attackRange = 9999;
withdrawRange = 9999;
// driver settings
SetFiringDelay (ME,0.0,0.0);
SetIgnoreFriendlyFire (ME,true);
SetIsShotRadius (ME,200);
SetEntropyMood (ME,AGRESSIVE_END);
SetCurMood (ME,AGRESSIVE_END);
SetSkillLevel (ME,100,110,100);
SetAttackThrottle (ME,100);
SetMinSpeed (ME,100);
EnablePerWeaponRayCasting (ME,TRUE);
bot_activated_timer = gti_Timer_1;
endfunction;
//------------------------------------------------------------------
// StartState: my initial state
//------------------------------------------------------------------
state StartState;
code
StartTimer(bot_activated_timer);
trans CheckTimer;
endstate;
state CheckTimer;
code
//---------------------------------------------
// Time before Bot Wakes up and starts Shooting
//---------------------------------------------
if (TimeGreater(bot_activated_timer,5.0)) then
trans WaitToAmbushState;
endif;
//---------------------------------------------
// Firing upon/near before timer up lets the bot go play
//---------------------------------------------
if (IsShot(ME) == TRUE) then
SetTarget(ME,WhoShot(ME));
trans WaitToAmbushState;
endif;
trans CheckTimer;
endstate;
//------------------------------------------------------------------
// WaitInAmbushState: wait for someone to come close enough to attack
//------------------------------------------------------------------
state WaitToAmbushState;
code
if (Bot_FindEnemy(attackrange)) then
trans AttackState;
endif;
OrderMoveLookOut;
endstate;
//------------------------------------------------------------------
// AttackState: the ambush is over -- let's kick some ass!
//------------------------------------------------------------------
state AttackState;
code
if (LeaveAttackState(withdrawRange)) then
trans WaitToAmbushState;
endif;
OrderAttackTactic(TACTIC_CIRCLE,TRUE);
endstate;
//------------------------------------------------------------------
// DeadState: OK, I kicked the bucket.
//------------------------------------------------------------------
state DeadState;
code
orderDie;
endstate;
endfsm.
@@ -0,0 +1,132 @@
fsm RookieBot : integer;
//------------------------------------------------------------------
// DodgeBot: Level 4
// A challenging 'Mech that's fast and good at evasion.
//------------------------------------------------------------------
//------------------------------------------------------------------
// Constants
//------------------------------------------------------------------
const
#include_ <content\ABLScripts\mwconst.abi>
//------------------------------------------------------------------
// Types
//------------------------------------------------------------------
type
#include_ <content\ABLScripts\mwtype.abi>
//------------------------------------------------------------------
// Variables
//------------------------------------------------------------------
var
static integer attackRange; // At what range do I start shooting?
static integer withdrawRange; // At what range do I withdraw?
static integer bot_activated_timer;
//------------------------------------------------------------------
// Init: my initialization function
//------------------------------------------------------------------
function Init;
code
// script-specific variables
attackRange = 9999;
withdrawRange = 9999;
// driver settings
SetIgnoreFriendlyFire (ME,true);
SetFiringDelay (ME,1.0,4.0);
SetIsShotRadius (ME,160);
SetEntropyMood (ME,NEUTRAL_START);
SetCurMood (ME,NEUTRAL_START);
SetSkillLevel (ME,90,50,60);
SetAttackThrottle (ME,100);
bot_activated_timer = gti_Timer_1;
endfunction;
//------------------------------------------------------------------
// StartState: my initial state
//------------------------------------------------------------------
state StartState;
code
StartTimer(bot_activated_timer);
trans CheckTimer;
endstate;
state CheckTimer;
code
//---------------------------------------------
// Time before Bot Wakes up and starts Shooting
//---------------------------------------------
if (TimeGreater(bot_activated_timer,5.0)) then
trans WaitToAmbushState;
endif;
//---------------------------------------------
// Firing upon/near before timer up lets the bot go play
//---------------------------------------------
if (IsShot(ME) == TRUE) then
SetTarget(ME,WhoShot(ME));
trans WaitToAmbushState;
endif;
trans CheckTimer;
endstate;
//------------------------------------------------------------------
// WaitInAmbushState: wait for someone to come close enough to attack
//------------------------------------------------------------------
state WaitToAmbushState;
code
if (Bot_FindEnemy(attackrange)) then
trans AttackState;
endif;
OrderMoveLookOut;
endstate;
//------------------------------------------------------------------
// AttackState: the ambush is over -- let's kick some ass!
//------------------------------------------------------------------
state AttackState;
code
if (LeaveAttackState(withdrawRange)) then
trans WaitToAmbushState;
endif;
OrderAttackTactic(TACTIC_CIRCLE,TRUE);
endstate;
//------------------------------------------------------------------
// DeadState: OK, I kicked the bucket.
//------------------------------------------------------------------
state DeadState;
code
orderDie;
endstate;
endfsm.
@@ -0,0 +1,132 @@
fsm RookieDodgeBot : integer;
//------------------------------------------------------------------
// RookieSniperBot: Level 2
// A rookie version of the SniperBot.
//------------------------------------------------------------------
//------------------------------------------------------------------
// Constants
//------------------------------------------------------------------
const
#include_ <content\ABLScripts\mwconst.abi>
//------------------------------------------------------------------
// Types
//------------------------------------------------------------------
type
#include_ <content\ABLScripts\mwtype.abi>
//------------------------------------------------------------------
// Variables
//------------------------------------------------------------------
var
static integer attackRange; // At what range do I start shooting?
static integer withdrawRange; // At what range do I withdraw?
static integer bot_activated_timer;
//------------------------------------------------------------------
// Init: my initialization function
//------------------------------------------------------------------
function Init;
code
// script-specific variables
attackRange = 9999;
withdrawRange = 9999;
// driver settings
SetFiringDelay (ME,1.0,4.0);
SetIgnoreFriendlyFire (ME,true);
SetIsShotRadius (ME,160);
SetEntropyMood (ME,NEUTRAL_START);
SetCurMood (ME,NEUTRAL_START);
SetSkillLevel (ME,10,60,30);
SetAttackThrottle (ME,36);
bot_activated_timer = gti_Timer_1;
endfunction;
//------------------------------------------------------------------
// StartState: my initial state
//------------------------------------------------------------------
state StartState;
code
StartTimer(bot_activated_timer);
trans CheckTimer;
endstate;
state CheckTimer;
code
//---------------------------------------------
// Time before Bot Wakes up and starts Shooting
//---------------------------------------------
if (TimeGreater(bot_activated_timer,5.0)) then
trans WaitToAmbushState;
endif;
//---------------------------------------------
// Firing upon/near before timer up lets the bot go play
//---------------------------------------------
if (IsShot(ME) == TRUE) then
SetTarget(ME,WhoShot(ME));
trans WaitToAmbushState;
endif;
trans CheckTimer;
endstate;
//------------------------------------------------------------------
// WaitInAmbushState: wait for someone to come close enough to attack
//------------------------------------------------------------------
state WaitToAmbushState;
code
if (Bot_FindEnemy(attackrange)) then
trans AttackState;
endif;
OrderMoveLookOut;
endstate;
//------------------------------------------------------------------
// AttackState: the ambush is over -- let's kick some ass!
//------------------------------------------------------------------
state AttackState;
code
if (LeaveAttackState(withdrawRange)) then
trans WaitToAmbushState;
endif;
OrderAttackTactic(TACTIC_LOCAL_PATROL,TRUE);
endstate;
//------------------------------------------------------------------
// DeadState: OK, I kicked the bucket.
//------------------------------------------------------------------
state DeadState;
code
orderDie;
endstate;
endfsm.
@@ -0,0 +1,133 @@
fsm RookieSniperBot : integer;
//------------------------------------------------------------------
// RookieBot: Level 3
// A moderately easy opponent, less of a pushover than the EasyBot
// but less of a challenge than the KillerBot.
//------------------------------------------------------------------
//------------------------------------------------------------------
// Constants
//------------------------------------------------------------------
const
#include_ <content\ABLScripts\mwconst.abi>
//------------------------------------------------------------------
// Types
//------------------------------------------------------------------
type
#include_ <content\ABLScripts\mwtype.abi>
//------------------------------------------------------------------
// Variables
//------------------------------------------------------------------
var
static integer attackRange; // At what range do I start shooting?
static integer withdrawRange; // At what range do I withdraw?
static integer bot_activated_timer;
//------------------------------------------------------------------
// Init: my initialization function
//------------------------------------------------------------------
function Init;
code
// script-specific variables
attackRange = 9999;
withdrawRange = 9999;
// driver settings
SetFiringDelay (ME,1.0,4.0);
SetIgnoreFriendlyFire (ME,true);
SetIsShotRadius (ME,120);
SetEntropyMood (ME,NEUTRAL_START);
SetCurMood (ME,NEUTRAL_START);
SetSkillLevel (ME,30,35,30);
SetAttackThrottle (ME,60);
bot_activated_timer = gti_Timer_1;
endfunction;
//------------------------------------------------------------------
// StartState: my initial state
//------------------------------------------------------------------
state StartState;
code
StartTimer(bot_activated_timer);
trans CheckTimer;
endstate;
state CheckTimer;
code
//---------------------------------------------
// Time before Bot Wakes up and starts Shooting
//---------------------------------------------
if (TimeGreater(bot_activated_timer,5.0)) then
trans WaitToAmbushState;
endif;
//---------------------------------------------
// Firing upon/near before timer up lets the bot go play
//---------------------------------------------
if (IsShot(ME) == TRUE) then
SetTarget(ME,WhoShot(ME));
trans WaitToAmbushState;
endif;
trans CheckTimer;
endstate;
//------------------------------------------------------------------
// WaitInAmbushState: wait for someone to come close enough to attack
//------------------------------------------------------------------
state WaitToAmbushState;
code
if (Bot_FindEnemy(attackrange)) then
trans AttackState;
endif;
OrderMoveLookOut;
endstate;
//------------------------------------------------------------------
// AttackState: the ambush is over -- let's kick some ass!
//------------------------------------------------------------------
state AttackState;
code
if (LeaveAttackState(withdrawRange)) then
trans WaitToAmbushState;
endif;
OrderAttack(TRUE);
endstate;
//------------------------------------------------------------------
// DeadState: OK, I kicked the bucket.
//------------------------------------------------------------------
state DeadState;
code
orderDie;
endstate;
endfsm.
@@ -0,0 +1,139 @@
fsm SlaughterBot : integer;
//------------------------------------------------------------------
// UberBot: Level 8
// Intended to display the maximum amount of challenge that the game can provide.
//------------------------------------------------------------------
//------------------------------------------------------------------
// Constants
//------------------------------------------------------------------
const
#include_ <content\ABLScripts\mwconst.abi>
//------------------------------------------------------------------
// Types
//------------------------------------------------------------------
type
#include_ <content\ABLScripts\mwtype.abi>
//------------------------------------------------------------------
// Variables
//------------------------------------------------------------------
var
static integer attackRange; // At what range do I start shooting?
static integer withdrawRange; // At what range do I withdraw?
static integer bot_activated_timer; // How long to wait before startup?
//------------------------------------------------------------------
// Init: my initialization function
//------------------------------------------------------------------
function Init;
code
// script-specific variables
attackRange = 9999;
withdrawRange = 9999;
// driver settings
SetFiringDelay (ME,0.0,0.0);
SetIgnoreFriendlyFire (ME,true);
SetIsShotRadius (ME,200);
// SetEntropyMood (ME,AGRESSIVE_END);
// SetCurMood (ME,AGRESSIVE_END);
SetEntropyMood (ME,BRUTAL_START);
SetCurMood (ME,BRUTAL_START);
SetSkillLevel (ME,100,999,100);
SetAttackThrottle (ME,100);
// SetMinSpeed (ME,100);
EnablePerWeaponRayCasting (ME,TRUE);
bot_activated_timer = gti_Timer_1;
endfunction;
//------------------------------------------------------------------
// StartState: my initial state
//------------------------------------------------------------------
state StartState;
code
StartTimer(bot_activated_timer);
trans CheckTimer;
endstate;
state CheckTimer;
code
//---------------------------------------------
// Time before Bot Wakes up and starts Shooting
//---------------------------------------------
if (TimeGreater(bot_activated_timer,5.0)) then
trans WaitToAmbushState;
endif;
//---------------------------------------------
// Firing upon/near before timer up lets the bot go play
//---------------------------------------------
if (IsShot(ME) == TRUE) then
SetTarget(ME,WhoShot(ME));
trans WaitToAmbushState;
endif;
trans CheckTimer;
endstate;
//------------------------------------------------------------------
// WaitInAmbushState: wait for someone to come close enough to attack
//------------------------------------------------------------------
state WaitToAmbushState;
code
if (Bot_FindEnemy(attackrange)) then
trans AttackState;
endif;
OrderMoveLookOut;
endstate;
//------------------------------------------------------------------
// AttackState: the ambush is over -- let's kick some ass!
//------------------------------------------------------------------
state AttackState;
code
if (LeaveAttackState(withdrawRange)) then
trans WaitToAmbushState;
endif;
// OrderAttackTactic(TACTIC_FAST_CIRCLE,TRUE);
OrderAttackTactic(TACTIC_CIRCLE,TRUE);
endstate;
//------------------------------------------------------------------
// DeadState: OK, I kicked the bucket.
//------------------------------------------------------------------
state DeadState;
code
orderDie;
endstate;
endfsm.
@@ -0,0 +1,133 @@
fsm SniperBot : integer;
//------------------------------------------------------------------
// KillerBot: Level 6
// A medium-level challenge: tougher than a RookieBot, less than
// a SlaughterBot.
//------------------------------------------------------------------
//------------------------------------------------------------------
// Constants
//------------------------------------------------------------------
const
#include_ <content\ABLScripts\mwconst.abi>
//------------------------------------------------------------------
// Types
//------------------------------------------------------------------
type
#include_ <content\ABLScripts\mwtype.abi>
//------------------------------------------------------------------
// Variables
//------------------------------------------------------------------
var
static integer attackRange; // At what range do I start shooting?
static integer withdrawRange; // At what range do I withdraw?
static integer bot_activated_timer;
//------------------------------------------------------------------
// Init: my initialization function
//------------------------------------------------------------------
function Init;
code
// script-specific variables
attackRange = 9999;
withdrawRange = 9999;
// driver settings
SetIgnoreFriendlyFire (ME,true);
SetFiringDelay (ME,0.0,2.5);
SetIsShotRadius (ME,160);
SetEntropyMood (ME,NEUTRAL_END);
SetCurMood (ME,NEUTRAL_END);
SetSkillLevel (ME,80,90,80);
SetAttackThrottle (ME,85);
bot_activated_timer = gti_Timer_1;
endfunction;
//------------------------------------------------------------------
// StartState: my initial state
//------------------------------------------------------------------
state StartState;
code
StartTimer(bot_activated_timer);
trans CheckTimer;
endstate;
state CheckTimer;
code
//---------------------------------------------
// Time before Bot Wakes up and starts Shooting
//---------------------------------------------
if (TimeGreater(bot_activated_timer,5.0)) then
trans WaitToAmbushState;
endif;
//---------------------------------------------
// Firing upon/near before timer up lets the bot go play
//---------------------------------------------
if (IsShot(ME) == TRUE) then
SetTarget(ME,WhoShot(ME));
trans WaitToAmbushState;
endif;
trans CheckTimer;
endstate;
//------------------------------------------------------------------
// WaitInAmbushState: wait for someone to come close enough to attack
//------------------------------------------------------------------
state WaitToAmbushState;
code
if (Bot_FindEnemy(attackrange)) then
trans AttackState;
endif;
OrderMoveLookOut;
endstate;
//------------------------------------------------------------------
// AttackState: the ambush is over -- let's kick some ass!
//------------------------------------------------------------------
state AttackState;
code
if (LeaveAttackState(withdrawRange)) then
trans WaitToAmbushState;
endif;
OrderAttack(TRUE);
endstate;
//------------------------------------------------------------------
// DeadState: OK, I kicked the bucket.
//------------------------------------------------------------------
state DeadState;
code
orderDie;
endstate;
endfsm.
@@ -0,0 +1,139 @@
fsm UberBot : integer;
//------------------------------------------------------------------
// UberBot: Level 9
// Intended to display the maximum amount of challenge that the game can provide.
//------------------------------------------------------------------
//------------------------------------------------------------------
// Constants
//------------------------------------------------------------------
const
#include_ <content\ABLScripts\mwconst.abi>
//------------------------------------------------------------------
// Types
//------------------------------------------------------------------
type
#include_ <content\ABLScripts\mwtype.abi>
//------------------------------------------------------------------
// Variables
//------------------------------------------------------------------
var
static integer attackRange; // At what range do I start shooting?
static integer withdrawRange; // At what range do I withdraw?
static integer bot_activated_timer; // How long to wait before startup?
//------------------------------------------------------------------
// Init: my initialization function
//------------------------------------------------------------------
function Init;
code
// script-specific variables
attackRange = 9999;
withdrawRange = 9999;
// driver settings
SetFiringDelay (ME,0.0,0.0);
SetIgnoreFriendlyFire (ME,true);
SetIsShotRadius (ME,200);
// SetEntropyMood (ME,AGRESSIVE_END);
// SetCurMood (ME,AGRESSIVE_END);
SetEntropyMood (ME,BRUTAL_START);
SetCurMood (ME,BRUTAL_START);
SetSkillLevel (ME,100,999,100);
SetAttackThrottle (ME,100);
// SetMinSpeed (ME,100);
EnablePerWeaponRayCasting (ME,TRUE);
bot_activated_timer = gti_Timer_1;
endfunction;
//------------------------------------------------------------------
// StartState: my initial state
//------------------------------------------------------------------
state StartState;
code
StartTimer(bot_activated_timer);
trans CheckTimer;
endstate;
state CheckTimer;
code
//---------------------------------------------
// Time before Bot Wakes up and starts Shooting
//---------------------------------------------
if (TimeGreater(bot_activated_timer,5.0)) then
trans WaitToAmbushState;
endif;
//---------------------------------------------
// Firing upon/near before timer up lets the bot go play
//---------------------------------------------
if (IsShot(ME) == TRUE) then
SetTarget(ME,WhoShot(ME));
trans WaitToAmbushState;
endif;
trans CheckTimer;
endstate;
//------------------------------------------------------------------
// WaitInAmbushState: wait for someone to come close enough to attack
//------------------------------------------------------------------
state WaitToAmbushState;
code
if (Bot_FindEnemy(attackrange)) then
trans AttackState;
endif;
OrderMoveLookOut;
endstate;
//------------------------------------------------------------------
// AttackState: the ambush is over -- let's kick some ass!
//------------------------------------------------------------------
state AttackState;
code
if (LeaveAttackState(withdrawRange)) then
trans WaitToAmbushState;
endif;
// OrderAttackTactic(TACTIC_FAST_CIRCLE,TRUE);
OrderAttackTactic(TACTIC_CIRCLE,TRUE);
endstate;
//------------------------------------------------------------------
// DeadState: OK, I kicked the bucket.
//------------------------------------------------------------------
state DeadState;
code
orderDie;
endstate;
endfsm.
@@ -0,0 +1,135 @@
fsm WussyBot : integer;
//------------------------------------------------------------------
// EasyBot: Level 0
// Intended to be a moderately easy opponent for all players,
// though a bit more challenge than a WussyBot.
//------------------------------------------------------------------
//------------------------------------------------------------------
// Constants
//------------------------------------------------------------------
const
#include_ <content\ABLScripts\mwconst.abi>
//------------------------------------------------------------------
// Types
//------------------------------------------------------------------
type
#include_ <content\ABLScripts\mwtype.abi>
//------------------------------------------------------------------
// Variables
//------------------------------------------------------------------
var
static integer attackRange; // At what range do I start shooting?
static integer withdrawRange; // At what range do I withdraw?
static integer bot_activated_timer;
//------------------------------------------------------------------
// Init: my initialization function
//------------------------------------------------------------------
function Init;
code
// script-specific variables
attackRange = 9999;
withdrawRange = 9999;
SetIgnoreFriendlyFire (ME,true);
SetFiringDelay (ME,2.0,6.0);
SetSkillLevel (ME,10,15,0);
SetAttackThrottle (ME,50);
SetIsShotRadius (ME,160);
SetEntropyMood (ME,DEFENSIVE_END);
SetCurMood (ME,DEFENSIVE_END);
EnablePerWeaponRayCasting (ME,TRUE);
bot_activated_timer = gti_Timer_1;
endfunction;
//------------------------------------------------------------------
// StartState: my initial state
//------------------------------------------------------------------
state StartState;
code
StartTimer(bot_activated_timer);
trans CheckTimer;
endstate;
state CheckTimer;
code
//---------------------------------------------
// Time before Bot Wakes up and starts Shooting
//---------------------------------------------
if (TimeGreater(bot_activated_timer,5.0)) then
trans WaitToAmbushState;
endif;
//---------------------------------------------
// Firing upon/near before timer up lets the bot go play
//---------------------------------------------
if (IsShot(ME) == TRUE) then
SetTarget(ME,WhoShot(ME));
trans WaitToAmbushState;
endif;
trans CheckTimer;
endstate;
//------------------------------------------------------------------
// WaitInAmbushState: wait for someone to come close enough to attack
//------------------------------------------------------------------
state WaitToAmbushState;
code
if (Bot_FindEnemy(attackrange)) then
trans AttackState;
endif;
OrderMoveLookOut;
endstate;
//------------------------------------------------------------------
// AttackState: the ambush is over -- let's kick some ass!
//------------------------------------------------------------------
state AttackState;
code
if (LeaveAttackState(withdrawRange)) then
trans WaitToAmbushState;
endif;
OrderAttack(TRUE);
endstate;
//------------------------------------------------------------------
// DeadState: OK, I kicked the bucket.
//------------------------------------------------------------------
state DeadState;
code
orderDie;
endstate;
endfsm.
@@ -0,0 +1,10 @@
0Wussy
1Easy
2RookieDodge
3RookieSniper
4Rookie
5Dodge
6Sniper
7Killer
8Slaughter
9Uber
@@ -0,0 +1,197 @@
//------------------------------------------------------------------
// NOTE: The fsm name below MUST be changed in order for the
// script to be considered a unique entity!
UIFIELDS
{
FIELD< INT,attackRange,"Attack Range",500>; // At what range do I start shooting?
FIELD< INT,withdrawRange,"Withdraw Range",750>; // At what range do I withdraw from combat entirely?
FIELD< INT,path,"Path",-1>; // My path
FIELD< INT,moveType,"Nocycle = 1, Circle = 2, Seesaw = 3",2>; // How I move along the path
FIELD< INT,piloting,"Piloting Skill",50>; // Piloting skill
FIELD< INT,gunnery,"Gunnery Skill",50>; // Gunnery skill/chance to hit
FIELD< FLOAT,minDelay,"Minimum fire Delay",1.0>; // Minimum amount of time I will wait between shots once a weapon is reloaded
FIELD< FLOAT,maxDelay,"Maximum fire Delay",2.0>; // Maximum amount of time I will wait between shots once a weapon is reloaded
FIELD< INT,eliteLevel,"Elite Level",60>; // Elite level. This helps determine tactics, defensive manuevers, opportunity fire
// and other things. It indicates a general level of combat experience.
FIELD< INT,isShotRadius,"Is Shot Radius",120>; // How far away from me will I detect an enemy shot?
FIELD<INT, speed,"Movement Speed",600>;
FIELD<INT, takeOffDistance,"Take Off Distance (ignored if not a plane)",160>;
FIELD<INT, attackThrottle,"Percent throttle when in combat",80>;
FIELD<INT, groupNumber,"What group has this unit been placed in? (in mission script)",11>;
FIELD<INT, formationType,"What formation type? (from ai.formations in content\ai)",1>;
}
fsm Generic_ArmedConvoy : integer;
//------------------------------------------------------------------
// Generic_ArmedConvoy:
// Follows a path but breaks off to attack enemies.
//------------------------------------------------------------------
//------------------------------------------------------------------
// Constants
//------------------------------------------------------------------
const
#include_ <content\ABLScripts\mwconst.abi>
//------------------------------------------------------------------
// Types
//------------------------------------------------------------------
type
#include_ <content\ABLScripts\mwtype.abi>
//------------------------------------------------------------------
// Variables
//------------------------------------------------------------------
var
static integer attackRange; // At what range do I start attacking?
static integer withdrawRange; // At what range do I withdraw from combat?
static integer groupNumber; // What's my group -- i.e. I will use GroupObjectID(groupNumber) to identify my group
static integer speed; // The speed at which I move along the path
static integer formationType; // What kind of formation am I in?
static integer formationDensity; // How densely are we packed?
static integer path; // My path
static integer moveType; // How I move along the path
static integer piloting; // Piloting skill
static integer gunnery; // Gunnery skill/chance to hit
static real minDelay; // Minimum amount of time I will wait between shots once a weapon is reloaded
static real maxDelay; // Maximum amount of time I will wait between shots once a weapon is reloaded
static integer eliteLevel; // Elite level. This helps determine tactics, defensive manuevers, opportunity fire
// and other things. It indicates a general level of combat experience.
static integer attackThrottle; // My attack throttle
static integer isShotRadius; // How far away from me will I detect an enemy shot?
static integer findTypes; // What kind of enemies to look for
static integer attackSound; // The attack sound I play when I first attack
static integer deathSound; // The sound I play when I die
static integer mood; // My default mood.
static integer takeOffDistance; // My take-off distance if I'm an airplane (ignored if not an airplane)
//------------------------------------------------------------------
// Init: my initialization function
//------------------------------------------------------------------
function Init;
code
// Variables set by editor
attackRange = <attackRange>;
withdrawRange = <withdrawRange>;
path = <path>;
moveType = <moveType>;
speed = <speed>;
takeOffDistance = <takeOffDistance>;
piloting = <piloting>;
gunnery = <gunnery>;
minDelay = <minDelay>;
maxDelay = <maxDelay>;
eliteLevel = <eliteLevel>;
isShotRadius = <isShotRadius>;
attackThrottle = <attackThrottle>;
groupNumber = <groupNumber>;
formationType = <formationType>;
formationDensity= formtype_sparse;
// driver settings
attackSound = -1; // no sound
deathSound = -1; // no sound
mood = NEUTRAL_START;
findTypes = FT_DEFAULT;
endfunction;
//------------------------------------------------------------------
// StartState: my initial state
//------------------------------------------------------------------
state StartState;
code
SetFiringDelay (ME,minDelay,maxDelay);
SetIgnoreFriendlyFire (ME,true);
SetIsShotRadius (ME,isShotRadius);
SetEntropyMood (ME,mood);
SetCurMood (ME,mood);
SetSkillLevel (ME,piloting,gunnery,eliteLevel);
SetAttackThrottle (ME,attackThrottle);
if (orderTakeOff(takeOffDistance) == true) then
trans FollowPathState;
endif;
endstate;
//------------------------------------------------------------------
// FollowPathState: follow our path, but keep an eye out for enemies
//------------------------------------------------------------------
state FollowPathState;
code
if (FindEnemy(attackRange,findTypes)) then
trans AttackState;
endif;
if (path <> -1) then
OrderFormationMove((groupobjectid(groupNumber)),path,speed,moveType,formationType,formationDensity,false);
else
OrderMoveLookOut;
endif;
endstate;
//------------------------------------------------------------------
// AttackState: attack my target
//------------------------------------------------------------------
state AttackState;
code
if (LeaveAttackState(withdrawRange)) then
OrderStopAttacking;
SetTarget(ME,NO_UNIT);
trans FollowPathState;
endif;
if (attackSound <> -1) then
PlaySoundOnce(attackSound);
endif;
OrderAttack(true);
endstate;
//------------------------------------------------------------------
// DeadState: OK, I kicked the bucket.
//------------------------------------------------------------------
state DeadState;
code
if (deathSound <> -1) then
PlaySoundOnce(deathSound);
endif;
orderDie;
endstate;
endfsm.
@@ -0,0 +1,199 @@
//------------------------------------------------------------------
// NOTE: The fsm name below MUST be changed in order for the
// script to be considered a unique entity!
UIFIELDS
{
FIELD< INT,attackRange,"Attack Range",500>; // At what range do I start shooting?
FIELD< INT,withdrawRange,"Withdraw Range",750>; // At what range do I withdraw from combat entirely?
FIELD< INT,piloting,"Piloting Skill",50>; // Piloting skill
FIELD< INT,gunnery,"Gunnery Skill",50>; // Gunnery skill/chance to hit
FIELD< FLOAT,minDelay,"Minimum fire Delay",1.0>; // Minimum amount of time I will wait between shots once a weapon is reloaded
FIELD< FLOAT,maxDelay,"Maximum fire Delay",2.0>; // Maximum amount of time I will wait between shots once a weapon is reloaded
FIELD< INT,eliteLevel,"Elite Level",60>; // Elite level. This helps determine tactics, defensive manuevers, opportunity fire
// and other things. It indicates a general level of combat experience.
FIELD< INT,isShotRadius,"Is Shot Radius",120>; // How far away from me will I detect an enemy shot?
FIELD<INT, takeOffDistance,"Take Off Distance (ignored if not a plane)",160>;
FIELD<INT, attackThrottle,"Percent throttle when in combat",80>;
FIELD<INT, groupToAttack,"what group of objects am I attacking?",12>;
}
fsm Generic_AttackList : integer;
//------------------------------------------------------------------
// Generic_AttackList:
// This script can be used to attack (or defend) a series of targets
// contained in a group. The unit will use a specified tactic
// on the first living target in the group, and if that unit is
// destroyed, it will switch to the next one. When there are no
// units left in the group, it will go on a rampage, attacking
// any enemies it can find.
//------------------------------------------------------------------
//------------------------------------------------------------------
// Constants
//------------------------------------------------------------------
const
#include_ <content\ABLScripts\mwconst.abi>
//------------------------------------------------------------------
// Types
//------------------------------------------------------------------
type
#include_ <content\ABLScripts\mwtype.abi>
//------------------------------------------------------------------
// Variables
//------------------------------------------------------------------
var
static integer AttackRange; // When all my targets are destroyed, at what range do I start shooting?
static integer myGroupID; // The ID of my group ... i.e. this script will
// call GroupObjectID(groupID)
static integer tactic; // The tactic to use to attack (or defend) my targets
static integer piloting; // Piloting skill
static integer gunnery; // Gunnery skill/chance to hit
static real minDelay; // Minimum amount of time I will wait between shots once a weapon is reloaded
static real maxDelay; // Maximum amount of time I will wait between shots once a weapon is reloaded
static integer eliteLevel; // Elite level. This helps determine tactics, defensive manuevers, opportunity fire
// and other things. It indicates a general level of combat experience.
static integer attackThrottle; // My attack throttle
static integer isShotRadius; // How far away from me will I detect an enemy shot?
static integer attackSound; // The attack sound I play when I first attack
static integer deathSound; // The sound I play when I die
static integer mood; // My default mood.
static integer takeOffDistance; // My take-off distance if I'm an airplane (ignored if not an airplane)
//------------------------------------------------------------------
// Init: my initialization function
//------------------------------------------------------------------
function Init;
code
// Variables set by editor
attackRange = <attackRange>;
withdrawRange = <withdrawRange>;
takeOffDistance = <takeOffDistance>;
piloting = <piloting>;
gunnery = <gunnery>;
minDelay = <minDelay>;
maxDelay = <maxDelay>;
eliteLevel = <eliteLevel>;
isShotRadius = <isShotRadius>;
attackThrottle = <attackThrottle>;
myGroupID = <groupToAttack>;
tactic = TACTIC_PICK_BEST;
attackSound = -1; // no sound
deathSound = -1; // no sound
mood = NEUTRAL_START;
endfunction;
//------------------------------------------------------------------
// StartState: my initial state
//------------------------------------------------------------------
state StartState;
code
SetFiringDelay (ME,minDelay,maxDelay);
SetIgnoreFriendlyFire (ME,true);
SetIsShotRadius (ME,isShotRadius);
SetEntropyMood (ME,mood);
SetCurMood (ME,mood);
SetSkillLevel (ME,piloting,gunnery,eliteLevel);
SetAttackThrottle (ME,attackThrottle);
if (orderTakeOff(takeOffDistance) == true) then
trans AttackFirstLivingTargetState;
endif;
endstate;
//------------------------------------------------------------------
// AttackFirstLivingTargetState: get the first object in my group, set
// it as my target, and issue the attack order with my tactic
//------------------------------------------------------------------
state AttackFirstLivingTargetState;
var
ObjectID next_target;
code
if (GetTarget(ME) == NO_UNIT) then
next_target = GroupGetFirstObject(GroupObjectID(myGroupID));
if (next_target == NO_UNIT) then
trans RampageState;
endif;
SetTarget(ME,next_target);
endif;
if (attackSound <> -1) then
PlaySoundOnce(attackSound);
endif;
OrderAttackTactic(tactic,TRUE);
endstate;
//------------------------------------------------------------------
// RampageState: no targets remain -- let's kick some ass!
//------------------------------------------------------------------
state RampageState;
code
if (GetTarget(ME) == NO_UNIT) then
FindEnemy(AttackRange,FT_DEFAULT);
endif;
if (GetTarget(ME) <> NO_UNIT) then
if (attackSound <> -1) then
PlaySoundOnce(attackSound);
endif;
OrderAttack(TRUE);
endif;
endstate;
//------------------------------------------------------------------
// DeadState: OK, I kicked the bucket.
//------------------------------------------------------------------
state DeadState;
code
if (deathSound <> -1) then
PlaySoundOnce(deathSound);
endif;
orderDie;
endstate;
endfsm.
@@ -0,0 +1,155 @@
//------------------------------------------------------------------
// NOTE: The fsm name below MUST be changed in order for the
// script to be considered a unique entity!
fsm Generic_Ambush : integer;
//------------------------------------------------------------------
// Generic_Ambush:
// Shuts down, waits until an enemy comes near, and then attacks.
//------------------------------------------------------------------
//------------------------------------------------------------------
// Constants
//------------------------------------------------------------------
const
#include_ <content\ABLScripts\mwconst.abi>
//------------------------------------------------------------------
// Types
//------------------------------------------------------------------
type
#include_ <content\ABLScripts\mwtype.abi>
//------------------------------------------------------------------
// Variables
//------------------------------------------------------------------
var
static integer attackRange; // At what range do I start shooting?
static integer withdrawRange; // At what range do I withdraw from combat entirely?
static integer piloting; // Piloting skill
static integer gunnery; // Gunnery skill/chance to hit
static real minDelay; // Minimum amount of time I will wait between shots once a weapon is reloaded
static real maxDelay; // Maximum amount of time I will wait between shots once a weapon is reloaded
static integer eliteLevel; // Elite level. This helps determine tactics, defensive manuevers, opportunity fire
// and other things. It indicates a general level of combat experience.
static integer attackThrottle; // My attack throttle
static integer isShotRadius; // How far away from me will I detect an enemy shot?
static integer attackSound; // The attack sound I play when I first attack
static integer deathSound; // The sound I play when I die
static integer mood; // My default mood.
static integer takeOffDistance; // My take-off distance if I'm an airplane (ignored if not an airplane)
//------------------------------------------------------------------
// Init: my initialization function
//------------------------------------------------------------------
function Init;
code
// script-specific variables
attackRange = 500;
withdrawRange = 2000;
takeOffDistance = 150;
// driver settings
piloting = 50;
gunnery = 30;
minDelay = 1.5;
maxDelay = 3.0;
eliteLevel = 30;
attackThrottle = 80;
isShotRadius = 120;
attackSound = -1; // no sound
deathSound = -1; // no sound
mood = NEUTRAL_START;
endfunction;
//------------------------------------------------------------------
// StartState: my initial state
//------------------------------------------------------------------
state StartState;
code
SetFiringDelay (ME,minDelay,maxDelay);
SetIgnoreFriendlyFire (ME,true);
SetIsShotRadius (ME,isShotRadius);
SetEntropyMood (ME,mood);
SetCurMood (ME,mood);
SetSkillLevel (ME,piloting,gunnery,eliteLevel);
SetAttackThrottle (ME,attackThrottle);
if (orderTakeOff(takeOffDistance) == true) then
trans WaitToAmbushState;
endif;
endstate;
//------------------------------------------------------------------
// WaitInAmbushState: wait for someone to come close enough to attack
//------------------------------------------------------------------
state WaitToAmbushState;
code
Shutdown(ME);
if (FindEnemy(attackrange,FT_DEFAULT)) then
trans AttackState;
endif;
endstate;
//------------------------------------------------------------------
// AttackState: the ambush is over -- let's kick some ass!
//------------------------------------------------------------------
state AttackState;
code
if (LeaveAttackState(withdrawRange)) then
trans WaitToAmbushState;
endif;
if (attackSound <> -1) then
PlaySoundOnce(attackSound);
endif;
Startup(ME);
OrderAttack(TRUE);
endstate;
//------------------------------------------------------------------
// DeadState: OK, I kicked the bucket.
//------------------------------------------------------------------
state DeadState;
code
if (deathSound <> -1) then
PlaySoundOnce(deathSound);
endif;
orderDie;
endstate;
endfsm.
@@ -0,0 +1,171 @@
//------------------------------------------------------------------
// NOTE: The fsm name below MUST be changed in order for the
// script to be considered a unique entity!
fsm Generic_ArmedConvoy : integer;
//------------------------------------------------------------------
// Generic_ArmedConvoy:
// Follows a path but breaks off to attack enemies.
//------------------------------------------------------------------
//------------------------------------------------------------------
// Constants
//------------------------------------------------------------------
const
#include_ <content\ABLScripts\mwconst.abi>
//------------------------------------------------------------------
// Types
//------------------------------------------------------------------
type
#include_ <content\ABLScripts\mwtype.abi>
//------------------------------------------------------------------
// Variables
//------------------------------------------------------------------
var
static integer attackRange; // At what range do I start attacking?
static integer withdrawRange; // At what range do I withdraw from combat?
static integer groupNumber; // What's my group -- i.e. I will use GroupObjectID(groupNumber) to identify my group
static integer speed; // The speed at which I move along the path
static integer formationType; // What kind of formation am I in?
static integer formationDensity; // How densely are we packed?
static integer path; // My path
static integer moveType; // How I move along the path
static integer piloting; // Piloting skill
static integer gunnery; // Gunnery skill/chance to hit
static real minDelay; // Minimum amount of time I will wait between shots once a weapon is reloaded
static real maxDelay; // Maximum amount of time I will wait between shots once a weapon is reloaded
static integer eliteLevel; // Elite level. This helps determine tactics, defensive manuevers, opportunity fire
// and other things. It indicates a general level of combat experience.
static integer attackThrottle; // My attack throttle
static integer isShotRadius; // How far away from me will I detect an enemy shot?
static integer findTypes; // What kind of enemies to look for
static integer attackSound; // The attack sound I play when I first attack
static integer deathSound; // The sound I play when I die
static integer mood; // My default mood.
static integer takeOffDistance; // My take-off distance if I'm an airplane (ignored if not an airplane)
//------------------------------------------------------------------
// Init: my initialization function
//------------------------------------------------------------------
function Init;
code
// script-specific variables
attackRange = 500;
withdrawRange = attackRange * 3 / 2;
groupNumber = 0;
path = -1;
moveType = move_nocycle;
speed = 50;
formationType = 1;
formationDensity= formtype_sparse;
takeOffDistance = 150;
// driver settings
piloting = 50;
gunnery = 30;
minDelay = 1.5;
maxDelay = 3.0;
eliteLevel = 30;
attackThrottle = 80;
isShotRadius = 120;
attackSound = -1; // no sound
deathSound = -1; // no sound
mood = NEUTRAL_START;
findTypes = FT_DEFAULT;
endfunction;
//------------------------------------------------------------------
// StartState: my initial state
//------------------------------------------------------------------
state StartState;
code
SetFiringDelay (ME,minDelay,maxDelay);
SetIgnoreFriendlyFire (ME,true);
SetIsShotRadius (ME,isShotRadius);
SetEntropyMood (ME,mood);
SetCurMood (ME,mood);
SetSkillLevel (ME,piloting,gunnery,eliteLevel);
SetAttackThrottle (ME,attackThrottle);
if (orderTakeOff(takeOffDistance) == true) then
trans FollowPathState;
endif;
endstate;
//------------------------------------------------------------------
// FollowPathState: follow our path, but keep an eye out for enemies
//------------------------------------------------------------------
state FollowPathState;
code
if (FindEnemy(attackRange,findTypes)) then
trans AttackState;
endif;
if (path <> -1) then
OrderFormationMove((groupobjectid(groupNumber)),path,speed,moveType,formationType,formationDensity,false);
else
OrderMoveLookOut;
endif;
endstate;
//------------------------------------------------------------------
// AttackState: attack my target
//------------------------------------------------------------------
state AttackState;
code
if (LeaveAttackState(withdrawRange)) then
OrderStopAttacking;
SetTarget(ME,NO_UNIT);
trans FollowPathState;
endif;
if (attackSound <> -1) then
PlaySoundOnce(attackSound);
endif;
OrderAttack(true);
endstate;
//------------------------------------------------------------------
// DeadState: OK, I kicked the bucket.
//------------------------------------------------------------------
state DeadState;
code
if (deathSound <> -1) then
PlaySoundOnce(deathSound);
endif;
orderDie;
endstate;
endfsm.
@@ -0,0 +1,179 @@
//------------------------------------------------------------------
// NOTE: The fsm name below MUST be changed in order for the
// script to be considered a unique entity!
fsm Generic_AttackList : integer;
//------------------------------------------------------------------
// Generic_AttackList:
// This script can be used to attack (or defend) a series of targets
// contained in a group. The unit will use a specified tactic
// on the first living target in the group, and if that unit is
// destroyed, it will switch to the next one. When there are no
// units left in the group, it will go on a rampage, attacking
// any enemies it can find.
//------------------------------------------------------------------
//------------------------------------------------------------------
// Constants
//------------------------------------------------------------------
const
#include_ <content\ABLScripts\mwconst.abi>
//------------------------------------------------------------------
// Types
//------------------------------------------------------------------
type
#include_ <content\ABLScripts\mwtype.abi>
//------------------------------------------------------------------
// Variables
//------------------------------------------------------------------
var
static integer rampageAttackRange; // When all my targets are destroyed, at what range do I start shooting?
static integer myGroupID; // The ID of my group ... i.e. this script will
// call GroupObjectID(groupID)
static integer tactic; // The tactic to use to attack (or defend) my targets
static integer piloting; // Piloting skill
static integer gunnery; // Gunnery skill/chance to hit
static real minDelay; // Minimum amount of time I will wait between shots once a weapon is reloaded
static real maxDelay; // Maximum amount of time I will wait between shots once a weapon is reloaded
static integer eliteLevel; // Elite level. This helps determine tactics, defensive manuevers, opportunity fire
// and other things. It indicates a general level of combat experience.
static integer attackThrottle; // My attack throttle
static integer isShotRadius; // How far away from me will I detect an enemy shot?
static integer attackSound; // The attack sound I play when I first attack
static integer deathSound; // The sound I play when I die
static integer mood; // My default mood.
static integer takeOffDistance; // My take-off distance if I'm an airplane (ignored if not an airplane)
//------------------------------------------------------------------
// Init: my initialization function
//------------------------------------------------------------------
function Init;
code
// script-specific variables
rampageAttackRange = 1200;
myGroupID = 0;
tactic = TACTIC_PICK_BEST;
takeOffDistance = 150;
// driver settings
piloting = 50;
gunnery = 30;
minDelay = 1.5;
maxDelay = 3.0;
eliteLevel = 30;
attackThrottle = 80;
isShotRadius = 120;
attackSound = -1; // no sound
deathSound = -1; // no sound
mood = NEUTRAL_START;
endfunction;
//------------------------------------------------------------------
// StartState: my initial state
//------------------------------------------------------------------
state StartState;
code
SetFiringDelay (ME,minDelay,maxDelay);
SetIgnoreFriendlyFire (ME,true);
SetIsShotRadius (ME,isShotRadius);
SetEntropyMood (ME,mood);
SetCurMood (ME,mood);
SetSkillLevel (ME,piloting,gunnery,eliteLevel);
SetAttackThrottle (ME,attackThrottle);
if (orderTakeOff(takeOffDistance) == true) then
trans AttackFirstLivingTargetState;
endif;
endstate;
//------------------------------------------------------------------
// AttackFirstLivingTargetState: get the first object in my group, set
// it as my target, and issue the attack order with my tactic
//------------------------------------------------------------------
state AttackFirstLivingTargetState;
var
ObjectID next_target;
code
if (GetTarget(ME) == NO_UNIT) then
next_target = GroupGetFirstObject(GroupObjectID(myGroupID));
if (next_target == NO_UNIT) then
trans RampageState;
endif;
SetTarget(ME,next_target);
endif;
if (attackSound <> -1) then
PlaySoundOnce(attackSound);
endif;
OrderAttackTactic(tactic,TRUE);
endstate;
//------------------------------------------------------------------
// RampageState: no targets remain -- let's kick some ass!
//------------------------------------------------------------------
state RampageState;
code
if (GetTarget(ME) == NO_UNIT) then
FindEnemy(rampageAttackRange,FT_DEFAULT);
endif;
if (GetTarget(ME) <> NO_UNIT) then
if (attackSound <> -1) then
PlaySoundOnce(attackSound);
endif;
OrderAttack(TRUE);
endif;
endstate;
//------------------------------------------------------------------
// DeadState: OK, I kicked the bucket.
//------------------------------------------------------------------
state DeadState;
code
if (deathSound <> -1) then
PlaySoundOnce(deathSound);
endif;
orderDie;
endstate;
endfsm.
@@ -0,0 +1,253 @@
//------------------------------------------------------------------
// NOTE: The fsm name below MUST be changed in order for the
// script to be considered a unique entity!
fsm Generic_Defend : integer;
//------------------------------------------------------------------
// Generic_Defend:
// Defend a target, staying near it at all times.
// If it is destroyed, just go on a bloody rampage and attack whoever.
//------------------------------------------------------------------
//------------------------------------------------------------------
// Constants
//------------------------------------------------------------------
const
#include_ <content\ABLScripts\mwconst.abi>
//------------------------------------------------------------------
// Types
//------------------------------------------------------------------
type
#include_ <content\ABLScripts\mwtype.abi>
//------------------------------------------------------------------
// Variables
//------------------------------------------------------------------
var
static ObjectID defendTarget1; // First target to defend
static ObjectID defendTarget2; // Second target to defend
static ObjectID defendTarget3; // Third target to defend
static ObjectID defendTarget4; // Fourth target to defend
static ObjectID defendTarget5; // Fifth target to defend
static integer rampageAttackRange; // What is my attack range when my target is destroyed?
static integer piloting; // Piloting skill
static integer gunnery; // Gunnery skill/chance to hit
static real minDelay; // Minimum amount of time I will wait between shots once a weapon is reloaded
static real maxDelay; // Maximum amount of time I will wait between shots once a weapon is reloaded
static integer eliteLevel; // Elite level. This helps determine tactics, defensive manuevers, opportunity fire
// and other things. It indicates a general level of combat experience.
static integer attackThrottle; // My attack throttle
static integer isShotRadius; // How far away from me will I detect an enemy shot?
static integer findTypes; // What kind of enemies to look for
static integer attackSound; // The attack sound I play when I first attack
static integer deathSound; // The sound I play when I die
static integer mood; // My default mood.
static integer takeOffDistance; // My take-off distance if I'm an airplane (ignored if not an airplane)
//------------------------------------------------------------------
// Init: my initialization function
//------------------------------------------------------------------
function Init;
code
// script-specific variables
rampageAttackRange = 1200;
// defendTarget*: Specifies the targets to defend, and the order in which
// to defend them. Fill in as many as appropriate,
// Fill "defendTarget1" first, and proceed from there, in order,
// and fill the rest with NO_UNIT. You must fill in at least the first
// defend target; the others are optional.
defendTarget1 = NO_UNIT;
defendTarget2 = NO_UNIT;
defendTarget3 = NO_UNIT;
defendTarget4 = NO_UNIT;
defendTarget5 = NO_UNIT;
takeOffDistance = 150;
// driver settings
piloting = 50;
gunnery = 30;
minDelay = 1.5;
maxDelay = 3.0;
eliteLevel = 30;
attackThrottle = 80;
isShotRadius = 120;
attackSound = -1; // no sound
deathSound = -1; // no sound
mood = NEUTRAL_START;
findTypes = FT_DEFAULT;
endfunction;
//------------------------------------------------------------------
// StartState: my initial state
//------------------------------------------------------------------
state StartState;
code
SetFiringDelay (ME,minDelay,maxDelay);
SetIgnoreFriendlyFire (ME,true);
SetIsShotRadius (ME,isShotRadius);
SetEntropyMood (ME,mood);
SetCurMood (ME,mood);
SetSkillLevel (ME,piloting,gunnery,eliteLevel);
SetAttackThrottle (ME,attackThrottle);
if (orderTakeOff(takeOffDistance) == true) then
SetTarget(ME,defendTarget1);
trans Defend1State;
endif;
endstate;
//------------------------------------------------------------------
// Defend1State: defend the first target
//------------------------------------------------------------------
state Defend1State;
code
if (GetTarget(ME) == NO_UNIT) then
if (defendTarget2 <> NO_UNIT) then
SetTarget(ME,defendTarget2);
trans Defend2State;
else
trans RampageState;
endif;
endif;
if (attackSound <> -1) then
PlaySoundOnce(attackSound);
endif;
OrderAttackTactic(TACTIC_DEFEND,true);
endstate;
//------------------------------------------------------------------
// Defend2State: defend the second target (if it exists)
//------------------------------------------------------------------
state Defend2State;
code
if (GetTarget(ME) == NO_UNIT) then
if (defendTarget3 <> NO_UNIT) then
SetTarget(ME,defendTarget3);
trans Defend3State;
else
trans RampageState;
endif;
endif;
if (attackSound <> -1) then
PlaySoundOnce(attackSound);
endif;
OrderAttackTactic(TACTIC_DEFEND,true);
endstate;
//------------------------------------------------------------------
// Defend3State: defend the third target (if it exists)
//------------------------------------------------------------------
state Defend3State;
code
if (GetTarget(ME) == NO_UNIT) then
if (defendTarget4 <> NO_UNIT) then
SetTarget(ME,defendTarget4);
trans Defend4State;
else
trans RampageState;
endif;
endif;
if (attackSound <> -1) then
PlaySoundOnce(attackSound);
endif;
OrderAttackTactic(TACTIC_DEFEND,true);
endstate;
//------------------------------------------------------------------
// Defend4State: defend the fourth target (if it exists)
//------------------------------------------------------------------
state Defend4State;
code
if (GetTarget(ME) == NO_UNIT) then
if (defendTarget5 <> NO_UNIT) then
SetTarget(ME,defendTarget5);
trans Defend5State;
else
trans RampageState;
endif;
endif;
if (attackSound <> -1) then
PlaySoundOnce(attackSound);
endif;
OrderAttackTactic(TACTIC_DEFEND,true);
endstate;
//------------------------------------------------------------------
// Defend5State: defend the fifth target (if it exists)
//------------------------------------------------------------------
state Defend5State;
code
if (GetTarget(ME) == NO_UNIT) then
trans RampageState;
endif;
if (attackSound <> -1) then
PlaySoundOnce(attackSound);
endif;
OrderAttackTactic(TACTIC_DEFEND,true);
endstate;
//------------------------------------------------------------------
// RampageState: I will have my revenge, in this life or the next!
//------------------------------------------------------------------
state RampageState;
code
if (FindEnemy(rampageAttackRange,findTypes)) then
if (attackSound <> -1) then
PlaySoundOnce(attackSound);
endif;
OrderAttack(TRUE);
endif;
endstate;
//------------------------------------------------------------------
// DeadState: OK, I kicked the bucket.
//------------------------------------------------------------------
state DeadState;
code
if (deathSound <> -1) then
PlaySoundOnce(deathSound);
endif;
orderDie;
endstate;
endfsm.
@@ -0,0 +1,168 @@
//------------------------------------------------------------------
// NOTE: The fsm name below MUST be changed in order for the
// script to be considered a unique entity!
fsm Generic_Patrol : integer;
//------------------------------------------------------------------
// Generic_Patrol:
// Follows a path. If anything comes near, it goes off and attacks it,
// and then comes back to the path when there's nothing left to attack.
//------------------------------------------------------------------
//------------------------------------------------------------------
// Constants
//------------------------------------------------------------------
const
#include_ <content\ABLScripts\mwconst.abi>
//------------------------------------------------------------------
// Types
//------------------------------------------------------------------
type
#include_ <content\ABLScripts\mwtype.abi>
//------------------------------------------------------------------
// Variables
//------------------------------------------------------------------
var
static integer attackRange; // At what range do I start shooting?
static integer withdrawRange; // At what range do I withdraw from combat entirely?
static integer path; // My path
static integer moveType; // How I move along the path
static boolean canLeavePath; // Can I leave the path if attacked? (TRUE by default)
static integer piloting; // Piloting skill
static integer gunnery; // Gunnery skill/chance to hit
static real minDelay; // Minimum amount of time I will wait between shots once a weapon is reloaded
static real maxDelay; // Maximum amount of time I will wait between shots once a weapon is reloaded
static integer eliteLevel; // Elite level. This helps determine tactics, defensive manuevers, opportunity fire
// and other things. It indicates a general level of combat experience.
static integer attackThrottle; // My attack throttle
static integer isShotRadius; // How far away from me will I detect an enemy shot?
static integer findTypes; // What kind of enemies to look for
static integer attackSound; // The attack sound I play when I first attack
static integer deathSound; // The sound I play when I die
static integer mood; // My default mood.
static integer speed; // The speed at which I move along the path
static integer takeOffDistance; // My take-off distance if I'm an airplane (ignored if not an airplane)
//------------------------------------------------------------------
// Init: my initialization function
//------------------------------------------------------------------
function Init;
code
// script-specific variables
attackRange = 500;
withdrawRange = attackrange * 3 / 2;
path = -1;
moveType = move_circle;
canLeavePath = true;
speed = 600;
takeOffDistance = 150;
// driver settings
piloting = 50;
gunnery = 30;
minDelay = 1.5;
maxDelay = 3.0;
eliteLevel = 30;
attackThrottle = 80;
isShotRadius = 120;
attackSound = -1; // no sound
deathSound = -1; // no sound
mood = NEUTRAL_START;
findTypes = FT_DEFAULT;
endfunction;
//------------------------------------------------------------------
// StartState: my initial state
//------------------------------------------------------------------
state StartState;
code
SetFiringDelay (ME,minDelay,maxDelay);
SetIgnoreFriendlyFire (ME,true);
SetIsShotRadius (ME,isShotRadius);
SetEntropyMood (ME,mood);
SetCurMood (ME,mood);
SetSkillLevel (ME,piloting,gunnery,eliteLevel);
SetAttackThrottle (ME,attackThrottle);
if (orderTakeOff(takeOffDistance) == true) then
trans FollowPathState;
endif;
endstate;
//------------------------------------------------------------------
// FollowPathState: follow our path, but keep an eye out for enemies
//------------------------------------------------------------------
state FollowPathState;
code
if (FindEnemy(attackRange,findTypes)) then
trans AttackState;
endif;
if (path <> -1) then
OrderMoveResumePatrol(path,speed,moveType,true,false);
else
OrderMoveLookOut;
endif;
endstate;
//------------------------------------------------------------------
// AttackState: attack my current target, or return to path if done
//------------------------------------------------------------------
state AttackState;
code
if (LeaveAttackState(withdrawRange)) then
OrderStopAttacking;
SetTarget(ME,NO_UNIT);
trans FollowPathState;
endif;
if (attackSound <> -1) then
PlaySoundOnce(attackSound);
endif;
OrderAttack(canLeavePath);
endstate;
//------------------------------------------------------------------
// DeadState: OK, I kicked the bucket.
//------------------------------------------------------------------
state DeadState;
code
if (deathSound <> -1) then
PlaySoundOnce(deathSound);
endif;
orderDie;
endstate;
endfsm.
@@ -0,0 +1,191 @@
//------------------------------------------------------------------
// NOTE: The fsm name below MUST be changed in order for the
// script to be considered a unique entity!
UIFIELDS
{
FIELD<INT,attackRange,"Attack Range",500>; // At what range do I start shooting?
FIELD< INT,withdrawRange,"Withdraw Range",750>; // At what range do I withdraw from combat entirely?
FIELD< INT,path,"Path",-1>; // My path
FIELD< INT,moveType,"Nocycle = 1, Circle = 2, Seesaw = 3",2>; // How I move along the path
FIELD< INT,piloting,"Piloting Skill",50>; // Piloting skill
FIELD< INT,gunnery,"Gunnery Skill",50>; // Gunnery skill/chance to hit
FIELD< FLOAT,minDelay,"Minimum fire Delay",1.0>; // Minimum amount of time I will wait between shots once a weapon is reloaded
FIELD< FLOAT,maxDelay,"Maximum fire Delay",2.0>; // Maximum amount of time I will wait between shots once a weapon is reloaded
FIELD< INT,eliteLevel,"Elite Level",60>; // Elite level. This helps determine tactics, defensive manuevers, opportunity fire
// and other things. It indicates a general level of combat experience.
FIELD< INT,isShotRadius,"Is Shot Radius",120>; // How far away from me will I detect an enemy shot?
FIELD<INT, speed,"Movement Speed",600>;
FIELD<INT, takeOffDistance,"Take Off Distance (ignored if not a plane)",160>;
}
fsm Generic_Patrol : integer;
//------------------------------------------------------------------
// Generic_Patrol:
// Follows a path. If anything comes near, it goes off and attacks it,
// and then comes back to the path when there's nothing left to attack.
//------------------------------------------------------------------
//------------------------------------------------------------------
// Constants
//------------------------------------------------------------------
const
#include_ <content\ABLScripts\mwconst.abi>
//------------------------------------------------------------------
// Types
//------------------------------------------------------------------
type
#include_ <content\ABLScripts\mwtype.abi>
//------------------------------------------------------------------
// Variables
//------------------------------------------------------------------
var
static integer attackRange; // At what range do I start shooting?
static integer withdrawRange; // At what range do I withdraw from combat entirely?
static integer path; // My path
static integer moveType; // How I move along the path
static boolean canLeavePath; // Can I leave the path if attacked? (TRUE by default)
static integer piloting; // Piloting skill
static integer gunnery; // Gunnery skill/chance to hit
static real minDelay; // Minimum amount of time I will wait between shots once a weapon is reloaded
static real maxDelay; // Maximum amount of time I will wait between shots once a weapon is reloaded
static integer eliteLevel; // Elite level. This helps determine tactics, defensive manuevers, opportunity fire
// and other things. It indicates a general level of combat experience.
static integer attackThrottle; // My attack throttle
static integer isShotRadius; // How far away from me will I detect an enemy shot?
static integer findTypes; // What kind of enemies to look for
static integer attackSound; // The attack sound I play when I first attack
static integer deathSound; // The sound I play when I die
static integer mood; // My default mood.
static integer speed; // The speed at which I move along the path
static integer takeOffDistance; // My take-off distance if I'm an airplane (ignored if not an airplane)
//------------------------------------------------------------------
// Init: my initialization function
//------------------------------------------------------------------
function Init;
code
// script-specific variables
attackRange = <attackrange>;
withdrawRange = <withdrawrange>;
path = <path>;
moveType = <movetype>;
canLeavePath = true;
speed = <speed>;
takeOffDistance = <takeoffdistance>;
// driver settings
piloting = <piloting>;
gunnery = <gunnery>;
minDelay = <mindelay>;
maxDelay = <maxdelay>;
eliteLevel = <elitelevel>;
attackThrottle = 80;
isShotRadius = <isshotradius>;
attackSound = -1; // no sound
deathSound = -1; // no sound
mood = NEUTRAL_START;
findTypes = FT_DEFAULT;
endfunction;
//------------------------------------------------------------------
// StartState: my initial state
//------------------------------------------------------------------
state StartState;
code
SetFiringDelay (ME,minDelay,maxDelay);
SetIgnoreFriendlyFire (ME,true);
SetIsShotRadius (ME,isShotRadius);
SetEntropyMood (ME,mood);
SetCurMood (ME,mood);
SetSkillLevel (ME,piloting,gunnery,eliteLevel);
SetAttackThrottle (ME,attackThrottle);
if (orderTakeOff(takeOffDistance) == true) then
trans FollowPathState;
endif;
endstate;
//------------------------------------------------------------------
// FollowPathState: follow our path, but keep an eye out for enemies
//------------------------------------------------------------------
state FollowPathState;
code
if (FindEnemy(attackRange,findTypes)) then
trans AttackState;
endif;
if (path <> -1) then
OrderMoveResumePatrol(path,speed,moveType,true,false);
else
OrderMoveLookOut;
endif;
endstate;
//------------------------------------------------------------------
// AttackState: attack my current target, or return to path if done
//------------------------------------------------------------------
state AttackState;
code
if (LeaveAttackState(withdrawRange)) then
OrderStopAttacking;
SetTarget(ME,NO_UNIT);
trans FollowPathState;
endif;
if (attackSound <> -1) then
PlaySoundOnce(attackSound);
endif;
OrderAttack(canLeavePath);
endstate;
//------------------------------------------------------------------
// DeadState: OK, I kicked the bucket.
//------------------------------------------------------------------
state DeadState;
code
if (deathSound <> -1) then
PlaySoundOnce(deathSound);
endif;
orderDie;
endstate;
endfsm.
@@ -0,0 +1,219 @@
//------------------------------------------------------------------
// NOTE: The fsm name below MUST be changed in order for the
// script to be considered a unique entity!
fsm Generic_PatrolAlly : integer;
//------------------------------------------------------------------
// Generic_PatrolAlly:
// Follow a path. Move to attack anything that comes within range,
// and return to the path when done.
// Whenever we get within a certain range of a target unit,
// we follow that unit, and continue to attack any enemies.
//------------------------------------------------------------------
//------------------------------------------------------------------
// Constants
//------------------------------------------------------------------
const
#include_ <content\ABLScripts\mwconst.abi>
//------------------------------------------------------------------
// Types
//------------------------------------------------------------------
type
#include_ <content\ABLScripts\mwtype.abi>
//------------------------------------------------------------------
// Variables
//------------------------------------------------------------------
var
static integer attackRange1; // At what range do I start shooting?
static integer withdrawRange1; // At what range do I withdraw from combat completely?
static integer path; // What path do I follow?
static integer moveType; // How I move along the path
static integer speed; // The speed at which I move along the path
static ObjectID whoToJoin; // Who do I want to join?
static integer joinRange; // At what range do I join my leader?
static integer followXOffset; // My follow X offset
static integer followYOffset; // My follow Y offset
static integer attackRange2; // At what range do I start shooting (after joining)?
static integer withdrawRange2; // At what range do I stop shooting (after joining)?
static integer piloting; // Piloting skill
static integer gunnery; // Gunnery skill/chance to hit
static real minDelay; // Minimum amount of time I will wait between shots once a weapon is reloaded
static real maxDelay; // Maximum amount of time I will wait between shots once a weapon is reloaded
static integer eliteLevel; // Elite level. This helps determine tactics, defensive manuevers, opportunity fire
// and other things. It indicates a general level of combat experience.
static integer attackThrottle; // My attack throttle
static integer findTypes; // What kind of enemies to look for
static integer isShotRadius; // How far away from me will I detect an enemy shot?
static integer attackSound; // The attack sound I play when I first attack
static integer deathSound; // The sound I play when I die
static integer mood; // My default mood.
static integer takeOffDistance; // My take-off distance if I'm an airplane (ignored if not an airplane)
//------------------------------------------------------------------
// Init: my initialization function
//------------------------------------------------------------------
function Init;
code
// script-specific variables
attackRange1 = 500;
withdrawRange1 = attackRange1 * 3 / 2;
path = -1;
moveType = move_circle;
speed = 600;
whoToJoin = NO_UNIT;
joinRange = 500;
followXOffset = 0;
followYOffset = 50;
attackRange2 = attackRange1;
withdrawRange2 = attackRange2 * 3 / 2;
takeOffDistance = 150;
// driver settings
piloting = 50;
gunnery = 30;
minDelay = 1.5;
maxDelay = 3.0;
eliteLevel = 30;
attackThrottle = 80;
isShotRadius = 120;
attackSound = -1; // no sound
deathSound = -1; // no sound
mood = NEUTRAL_START;
findTypes = FT_DEFAULT;
endfunction;
//------------------------------------------------------------------
// StartState: my initial state
//------------------------------------------------------------------
state StartState;
code
SetFiringDelay (ME,minDelay,maxDelay);
SetIgnoreFriendlyFire (ME,true);
SetIsShotRadius (ME,isShotRadius);
SetEntropyMood (ME,mood);
SetCurMood (ME,mood);
SetSkillLevel (ME,piloting,gunnery,eliteLevel);
SetAttackThrottle (ME,attackThrottle);
if (orderTakeOff(takeOffDistance) == true) then
trans FollowPathState;
endif;
endstate;
//------------------------------------------------------------------
// FollowPathState: wait for something to shoot
//------------------------------------------------------------------
state FollowPathState;
code
if (IsWithin(ME,whoToJoin,joinRange)) then
trans FollowState;
endif;
if (FindEnemy(attackRange1,findTypes)) then
trans Attack1State;
endif;
if (path <> -1) then
OrderMoveResumePatrol(path,speed,moveType,true,false);
else
OrderMoveLookOut;
endif;
endstate;
//------------------------------------------------------------------
// Attack1State: look for something to shoot
//------------------------------------------------------------------
state Attack1State;
code
if (LeaveAttackState(withdrawRange1)) then
OrderStopAttacking;
SetTarget(ME,NO_UNIT);
trans FollowPathState;
endif;
if (IsWithin(ME,whoToJoin,joinRange)) then
trans Attack2State;
endif;
OrderAttack(true);
endstate;
//------------------------------------------------------------------
// FollowState: follow the chosen unit
//------------------------------------------------------------------
state FollowState;
code
if (FindEnemy(attackRange2,findTypes)) then
trans Attack2State;
endif;
OrderMoveFollow(whoToJoin,followXOffset,followYOffset);
endstate;
//------------------------------------------------------------------
// Attack2State: look for something to shoot
//------------------------------------------------------------------
state Attack2State;
code
if (LeaveAttackState(withdrawRange2)) then
OrderStopAttacking;
SetTarget(ME,NO_UNIT);
trans FollowState;
endif;
OrderAttack(true);
endstate;
//------------------------------------------------------------------
// DeadState: OK, I kicked the bucket.
//------------------------------------------------------------------
state DeadState;
code
if (deathSound <> -1) then
PlaySoundOnce(deathSound);
endif;
orderDie;
endstate;
endfsm.
@@ -0,0 +1,238 @@
//------------------------------------------------------------------
// NOTE: The fsm name below MUST be changed in order for the
// script to be considered a unique entity!
fsm Generic_PatrolRespond : integer;
//------------------------------------------------------------------
// Generic_PatrolRespond:
// Follows a path. If anything comes near, it goes off and attacks it,
// and then comes back to the path when there's nothing left to attack.
// When a specific trigger is set, it goes to another point or path
// and does the same thing.
// I.e. this is the same as Generic_Patrol, except that it
// goes to a second point or path upon firing of a trigger.
//------------------------------------------------------------------
//------------------------------------------------------------------
// Constants
//------------------------------------------------------------------
const
#include_ <content\ABLScripts\mwconst.abi>
//------------------------------------------------------------------
// Types
//------------------------------------------------------------------
type
#include_ <content\ABLScripts\mwtype.abi>
//------------------------------------------------------------------
// Variables
//------------------------------------------------------------------
var
static integer attackRange1; // The range at which I start attacking if in the original patrol
static integer withdrawRange1; // The range at which I withdraw from combat entirely
static integer path1; // My original path
static integer moveType1; // How I move along the path
static boolean canLeavePath1; // Can I leave the path if attacked? (TRUE by default)
static integer speed1; // The speed at which I move along the path
static integer triggerID; // The trigger that will move me from my original patrol state to my new patrol state
static integer attackRange2; // The range at which I start attacking after the trigger has fired
static integer withdrawRange2; // The range at which I withdraw from combat entirely
static integer path2; // My path after the trigger fires
static integer moveType2; // How I move along the second path
static boolean canLeavePath2; // Can I leave the second path if attacked? (TRUE by default)
static integer speed2; // The speed at which I move along the second path
static integer piloting; // Piloting skill
static integer gunnery; // Gunnery skill/chance to hit
static real minDelay; // Minimum amount of time I will wait between shots once a weapon is reloaded
static real maxDelay; // Maximum amount of time I will wait between shots once a weapon is reloaded
static integer eliteLevel; // Elite level. This helps determine tactics, defensive manuevers, opportunity fire
// and other things. It indicates a general level of combat experience.
static integer attackThrottle; // My attack throttle
static integer findTypes; // What kind of enemies to look for
static integer isShotRadius; // How far away from me will I detect an enemy shot?
static integer attackSound; // The attack sound I play when I first attack
static integer deathSound; // The sound I play when I die
static integer mood; // My default mood.
static integer takeOffDistance; // My take-off distance if I'm an airplane (ignored if not an airplane)
//------------------------------------------------------------------
// Init: my initialization function
//------------------------------------------------------------------
function Init;
code
// script-specific variables
attackRange1 = 500;
withdrawRange1 = attackRange1 * 3 / 2;
path1 = -1;
moveType1 = move_circle;
canLeavePath1 = true;
speed1 = 600;
triggerID = 1;
attackRange2 = 500;
withdrawRange2 = attackRange2 * 3 / 2;
path2 = -1;
moveType2 = move_circle;
canLeavePath2 = true;
speed2 = 600;
takeOffDistance = 150;
// driver settings
piloting = 50;
gunnery = 30;
minDelay = 1.5;
maxDelay = 3.0;
eliteLevel = 30;
attackThrottle = 80;
isShotRadius = 120;
attackSound = -1; // no sound
deathSound = -1; // no sound
mood = NEUTRAL_START;
findTypes = FT_DEFAULT;
endfunction;
//------------------------------------------------------------------
// StartState: my initial state
//------------------------------------------------------------------
state StartState;
code
SetFiringDelay (ME,minDelay,maxDelay);
SetIgnoreFriendlyFire (ME,true);
SetIsShotRadius (ME,isShotRadius);
SetEntropyMood (ME,mood);
SetCurMood (ME,mood);
SetSkillLevel (ME,piloting,gunnery,eliteLevel);
SetAttackThrottle (ME,attackThrottle);
if (orderTakeOff(takeOffDistance) == true) then
trans FollowPath1State;
endif;
endstate;
//------------------------------------------------------------------
// FollowPath1State: follow the original path, but keep an eye out for enemies
//------------------------------------------------------------------
state FollowPath1State;
code
if (GetGlobalTrigger(triggerID)) then
trans FollowPath2State;
endif;
if (FindEnemy(attackRange1,findTypes)) then
trans Attack1State;
endif;
if (path1 <> -1) then
OrderMoveResumePatrol(path1,speed1,moveType1,true,false);
else
OrderMoveLookOut;
endif;
endstate;
//------------------------------------------------------------------
// Attack1State: attack my current target, or return to original path if done
//------------------------------------------------------------------
state Attack1State;
code
if (GetGlobalTrigger(triggerID)) then
trans Attack2State;
endif;
if (LeaveAttackState(withdrawRange1)) then
OrderStopAttacking;
SetTarget(ME,NO_UNIT);
trans FollowPath1State;
endif;
if (attackSound <> -1) then
PlaySoundOnce(attackSound);
endif;
OrderAttack(canLeavePath1);
endstate;
//------------------------------------------------------------------
// FollowPath2State: follow the second path, but keep an eye out for enemies
//------------------------------------------------------------------
state FollowPath2State;
code
if (FindEnemy(attackRange2,findTypes)) then
trans Attack2State;
endif;
if (path2 <> -1) then
OrderMoveResumePatrol(path2,speed2,moveType2,true,false);
else
OrderMoveLookOut;
endif;
endstate;
//------------------------------------------------------------------
// Attack2State: attack my current target, or return to second path if done
//------------------------------------------------------------------
state Attack2State;
code
if (LeaveAttackState(withdrawRange2)) then
OrderStopAttacking;
SetTarget(ME,NO_UNIT);
trans FollowPath2State;
endif;
if (attackSound <> -1) then
PlaySoundOnce(attackSound);
endif;
OrderAttack(canLeavePath2);
endstate;
//------------------------------------------------------------------
// DeadState: OK, I kicked the bucket.
//------------------------------------------------------------------
state DeadState;
code
if (deathSound <> -1) then
PlaySoundOnce(deathSound);
endif;
orderDie;
endstate;
endfsm.
@@ -0,0 +1,207 @@
//------------------------------------------------------------------
// NOTE: The fsm name below MUST be changed in order for the
// script to be considered a unique entity!
fsm Generic_Reinforcement : integer;
//------------------------------------------------------------------
// Generic_Reinforcement:
// Shuts down, waits until a trigger, powers up, moves to a specific
// point (if specified) and attacks anything that comes near
//------------------------------------------------------------------
//------------------------------------------------------------------
// Constants
//------------------------------------------------------------------
const
#include_ <content\ABLScripts\mwconst.abi>
//------------------------------------------------------------------
// Types
//------------------------------------------------------------------
type
#include_ <content\ABLScripts\mwtype.abi>
//------------------------------------------------------------------
// Variables
//------------------------------------------------------------------
var
static integer attackRange1; // At what range do I start shooting (as I'm moving to the point)?
static integer attackRange2; // At what range do I start shooting (as a reinforcement)?
static integer withdrawRange; // At what range do I stop shooting (as a reinforcement)?
static integer triggerID; // The index of my global trigger
static LocPoint destination; // The destination to move to when ready
static integer piloting; // Piloting skill
static integer gunnery; // Gunnery skill/chance to hit
static real minDelay; // Minimum amount of time I will wait between shots once a weapon is reloaded
static real maxDelay; // Maximum amount of time I will wait between shots once a weapon is reloaded
static integer speed; // What speed so I move at?
static integer elitelevel; // Elite level. This helps determine tactics, defensive manuevers, opportunity fire
// and other things. It indicates a general level of combat experience.
static integer attackThrottle; // My attack throttle
static integer findTypes; // What kind of enemies to look for
static integer isshotradius; // How far away from me will I detect an enemy shot?
static integer attackSound; // The attack sound I play when I first attack
static integer deathSound; // The sound I play when I die
static integer mood; // My default mood.
static integer takeOffDistance; // My take-off distance if I'm an airplane (ignored if not an airplane)
//------------------------------------------------------------------
// Init: my initialization function
//------------------------------------------------------------------
function Init;
code
// script-specific variables
attackRange1 = 500;
attackRange2 = 500;
withdrawRange = attackRange2 * 3 / 2;
triggerID = 1;
destination[0] = -1;
destination[1] = -1;
destination[2] = -1;
takeOffDistance = 150;
// driver settings
piloting = 50;
gunnery = 30;
minDelay = 1.5;
maxDelay = 3.0;
elitelevel = 30;
attackThrottle = 80;
speed = 600;
isshotradius = 80;
attackSound = -1; // no sound
deathSound = -1; // no sound
mood = NEUTRAL_START;
findTypes = FT_DEFAULT;
endfunction;
//------------------------------------------------------------------
// StartState: my initial state
//------------------------------------------------------------------
state StartState;
code
SetFiringDelay (ME,minDelay,maxDelay);
SetIgnoreFriendlyFire (ME,true);
SetIsShotRadius (ME,isshotradius);
SetEntropyMood (ME,mood);
SetCurMood (ME,mood);
SetSkillLevel (ME,piloting,gunnery,elitelevel);
SetAttackThrottle (ME,attackThrottle);
trans ShutdownAndWaitState;
endstate;
//------------------------------------------------------------------
// ShutdownAndWaitState: shut down and wait for the trigger to be set, then go
//------------------------------------------------------------------
state ShutdownAndWaitState;
code
Shutdown(ME);
if (GetGlobalTrigger(triggerID)) then
if (orderTakeOff(takeOffDistance) == true) then
Startup(ME);
if ((destination[0] == -1) and (destination[1] == -1) and (destination[2] == -1)) then
trans AttackState;
endif;
trans MoveToPointState;
endif;
endif;
endstate;
//------------------------------------------------------------------
// MoveToPointState: go to the destination, and attack when we get there
//------------------------------------------------------------------
state MoveToPointState;
code
if (OrderMoveToLocPoint(destination,speed,true,true)) then
orderstopattacking;
SetTarget(ME,NO_UNIT);
trans WaitAtPointState;
else
if (FindEnemy(attackRange1,findTypes)) then
if (attackSound <> -1) then
PlaySoundOnce(attackSound);
endif;
OrderAttack(false);
endif;
endif;
endstate;
//------------------------------------------------------------------
// WaitAtPointState: I got to the point; let's look around
//------------------------------------------------------------------
state WaitAtPointState;
code
if (FindEnemy(attackRange2,findTypes)) then
trans AttackState;
endif;
endstate;
//------------------------------------------------------------------
// AttackState: let's find someone and hurt them
//------------------------------------------------------------------
state AttackState;
code
if (LeaveAttackState(withdrawRange)) then
OrderStopAttacking;
SetTarget(ME,NO_UNIT);
trans MoveToPointState;
endif;
if (attackSound <> -1) then
PlaySoundOnce(attackSound);
endif;
OrderAttack(TRUE);
endstate;
//------------------------------------------------------------------
// DeadState: OK, I kicked the bucket.
//------------------------------------------------------------------
state DeadState;
code
if (deathSound <> -1) then
PlaySoundOnce(deathSound);
endif;
orderDie;
endstate;
endfsm.
@@ -0,0 +1,151 @@
//------------------------------------------------------------------
// NOTE: The fsm name below MUST be changed in order for the
// script to be considered a unique entity!
fsm Generic_Sentry : integer;
//------------------------------------------------------------------
// Generic_Sentry:
// Stands still. Moves to attack anything that comes near.
//
//------------------------------------------------------------------
//------------------------------------------------------------------
// Constants
//------------------------------------------------------------------
const
#include_ <content\ABLScripts\mwconst.abi>
//------------------------------------------------------------------
// Types
//------------------------------------------------------------------
type
#include_ <content\ABLScripts\mwtype.abi>
//------------------------------------------------------------------
// Variables
//------------------------------------------------------------------
var
static integer attackRange; // At what range do I start shooting?
static integer withdrawRange; // At what range do I withdraw from combat completely?
static integer piloting; // Piloting skill
static integer gunnery; // Gunnery skill/chance to hit
static real minDelay; // Minimum amount of time I will wait between shots once a weapon is reloaded
static real maxDelay; // Maximum amount of time I will wait between shots once a weapon is reloaded
static integer eliteLevel; // Elite level. This helps determine tactics, defensive manuevers, opportunity fire
// and other things. It indicates a general level of combat experience.
static integer attackThrottle; // My attack throttle
static integer findTypes; // What kind of enemies to look for
static integer isShotRadius; // How far away from me will I detect an enemy shot?
static integer attackSound; // The attack sound I play when I first attack
static integer deathSound; // The sound I play when I die
static integer mood; // My default mood.
static integer takeOffDistance; // My take-off distance if I'm an airplane (ignored if not an airplane)
//------------------------------------------------------------------
// Init: my initialization function
//------------------------------------------------------------------
function Init;
code
// script-specific variables
attackRange = 500;
withdrawRange = attackRange * 3 / 2;
takeOffDistance = 150;
// driver settings
piloting = 50;
gunnery = 30;
minDelay = 1.5;
maxDelay = 3.0;
eliteLevel = 30;
attackThrottle = 80;
isShotRadius = 120;
attackSound = -1; // no sound
deathSound = -1; // no sound
mood = NEUTRAL_START;
findTypes = FT_DEFAULT;
endfunction;
//------------------------------------------------------------------
// StartState: my initial state
//------------------------------------------------------------------
state StartState;
code
SetFiringDelay (ME,minDelay,maxDelay);
SetIgnoreFriendlyFire (ME,true);
SetIsShotRadius (ME,isShotRadius);
SetEntropyMood (ME,mood);
SetCurMood (ME,mood);
SetSkillLevel (ME,piloting,gunnery,eliteLevel);
SetAttackThrottle (ME,attackThrottle);
if (orderTakeOff(takeOffDistance) == true) then
trans WaitState;
endif;
endstate;
//------------------------------------------------------------------
// WaitState: wait for something to shoot
//------------------------------------------------------------------
state WaitState;
code
OrderMoveLookOut;
if (FindEnemy(attackRange,findTypes)) then
trans AttackState;
endif;
endstate;
//------------------------------------------------------------------
// AttackState: look for something to shoot
//------------------------------------------------------------------
state AttackState;
code
if (LeaveAttackState(withdrawRange)) then
OrderStopAttacking;
SetTarget(ME,NO_UNIT);
trans WaitState;
endif;
OrderAttack(true);
endstate;
//------------------------------------------------------------------
// DeadState: OK, I kicked the bucket.
//------------------------------------------------------------------
state DeadState;
code
if (deathSound <> -1) then
PlaySoundOnce(deathSound);
endif;
orderDie;
endstate;
endfsm.
@@ -0,0 +1,208 @@
//------------------------------------------------------------------
// NOTE: The fsm name below MUST be changed in order for the
// script to be considered a unique entity!
fsm Generic_SentryAlly : integer;
//------------------------------------------------------------------
// Generic_SentryAlly:
// Stands still. Move to attack anything that comes within range.
// Whenever we get within a certain range of a target unit,
// we follow that unit, and continue to attack any enemies.
//------------------------------------------------------------------
//------------------------------------------------------------------
// Constants
//------------------------------------------------------------------
const
#include_ <content\ABLScripts\mwconst.abi>
//------------------------------------------------------------------
// Types
//------------------------------------------------------------------
type
#include_ <content\ABLScripts\mwtype.abi>
//------------------------------------------------------------------
// Variables
//------------------------------------------------------------------
var
static integer attackRange1; // At what range do I start shooting?
static integer withdrawRange1; // At what range do I withdraw from combat completely?
static ObjectID whoToJoin; // Who do I want to join?
static integer joinRange; // At what range do I join my leader?
static integer followXOffset; // My follow X offset
static integer followYOffset; // My follow Y offset
static integer attackRange2; // At what range do I start shooting (after joining)?
static integer withdrawRange2; // At what range do I stop shooting (after joining)?
static integer piloting; // Piloting skill
static integer gunnery; // Gunnery skill/chance to hit
static real minDelay; // Minimum amount of time I will wait between shots once a weapon is reloaded
static real maxDelay; // Maximum amount of time I will wait between shots once a weapon is reloaded
static integer eliteLevel; // Elite level. This helps determine tactics, defensive manuevers, opportunity fire
// and other things. It indicates a general level of combat experience.
static integer attackThrottle; // My attack throttle
static integer findTypes; // What kind of enemies to look for
static integer isShotRadius; // How far away from me will I detect an enemy shot?
static integer attackSound; // The attack sound I play when I first attack
static integer deathSound; // The sound I play when I die
static integer mood; // My default mood.
static integer takeOffDistance; // My take-off distance if I'm an airplane (ignored if not an airplane)
//------------------------------------------------------------------
// Init: my initialization function
//------------------------------------------------------------------
function Init;
code
// script-specific variables
attackRange1 = 500;
withdrawRange1 = attackRange1 * 3 / 2;
whoToJoin = NO_UNIT;
joinRange = 500;
followXOffset = 0;
followYOffset = 50;
attackRange2 = attackRange1;
withdrawRange2 = attackRange2 * 3 / 2;
takeOffDistance = 150;
// driver settings
piloting = 50;
gunnery = 30;
minDelay = 1.5;
maxDelay = 3.0;
eliteLevel = 30;
attackThrottle = 80;
isShotRadius = 120;
attackSound = -1; // no sound
deathSound = -1; // no sound
mood = NEUTRAL_START;
findTypes = FT_DEFAULT;
endfunction;
//------------------------------------------------------------------
// StartState: my initial state
//------------------------------------------------------------------
state StartState;
code
SetFiringDelay (ME,minDelay,maxDelay);
SetIgnoreFriendlyFire (ME,true);
SetIsShotRadius (ME,isShotRadius);
SetEntropyMood (ME,mood);
SetCurMood (ME,mood);
SetSkillLevel (ME,piloting,gunnery,eliteLevel);
SetAttackThrottle (ME,attackThrottle);
if (orderTakeOff(takeOffDistance) == true) then
trans Wait1State;
endif;
endstate;
//------------------------------------------------------------------
// Wait1State: wait for something to shoot
//------------------------------------------------------------------
state Wait1State;
code
OrderMoveLookOut;
if (IsWithin(ME,whoToJoin,joinRange)) then
trans FollowState;
endif;
if (FindEnemy(attackRange1,findTypes)) then
trans Attack1State;
endif;
endstate;
//------------------------------------------------------------------
// Attack1State: look for something to shoot
//------------------------------------------------------------------
state Attack1State;
code
if (LeaveAttackState(withdrawRange1)) then
OrderStopAttacking;
SetTarget(ME,NO_UNIT);
trans Wait1State;
endif;
if (IsWithin(ME,whoToJoin,joinRange)) then
trans Attack2State;
endif;
OrderAttack(true);
endstate;
//------------------------------------------------------------------
// FollowState: follow the chosen unit
//------------------------------------------------------------------
state FollowState;
code
if (FindEnemy(attackRange2,findTypes)) then
trans Attack2State;
endif;
OrderMoveFollow(whoToJoin,followXOffset,followYOffset);
endstate;
//------------------------------------------------------------------
// Attack2State: look for something to shoot
//------------------------------------------------------------------
state Attack2State;
code
if (LeaveAttackState(withdrawRange2)) then
OrderStopAttacking;
SetTarget(ME,NO_UNIT);
trans FollowState;
endif;
OrderAttack(true);
endstate;
//------------------------------------------------------------------
// DeadState: OK, I kicked the bucket.
//------------------------------------------------------------------
state DeadState;
code
if (deathSound <> -1) then
PlaySoundOnce(deathSound);
endif;
orderDie;
endstate;
endfsm.
@@ -0,0 +1,210 @@
//------------------------------------------------------------------
// NOTE: The fsm name below MUST be changed in order for the
// script to be considered a unique entity!
fsm Generic_SentryReinforcement : integer;
//------------------------------------------------------------------
// Generic_SentryReinforcement:
// Performs sentry, attacking anything that comes near.
// Once a trigger is set, goes to a predefined point and
// attacks anything within range at that point.
//------------------------------------------------------------------
//------------------------------------------------------------------
// Constants
//------------------------------------------------------------------
const
#include_ <content\ABLScripts\mwconst.abi>
//------------------------------------------------------------------
// Types
//------------------------------------------------------------------
type
#include_ <content\ABLScripts\mwtype.abi>
//------------------------------------------------------------------
// Variables
//------------------------------------------------------------------
var
static integer attackRange1; // At what range do I start shooting when I'm attacking?
static integer withdrawRange1; // At what range do I give up?
static integer attackRange2; // At what range do I start shooting (as a reinforcement)?
static integer withdrawRange2; // At what range do I stop shooting (as a reinforcement)?
static integer triggerID; // The index of my global trigger
static LocPoint destination; // The destination to move to when ready
static integer piloting; // Piloting skill
static integer gunnery; // Gunnery skill/chance to hit
static real minDelay; // Minimum amount of time I will wait between shots once a weapon is reloaded
static real maxDelay; // Maximum amount of time I will wait between shots once a weapon is reloaded
static integer speed; // What speed so I move at?
static integer elitelevel; // Elite level. This helps determine tactics, defensive manuevers, opportunity fire
// and other things. It indicates a general level of combat experience.
static integer attackThrottle; // My attack throttle
static integer findTypes; // What kind of enemies to look for
static integer isshotradius; // How far away from me will I detect an enemy shot?
static integer attackSound; // The attack sound I play when I first attack
static integer deathSound; // The sound I play when I die
static integer mood; // My default mood.
static integer takeOffDistance; // My take-off distance if I'm an airplane (ignored if not an airplane)
//------------------------------------------------------------------
// Init: my initialization function
//------------------------------------------------------------------
function Init;
code
// script-specific variables
attackRange1 = 500;
withdrawRange1 = attackRange1 * 3 / 2;
attackRange2 = 500;
withdrawRange2 = attackRange2 * 3 / 2;
triggerID = 1;
destination[0] = -1;
destination[1] = -1;
destination[2] = -1;
takeOffDistance = 150;
// driver settings
piloting = 50;
gunnery = 30;
minDelay = 1.5;
maxDelay = 3.0;
elitelevel = 30;
attackThrottle = 80;
speed = 600;
isshotradius = 80;
attackSound = -1; // no sound
deathSound = -1; // no sound
mood = NEUTRAL_START;
findTypes = FT_DEFAULT;
endfunction;
//------------------------------------------------------------------
// StartState: my initial state
//------------------------------------------------------------------
state StartState;
code
SetFiringDelay (ME,minDelay,maxDelay);
SetIgnoreFriendlyFire (ME,true);
SetIsShotRadius (ME,isShotRadius);
SetEntropyMood (ME,mood);
SetCurMood (ME,mood);
SetSkillLevel (ME,piloting,gunnery,eliteLevel);
SetAttackThrottle (ME,attackThrottle);
if (orderTakeOff(takeOffDistance) == true) then
trans WaitState;
endif;
endstate;
//------------------------------------------------------------------
// WaitState: wait something to happen (my original state)
//------------------------------------------------------------------
state WaitState;
code
if (GetGlobalTrigger(triggerID)) then
trans MoveToPointState;
endif;
if (FindEnemy(attackRange1,findTypes)) then
trans Attack1State;
endif;
OrderMoveLookOut;
endstate;
//------------------------------------------------------------------
// Attack1State: attack someone (before I'm called as a reinforcement)
//------------------------------------------------------------------
state Attack1State;
code
if (LeaveAttackState(withdrawRange1)) then
trans WaitState;
endif;
if (GetGlobalTrigger(triggerID)) then
trans Attack2State;
endif;
if (attackSound <> -1) then
PlaySoundOnce(attackSound);
endif;
OrderAttack(TRUE);
endstate;
//------------------------------------------------------------------
// MoveToPointState: go to the destination, and attack when we get there
//------------------------------------------------------------------
state MoveToPointState;
code
if (OrderMoveToLocPoint(destination,speed,true,true)) then
OrderStopAttacking;
if (FindEnemy(attackRange2,findTypes)) then
trans Attack2State;
endif;
endif;
endstate;
//------------------------------------------------------------------
// Attack2State: attack a target (after I'm called as a reinforcement)
//------------------------------------------------------------------
state Attack2State;
code
if (LeaveAttackState(withdrawRange2)) then
trans MoveToPointState;
endif;
if (attackSound <> -1) then
PlaySoundOnce(attackSound);
endif;
OrderAttack(TRUE);
endstate;
//------------------------------------------------------------------
// DeadState: OK, I kicked the bucket.
//------------------------------------------------------------------
state DeadState;
code
if (deathSound <> -1) then
PlaySoundOnce(deathSound);
endif;
orderDie;
endstate;
endfsm.
@@ -0,0 +1,168 @@
//------------------------------------------------------------------
// NOTE: The fsm name below MUST be changed in order for the
// script to be considered a unique entity!
fsm Generic_SentryReturn : integer;
//------------------------------------------------------------------
// Generic_SentryReturn:
// Stands still. Moves to attack anything that comes near.
// It will go as far as necessary, but when it runs out of enemies,
// it returns to its original position.
//------------------------------------------------------------------
//------------------------------------------------------------------
// Constants
//------------------------------------------------------------------
const
#include_ <content\ABLScripts\mwconst.abi>
//------------------------------------------------------------------
// Types
//------------------------------------------------------------------
type
#include_ <content\ABLScripts\mwtype.abi>
//------------------------------------------------------------------
// Variables
//------------------------------------------------------------------
var
static integer attackRange; // At what range do I start shooting?
static integer withdrawRange; // At what range do I withdraw from combat completely?
static integer speed; // My movement speed
static integer piloting; // Piloting skill
static integer gunnery; // Gunnery skill/chance to hit
static real minDelay; // Minimum amount of time I will wait between shots once a weapon is reloaded
static real maxDelay; // Maximum amount of time I will wait between shots once a weapon is reloaded
static integer eliteLevel; // Elite level. This helps determine tactics, defensive manuevers, opportunity fire
// and other things. It indicates a general level of combat experience.
static integer attackThrottle; // My attack throttle
static integer isShotRadius; // How far away from me will I detect an enemy shot?
static integer attackSound; // The attack sound I play when I first attack
static integer deathSound; // The sound I play when I die
static integer mood; // My default mood
static LocPoint originalPosition; // My original position
static integer takeOffDistance; // My take-off distance if I'm an airplane (ignored if not an airplane)
//------------------------------------------------------------------
// Init: my initialization function
//------------------------------------------------------------------
function Init;
code
// script-specific variables
attackRange = 500;
withdrawRange = attackRange * 2 / 3;
speed = 600;
takeOffDistance = 150;
// driver settings
piloting = 50;
gunnery = 30;
minDelay = 1.5;
maxDelay = 3.0;
eliteLevel = 30;
attackThrottle = 80;
isShotRadius = 120;
attackSound = -1; // no sound
deathSound = -1; // no sound
mood = NEUTRAL_START;
endfunction;
//------------------------------------------------------------------
// StartState: my initial state
//------------------------------------------------------------------
state StartState;
code
SetFiringDelay (ME,minDelay,maxDelay);
SetIgnoreFriendlyFire (ME,true);
SetIsShotRadius (ME,isShotRadius);
SetEntropyMood (ME,mood);
SetCurMood (ME,mood);
SetSkillLevel (ME,piloting,gunnery,eliteLevel);
SetAttackThrottle (ME,attackThrottle);
if (orderTakeOff(takeOffDistance) == true) then
GetLocation(ME,originalPosition);
trans WaitState;
endif;
endstate;
//------------------------------------------------------------------
// WaitState: wait for a target to approach
//------------------------------------------------------------------
state WaitState;
code
if (FindEnemy(attackRange,FT_DEFAULT)) then
trans AttackState;
endif;
if (IsWithinLocPoint(ME,originalPosition,20)) then
OrderMoveLookOut;
else
OrderMoveToLocPoint(originalPosition,speed,true,false);
endif;
endState;
//------------------------------------------------------------------
// AttackState: look for something to shoot
//------------------------------------------------------------------
state AttackState;
code
if (LeaveAttackState(withdrawRange)) then
OrderStopAttacking;
SetTarget(ME,NO_UNIT);
trans WaitState;
endif;
if (attackSound <> -1) then
PlaySoundOnce(attackSound);
endif;
OrderAttack(true);
endstate;
//------------------------------------------------------------------
// DeadState: OK, I kicked the bucket.
//------------------------------------------------------------------
state DeadState;
code
if (deathSound <> -1) then
PlaySoundOnce(deathSound);
endif;
orderDie;
endstate;
endfsm.
@@ -0,0 +1,185 @@
//------------------------------------------------------------------
// NOTE: The fsm name below MUST be changed in order for the
// script to be considered a unique entity!
fsm Generic_Turret : integer;
//------------------------------------------------------------------
// Generic_Turret:
// This shoots anything that comes near, but never moves.
// It can be used for turrets.
//------------------------------------------------------------------
//------------------------------------------------------------------
// Constants
//------------------------------------------------------------------
const
#include_ <content\ABLScripts\mwconst.abi>
//------------------------------------------------------------------
// Types
//------------------------------------------------------------------
type
#include_ <content\ABLScripts\mwtype.abi>
//------------------------------------------------------------------
// Variables
//------------------------------------------------------------------
var
static integer attackRange; // At what range do I start shooting?
static integer withdrawRange; // At what range do I stop attacking?
static ObjectID turretTower; // My control tower: if destroyed, I stop firing
static integer piloting; // Piloting skill
static integer gunnery; // Gunnery skill/chance to hit
static real minDelay; // Minimum amount of time I will wait between shots once a weapon is reloaded
static real maxDelay; // Maximum amount of time I will wait between shots once a weapon is reloaded
static integer eliteLevel; // Elite level. This helps determine tactics, defensive manuevers, opportunity fire
// and other things. It indicates a general level of combat experience.
static integer isShotRadius; // How far away from me will I detect an enemy shot?
static integer findTypes; // What kind of enemies to look for
static integer attackSound; // The attack sound I play when I first attack
static integer deathSound; // The sound I play when I die
static integer mood; // My default mood.
static integer takeOffDistance; // My take-off distance if I'm an airplane (ignored if not an airplane)
//------------------------------------------------------------------
// Init: my initialization function
//------------------------------------------------------------------
function Init;
code
// script-specific variables
attackRange = 500;
withdrawRange = attackRange * 3 / 2;
turretTower = NO_UNIT;
takeOffDistance = 150;
// driver settings
piloting = 50;
gunnery = 30;
minDelay = 1.5;
maxDelay = 3.0;
eliteLevel = 30;
isShotRadius = 120;
attackSound = -1; // no sound
deathSound = -1; // no sound
mood = NEUTRAL_START;
findTypes = FT_DEFAULT;
endfunction;
//------------------------------------------------------------------
// StartState: my initial state
//------------------------------------------------------------------
state StartState;
code
SetFiringDelay (ME,minDelay,maxDelay);
SetIgnoreFriendlyFire (ME,true);
SetIsShotRadius (ME,isshotradius);
SetEntropyMood (ME,mood);
SetCurMood (ME,mood);
SetSkillLevel (ME,piloting,gunnery,elitelevel);
if (orderTakeOff(takeOffDistance) == true) then
trans WaitState;
endif;
endstate;
//------------------------------------------------------------------
// WaitState: wait for someone to come near
//------------------------------------------------------------------
state WaitState;
code
if (FindEnemy(attackRange,findTypes)) then
trans AttackState;
endif;
if (turretTower <> NO_UNIT) then
if (IsDead(turretTower) == true) then
trans TowerGoneState;
endif;
endif;
SetSensorVisibility(ME,FALSE);
OrderMoveLookOut;
endstate;
//------------------------------------------------------------------
// AttackState: let's see what's around, and destroy it
//------------------------------------------------------------------
state AttackState;
code
if (LeaveAttackState(withdrawRange)) then
OrderStopAttacking;
SetTarget(ME,NO_UNIT);
trans WaitState;
endif;
if (turretTower <> NO_UNIT) then
if (IsDead(turretTower) == true) then
trans TowerGoneState;
endif;
endif;
if (attackSound <> -1) then
PlaySoundOnce(attackSound);
endif;
SetSensorVisibility(ME,TRUE);
OrderAttackTactic(TACTIC_SHOOT_ONLY,true);
endstate;
//------------------------------------------------------------------
// TowerGoneState: my control tower is destroyed; I can do nothing
//------------------------------------------------------------------
state TowerGoneState;
code
SetTarget(ME,NO_UNIT);
OrderStopAttacking;
ClearMoveOrder(ME);
SetTargetDesirability(ME,-1);
SetSensorVisibility(ME,FALSE);
endstate;
//------------------------------------------------------------------
// DeadState: OK, I kicked the bucket.
//------------------------------------------------------------------
state DeadState;
code
if (deathSound <> -1) then
PlaySoundOnce(deathSound);
endif;
orderDie;
endstate;
endfsm.
@@ -0,0 +1,174 @@
//------------------------------------------------------------------
// NOTE: The fsm name below MUST be changed in order for the
// script to be considered a unique entity!
fsm Generic_UnarmedConvoy : integer;
//------------------------------------------------------------------
// Generic_UnarmedConvoy:
// Follows a path and but breaks off to run from enemies.
// NOTE: this script requires a CombatAI (or MechAI) to work properly!!!
//------------------------------------------------------------------
//------------------------------------------------------------------
// Constants
//------------------------------------------------------------------
const
#include_ <content\ABLScripts\mwconst.abi>
//------------------------------------------------------------------
// Types
//------------------------------------------------------------------
type
#include_ <content\ABLScripts\mwtype.abi>
//------------------------------------------------------------------
// Variables
//------------------------------------------------------------------
var
static integer fleeRange; // At what range do I start running?
static integer withdrawRange; // After I've started to flee, at what range can I forget about my enemy and return to the convoy?
static integer groupNumber; // What's my group -- i.e. I will use GroupObjectID(groupNumber) to identify my group
static integer speed; // The speed at which I move along the path
static integer formationType; // What kind of formation am I in?
static integer formationDensity; // How densely are we packed?
static integer path; // My path
static integer moveType; // How I move along the path
static integer fleeSpeed; // How fast I flee
static integer piloting; // Piloting skill
static integer gunnery; // Gunnery skill/chance to hit
static real minDelay; // Minimum amount of time I will wait between shots once a weapon is reloaded
static real maxDelay; // Maximum amount of time I will wait between shots once a weapon is reloaded
static integer eliteLevel; // Elite level. This helps determine tactics, defensive manuevers, opportunity fire
// and other things. It indicates a general level of combat experience.
static integer attackThrottle; // My attack throttle
static integer isShotRadius; // How far away from me will I detect an enemy shot?
static integer attackSound; // The attack sound I play when I first attack
static integer deathSound; // The sound I play when I die
static integer mood; // My default mood.
static integer takeOffDistance; // My take-off distance if I'm an airplane (ignored if not an airplane)
//------------------------------------------------------------------
// Init: my initialization function
//------------------------------------------------------------------
function Init;
code
// script-specific variables
fleeRange = 500;
withdrawRange = fleeRange * 3 / 2;
groupNumber = 0;
path = -1;
moveType = move_nocycle;
speed = 50;
formationType = 1;
formationDensity= formtype_sparse;
fleeSpeed = 600;
takeOffDistance = 150;
// driver settings
piloting = 50;
gunnery = 30;
minDelay = 1.5;
maxDelay = 3.0;
eliteLevel = 30;
attackThrottle = 80;
isShotRadius = 120;
attackSound = -1; // no sound
deathSound = -1; // no sound
mood = NEUTRAL_START;
endfunction;
//------------------------------------------------------------------
// StartState: my initial state
//------------------------------------------------------------------
state StartState;
code
SetFiringDelay (ME,minDelay,maxDelay);
SetIgnoreFriendlyFire (ME,true);
SetIsShotRadius (ME,isShotRadius);
SetEntropyMood (ME,mood);
SetCurMood (ME,mood);
SetSkillLevel (ME,piloting,gunnery,eliteLevel);
SetAttackThrottle (ME,attackThrottle);
if (orderTakeOff(takeOffDistance) == true) then
trans FollowPathState;
endif;
endstate;
//------------------------------------------------------------------
// FollowPathState: follow our path, but keep an eye out for enemies
//------------------------------------------------------------------
state FollowPathState;
code
if (FindEnemy(fleeRange,FT_DEFAULT)) then
trans FleeState;
endif;
if (path <> -1) then
OrderFormationMove((groupobjectid(groupNumber)),path,speed,moveType,formationType,formationDensity,false);
else
OrderMoveLookOut;
endif;
endstate;
//------------------------------------------------------------------
// FleeState: run away from my target
//------------------------------------------------------------------
state FleeState;
code
if (LeaveAttackState(withdrawRange)) then
ClearMoveOrder(ME);
SetTarget(ME,NO_UNIT);
trans FollowPathState;
endif;
if (attackSound <> -1) then
PlaySoundOnce(attackSound);
endif;
OrderMoveFlee(GetTarget(ME),fleeSpeed);
endstate;
//------------------------------------------------------------------
// DeadState: OK, I kicked the bucket.
//------------------------------------------------------------------
state DeadState;
code
if (deathSound <> -1) then
PlaySoundOnce(deathSound);
endif;
orderDie;
endstate;
endfsm.
@@ -0,0 +1,169 @@
//------------------------------------------------------------------
// NOTE: The fsm name below MUST be changed in order for the
// script to be considered a unique entity!
fsm Generic_UnarmedPatrol : integer;
//------------------------------------------------------------------
// Generic_UnarmedPatrol:
// Follows a path and runs from enemies.
// NOTE: this script requires a CombatAI (or MechAI) to work properly!!!
//------------------------------------------------------------------
//------------------------------------------------------------------
// Constants
//------------------------------------------------------------------
const
#include_ <content\ABLScripts\mwconst.abi>
//------------------------------------------------------------------
// Types
//------------------------------------------------------------------
type
#include_ <content\ABLScripts\mwtype.abi>
//------------------------------------------------------------------
// Variables
//------------------------------------------------------------------
var
static integer fleeRange; // At what range do I start running?
static integer stopFleeingRange; // At what range do I consider myself out of danger?
static integer fleeSpeed; // How fast I flee
static integer path; // My path
static integer moveType; // How I move along the path
static integer piloting; // Piloting skill
static integer gunnery; // Gunnery skill/chance to hit
static real minDelay; // Minimum amount of time I will wait between shots once a weapon is reloaded
static real maxDelay; // Maximum amount of time I will wait between shots once a weapon is reloaded
static integer eliteLevel; // Elite level. This helps determine tactics, defensive manuevers, opportunity fire
// and other things. It indicates a general level of combat experience.
static integer attackThrottle; // My attack throttle
static integer isShotRadius; // How far away from me will I detect an enemy shot?
static integer attackSound; // The attack sound I play when I first attack
static integer deathSound; // The sound I play when I die
static integer mood; // My default mood.
static integer speed; // The speed at which I move along the path
static integer takeOffDistance; // My take-off distance if I'm an airplane (ignored if not an airplane)
//------------------------------------------------------------------
// Init: my initialization function
//------------------------------------------------------------------
function Init;
code
// script-specific variables
fleeRange = 500;
stopFleeingRange = fleeRange + 500;
path = -1;
moveType = move_circle;
speed = 600;
fleeSpeed = 600;
takeOffDistance = 150;
// driver settings
piloting = 50;
gunnery = 30;
minDelay = 1.5;
maxDelay = 3.0;
eliteLevel = 30;
attackThrottle = 80;
isShotRadius = 120;
attackSound = -1; // no sound
deathSound = -1; // no sound
mood = NEUTRAL_START;
endfunction;
//------------------------------------------------------------------
// StartState: my initial state
//------------------------------------------------------------------
state StartState;
code
SetFiringDelay (ME,minDelay,maxDelay);
SetIgnoreFriendlyFire (ME,true);
SetIsShotRadius (ME,isShotRadius);
SetEntropyMood (ME,mood);
SetCurMood (ME,mood);
SetSkillLevel (ME,piloting,gunnery,eliteLevel);
SetAttackThrottle (ME,attackThrottle);
if (orderTakeOff(takeOffDistance) == true) then
trans FollowPathState;
endif;
endstate;
//------------------------------------------------------------------
// FollowPathState: follow our path, but keep an eye out for enemies
//------------------------------------------------------------------
state FollowPathState;
code
if (FindEnemy(fleeRange,FT_DEFAULT)) then
trans FleeState;
endif;
if (path <> -1) then
OrderMoveResumePatrol(path,speed,moveType,true,false);
else
OrderMoveLookOut;
endif;
endstate;
//------------------------------------------------------------------
// FleeState: run away from my target
//------------------------------------------------------------------
state FleeState;
code
if (LeaveAttackState(stopFleeingRange)) then
ClearMoveOrder(ME);
SetTarget(ME,NO_UNIT);
trans FollowPathState;
endif;
if (attackSound <> -1) then
PlaySoundOnce(attackSound);
endif;
OrderMoveFlee(GetTarget(ME),600);
endstate;
//------------------------------------------------------------------
// DeadState: OK, I kicked the bucket.
//------------------------------------------------------------------
state DeadState;
code
if (deathSound <> -1) then
PlaySoundOnce(deathSound);
endif;
orderDie;
endstate;
endfsm.
@@ -0,0 +1,159 @@
//------------------------------------------------------------------
// NOTE: The fsm name below MUST be changed in order for the
// script to be considered a unique entity!
fsm Generic_UnarmedSentry : integer;
//------------------------------------------------------------------
// Generic_UnarmedSentry:
// Stands still and runs from enemies.
// NOTE: this script requires a CombatAI (or MechAI) to work properly!!!
//------------------------------------------------------------------
//------------------------------------------------------------------
// Constants
//------------------------------------------------------------------
const
#include_ <content\ABLScripts\mwconst.abi>
//------------------------------------------------------------------
// Types
//------------------------------------------------------------------
type
#include_ <content\ABLScripts\mwtype.abi>
//------------------------------------------------------------------
// Variables
//------------------------------------------------------------------
var
static integer fleeRange; // At what range do I start running?
static integer stopFleeingRange; // After I've fled, at what range can I forget about my enemy and return to sentry duty?
static integer piloting; // Piloting skill
static integer gunnery; // Gunnery skill/chance to hit
static real minDelay; // Minimum amount of time I will wait between shots once a weapon is reloaded
static real maxDelay; // Maximum amount of time I will wait between shots once a weapon is reloaded
static integer eliteLevel; // Elite level. This helps determine tactics, defensive manuevers, opportunity fire
// and other things. It indicates a general level of combat experience.
static integer attackThrottle; // My attack throttle
static integer isShotRadius; // How far away from me will I detect an enemy shot?
static integer attackSound; // The attack sound I play when I first attack
static integer deathSound; // The sound I play when I die
static integer mood; // My default mood.
static integer fleeSpeed; // How fast I flee
static integer takeOffDistance; // My take-off distance if I'm an airplane (ignored if not an airplane)
//------------------------------------------------------------------
// Init: my initialization function
//------------------------------------------------------------------
function Init;
code
// script-specific variables
fleeRange = 500;
stopFleeingRange = 1000;
fleeSpeed = 600;
takeOffDistance = 150;
// driver settings
piloting = 50;
gunnery = 30;
minDelay = 1.5;
maxDelay = 3.0;
eliteLevel = 30;
attackThrottle = 80;
isShotRadius = 120;
attackSound = -1; // no sound
deathSound = -1; // no sound
mood = NEUTRAL_START;
endfunction;
//------------------------------------------------------------------
// StartState: my initial state
//------------------------------------------------------------------
state StartState;
code
SetFiringDelay (ME,minDelay,maxDelay);
SetIgnoreFriendlyFire (ME,true);
SetIsShotRadius (ME,isShotRadius);
SetEntropyMood (ME,mood);
SetCurMood (ME,mood);
SetSkillLevel (ME,piloting,gunnery,eliteLevel);
SetAttackThrottle (ME,attackThrottle);
if (orderTakeOff(takeOffDistance) == true) then
trans WaitState;
endif;
endstate;
//------------------------------------------------------------------
// WaitState: wait for someone to come near
//------------------------------------------------------------------
state WaitState;
code
OrderMoveLookOut;
if (FindEnemy(fleeRange,FT_DEFAULT)) then
ClearMoveOrder(ME);
trans FleeState;
endif;
endstate;
//------------------------------------------------------------------
// FleeState: run away from my target
//------------------------------------------------------------------
state FleeState;
code
if (LeaveAttackState(stopFleeingRange)) then
ClearMoveOrder(ME);
SetTarget(ME,NO_UNIT);
trans WaitState;
endif;
if (attackSound <> -1) then
PlaySoundOnce(attackSound);
endif;
OrderMoveFlee(GetTarget(ME),fleeSpeed);
endstate;
//------------------------------------------------------------------
// DeadState: OK, I kicked the bucket.
//------------------------------------------------------------------
state DeadState;
code
if (deathSound <> -1) then
PlaySoundOnce(deathSound);
endif;
orderDie;
endstate;
endfsm.
@@ -0,0 +1,189 @@
//------------------------------------------------------------------
// NOTE: The fsm name below MUST be changed in order for the
// script to be considered a unique entity!
UIFIELDS
{
FIELD< INT,attackRange,"Attack Range",500>; // At what range do I start shooting?
FIELD< INT,withdrawRange,"Withdraw Range",750>; // At what range do I withdraw from combat entirely?
FIELD< INT,piloting,"Piloting Skill",50>; // Piloting skill
FIELD< INT,gunnery,"Gunnery Skill",50>; // Gunnery skill/chance to hit
FIELD< FLOAT,minDelay,"Minimum fire Delay",1.0>; // Minimum amount of time I will wait between shots once a weapon is reloaded
FIELD< FLOAT,maxDelay,"Maximum fire Delay",2.0>; // Maximum amount of time I will wait between shots once a weapon is reloaded
FIELD< INT,eliteLevel,"Elite Level",60>; // Elite level. This helps determine tactics, defensive manuevers, opportunity fire
// and other things. It indicates a general level of combat experience.
FIELD< INT,isShotRadius,"Is Shot Radius",120>; // How far away from me will I detect an enemy shot?
FIELD<INT, takeOffDistance,"Take Off Distance (ignored if not a plane)",160>;
FIELD<INT, attackThrottle,"Percent throttle when in combat",80>;
FIELD< INT,path,"Path",-1>; // My path
FIELD< INT,moveType,"Nocycle = 1, Circle = 2, Seesaw = 3",2>; // How I move along the path
FIELD<INT, speed,"Movement Speed",600>;
}
fsm Generic_Patrol : integer;
//------------------------------------------------------------------
// Generic_Patrol:
// Follows a path. If anything comes near, it goes off and attacks it,
// and then comes back to the path when there's nothing left to attack.
//------------------------------------------------------------------
//------------------------------------------------------------------
// Constants
//------------------------------------------------------------------
const
#include_ <content\ABLScripts\mwconst.abi>
//------------------------------------------------------------------
// Types
//------------------------------------------------------------------
type
#include_ <content\ABLScripts\mwtype.abi>
//------------------------------------------------------------------
// Variables
//------------------------------------------------------------------
var
static integer attackRange; // At what range do I start shooting?
static integer withdrawRange; // At what range do I withdraw from combat entirely?
static integer path; // My path
static integer moveType; // How I move along the path
static boolean canLeavePath; // Can I leave the path if attacked? (TRUE by default)
static integer piloting; // Piloting skill
static integer gunnery; // Gunnery skill/chance to hit
static real minDelay; // Minimum amount of time I will wait between shots once a weapon is reloaded
static real maxDelay; // Maximum amount of time I will wait between shots once a weapon is reloaded
static integer eliteLevel; // Elite level. This helps determine tactics, defensive manuevers, opportunity fire
// and other things. It indicates a general level of combat experience.
static integer attackThrottle; // My attack throttle
static integer isShotRadius; // How far away from me will I detect an enemy shot?
static integer findTypes; // What kind of enemies to look for
static integer attackSound; // The attack sound I play when I first attack
static integer deathSound; // The sound I play when I die
static integer mood; // My default mood.
static integer speed; // The speed at which I move along the path
static integer takeOffDistance; // My take-off distance if I'm an airplane (ignored if not an airplane)
//------------------------------------------------------------------
// Init: my initialization function
//------------------------------------------------------------------
function Init;
code
// Variables set by editor
attackRange = <attackRange>;
withdrawRange = <withdrawRange>;
takeOffDistance = <takeOffDistance>;
piloting = <piloting>;
gunnery = <gunnery>;
minDelay = <minDelay>;
maxDelay = <maxDelay>;
eliteLevel = <eliteLevel>;
isShotRadius = <isShotRadius>;
attackThrottle = <attackThrottle>;
path = <path>;
moveType = <moveType>;
speed = <speed>;
canLeavePath = true;
attackSound = -1; // no sound
deathSound = -1; // no sound
mood = NEUTRAL_START;
findTypes = FT_DEFAULT;
endfunction;
//------------------------------------------------------------------
// StartState: my initial state
//------------------------------------------------------------------
state StartState;
code
SetFiringDelay (ME,minDelay,maxDelay);
SetIgnoreFriendlyFire (ME,true);
SetIsShotRadius (ME,isShotRadius);
SetEntropyMood (ME,mood);
SetCurMood (ME,mood);
SetSkillLevel (ME,piloting,gunnery,eliteLevel);
SetAttackThrottle (ME,attackThrottle);
if (orderTakeOff(takeOffDistance) == true) then
trans FollowPathState;
endif;
endstate;
//------------------------------------------------------------------
// FollowPathState: follow our path, but keep an eye out for enemies
//------------------------------------------------------------------
state FollowPathState;
code
if (FindEnemy(attackRange,findTypes)) then
trans AttackState;
endif;
if (path <> -1) then
OrderMoveResumePatrol(path,speed,moveType,true,false);
else
OrderMoveLookOut;
endif;
endstate;
//------------------------------------------------------------------
// AttackState: attack my current target, or return to path if done
//------------------------------------------------------------------
state AttackState;
code
if (LeaveAttackState(withdrawRange)) then
OrderStopAttacking;
SetTarget(ME,NO_UNIT);
trans FollowPathState;
endif;
if (attackSound <> -1) then
PlaySoundOnce(attackSound);
endif;
OrderAttack(canLeavePath);
endstate;
//------------------------------------------------------------------
// DeadState: OK, I kicked the bucket.
//------------------------------------------------------------------
state DeadState;
code
if (deathSound <> -1) then
PlaySoundOnce(deathSound);
endif;
orderDie;
endstate;
endfsm.
@@ -0,0 +1,267 @@
//------------------------------------------------------------------
// NOTE: The fsm name below MUST be changed in order for the
// script to be considered a unique entity!
UIFIELDS
{
FIELD< INT,attackRange,"Attack Range",500>; // At what range do I start shooting?
FIELD< INT,withdrawRange,"Withdraw Range",750>; // At what range do I withdraw from combat entirely?
FIELD< INT,piloting,"Piloting Skill",50>; // Piloting skill
FIELD< INT,gunnery,"Gunnery Skill",50>; // Gunnery skill/chance to hit
FIELD< FLOAT,minDelay,"Minimum fire Delay",1.0>; // Minimum amount of time I will wait between shots once a weapon is reloaded
FIELD< FLOAT,maxDelay,"Maximum fire Delay",2.0>; // Maximum amount of time I will wait between shots once a weapon is reloaded
FIELD< INT,eliteLevel,"Elite Level",60>; // Elite level. This helps determine tactics, defensive manuevers, opportunity fire
// and other things. It indicates a general level of combat experience.
FIELD< INT,isShotRadius,"Is Shot Radius",120>; // How far away from me will I detect an enemy shot?
FIELD<INT, takeOffDistance,"Take Off Distance (ignored if not a plane)",160>;
FIELD<INT, attackThrottle,"Percent throttle when in combat",80>;
FIELD< INT,path,"First Path",-1>; // My path
FIELD< INT,path2,"Second Path",-1>; // My path
FIELD< INT,moveType,"Nocycle = 1, Circle = 2, Seesaw = 3",2>; // How I move along the path
FIELD<INT, speed,"Movement Speed",600>;
FIELD< INT,attackRange2,"Attack Range on second path",500>; // At what range do I start shooting?
FIELD< INT,withdrawRange2,"Withdraw Range on second path",750>; // At what range do I withdraw from combat entirely?
FIELD< INT,moveType2,"(path 2) Nocycle = 1, Circle = 2, Seesaw = 3",2>; // How I move along the path
FIELD<INT, trigger,"ID of trigger that makes the unit swap paths",1>;
FIELD<INT, trigger,"ID of trigger that makes the unit wake up",1>;
}
fsm Generic_PatrolRespond : integer;
//------------------------------------------------------------------
// Generic_PatrolRespond:
// Follows a path. If anything comes near, it goes off and attacks it,
// and then comes back to the path when there's nothing left to attack.
// When a specific trigger is set, it goes to another point or path
// and does the same thing.
// I.e. this is the same as Generic_Patrol, except that it
// goes to a second point or path upon firing of a trigger.
//------------------------------------------------------------------
//------------------------------------------------------------------
// Constants
//------------------------------------------------------------------
const
#include_ <content\ABLScripts\mwconst.abi>
//------------------------------------------------------------------
// Types
//------------------------------------------------------------------
type
#include_ <content\ABLScripts\mwtype.abi>
//------------------------------------------------------------------
// Variables
//------------------------------------------------------------------
var
static integer attackRange1; // The range at which I start attacking if in the original patrol
static integer withdrawRange1; // The range at which I withdraw from combat entirely
static integer path1; // My original path
static integer moveType1; // How I move along the path
static boolean canLeavePath1; // Can I leave the path if attacked? (TRUE by default)
static integer speed1; // The speed at which I move along the path
static integer triggerID; // The trigger that will move me from my original patrol state to my new patrol state
static integer attackRange2; // The range at which I start attacking after the trigger has fired
static integer withdrawRange2; // The range at which I withdraw from combat entirely
static integer path2; // My path after the trigger fires
static integer moveType2; // How I move along the second path
static boolean canLeavePath2; // Can I leave the second path if attacked? (TRUE by default)
static integer speed2; // The speed at which I move along the second path
static integer piloting; // Piloting skill
static integer gunnery; // Gunnery skill/chance to hit
static real minDelay; // Minimum amount of time I will wait between shots once a weapon is reloaded
static real maxDelay; // Maximum amount of time I will wait between shots once a weapon is reloaded
static integer eliteLevel; // Elite level. This helps determine tactics, defensive manuevers, opportunity fire
// and other things. It indicates a general level of combat experience.
static integer attackThrottle; // My attack throttle
static integer findTypes; // What kind of enemies to look for
static integer isShotRadius; // How far away from me will I detect an enemy shot?
static integer attackSound; // The attack sound I play when I first attack
static integer deathSound; // The sound I play when I die
static integer mood; // My default mood.
static integer takeOffDistance; // My take-off distance if I'm an airplane (ignored if not an airplane)
//------------------------------------------------------------------
// Init: my initialization function
//------------------------------------------------------------------
function Init;
code
// Variables set by editor
attackRange1 = <attackRange>;
withdrawRange1 = <withdrawRange>;
takeOffDistance = <takeOffDistance>;
piloting = <piloting>;
gunnery = <gunnery>;
minDelay = <minDelay>;
maxDelay = <maxDelay>;
eliteLevel = <eliteLevel>;
isShotRadius = <isShotRadius>;
attackThrottle = <attackThrottle>;
path1 = <path>;
path2 = <path2>;
moveType1 = <moveType>;
speed1 = <speed>;
attackRange2 = <attackRange>;
withdrawRange2 = <withdrawRange>;
moveType2 = <moveType>;
speed2 = <speed>;
triggerID = <trigger>;
// script-specific variables
canLeavePath1 = true;
canLeavePath2 = true;
attackSound = -1; // no sound
deathSound = -1; // no sound
mood = NEUTRAL_START;
findTypes = FT_DEFAULT;
endfunction;
//------------------------------------------------------------------
// StartState: my initial state
//------------------------------------------------------------------
state StartState;
code
SetFiringDelay (ME,minDelay,maxDelay);
SetIgnoreFriendlyFire (ME,true);
SetIsShotRadius (ME,isShotRadius);
SetEntropyMood (ME,mood);
SetCurMood (ME,mood);
SetSkillLevel (ME,piloting,gunnery,eliteLevel);
SetAttackThrottle (ME,attackThrottle);
if (orderTakeOff(takeOffDistance) == true) then
trans FollowPath1State;
endif;
endstate;
//------------------------------------------------------------------
// FollowPath1State: follow the original path, but keep an eye out for enemies
//------------------------------------------------------------------
state FollowPath1State;
code
if (GetGlobalTrigger(triggerID)) then
trans FollowPath2State;
endif;
if (FindEnemy(attackRange1,findTypes)) then
trans Attack1State;
endif;
if (path1 <> -1) then
OrderMoveResumePatrol(path1,speed1,moveType1,true,false);
else
OrderMoveLookOut;
endif;
endstate;
//------------------------------------------------------------------
// Attack1State: attack my current target, or return to original path if done
//------------------------------------------------------------------
state Attack1State;
code
if (GetGlobalTrigger(triggerID)) then
trans Attack2State;
endif;
if (LeaveAttackState(withdrawRange1)) then
OrderStopAttacking;
SetTarget(ME,NO_UNIT);
trans FollowPath1State;
endif;
if (attackSound <> -1) then
PlaySoundOnce(attackSound);
endif;
OrderAttack(canLeavePath1);
endstate;
//------------------------------------------------------------------
// FollowPath2State: follow the second path, but keep an eye out for enemies
//------------------------------------------------------------------
state FollowPath2State;
code
if (FindEnemy(attackRange2,findTypes)) then
trans Attack2State;
endif;
if (path2 <> -1) then
OrderMoveResumePatrol(path2,speed2,moveType2,true,false);
else
OrderMoveLookOut;
endif;
endstate;
//------------------------------------------------------------------
// Attack2State: attack my current target, or return to second path if done
//------------------------------------------------------------------
state Attack2State;
code
if (LeaveAttackState(withdrawRange2)) then
OrderStopAttacking;
SetTarget(ME,NO_UNIT);
trans FollowPath2State;
endif;
if (attackSound <> -1) then
PlaySoundOnce(attackSound);
endif;
OrderAttack(canLeavePath2);
endstate;
//------------------------------------------------------------------
// DeadState: OK, I kicked the bucket.
//------------------------------------------------------------------
state DeadState;
code
if (deathSound <> -1) then
PlaySoundOnce(deathSound);
endif;
orderDie;
endstate;
endfsm.
@@ -0,0 +1,236 @@
//------------------------------------------------------------------
// NOTE: The fsm name below MUST be changed in order for the
// script to be considered a unique entity!
UIFIELDS
{
FIELD< INT,attackRange,"Attack Range",500>; // At what range do I start shooting?
FIELD< INT,withdrawRange,"Withdraw Range",750>; // At what range do I withdraw from combat entirely?
FIELD< INT,piloting,"Piloting Skill",50>; // Piloting skill
FIELD< INT,gunnery,"Gunnery Skill",50>; // Gunnery skill/chance to hit
FIELD< FLOAT,minDelay,"Minimum fire Delay",1.0>; // Minimum amount of time I will wait between shots once a weapon is reloaded
FIELD< FLOAT,maxDelay,"Maximum fire Delay",2.0>; // Maximum amount of time I will wait between shots once a weapon is reloaded
FIELD< INT,eliteLevel,"Elite Level",60>; // Elite level. This helps determine tactics, defensive manuevers, opportunity fire
// and other things. It indicates a general level of combat experience.
FIELD< INT,isShotRadius,"Is Shot Radius",120>; // How far away from me will I detect an enemy shot?
FIELD<INT, takeOffDistance,"Take Off Distance (ignored if not a plane)",160>;
FIELD<INT, attackThrottle,"Percent throttle when in combat",80>;
FIELD<INT, trigger,"ID of trigger that makes the unit wake up",1>;
FIELD<INT, speed,"Movement Speed",600>;
FIELD<INT, DestX,"X coordinate of destination (-1 = none)",-1>;
FIELD<INT, DestY,"Y coordinate of destination (-1 = none)",-1>;
FIELD<INT, DestZ,"Z coordinate of destination (-1 = none)",-1>;
}
fsm Generic_Reinforcement : integer;
//------------------------------------------------------------------
// Generic_Reinforcement:
// Shuts down, waits until a trigger, powers up, moves to a specific
// point (if specified) and attacks anything that comes near
//------------------------------------------------------------------
//------------------------------------------------------------------
// Constants
//------------------------------------------------------------------
const
#include_ <content\ABLScripts\mwconst.abi>
//------------------------------------------------------------------
// Types
//------------------------------------------------------------------
type
#include_ <content\ABLScripts\mwtype.abi>
//------------------------------------------------------------------
// Variables
//------------------------------------------------------------------
var
static integer attackRange1; // At what range do I start shooting (as I'm moving to the point)?
static integer attackRange2; // At what range do I start shooting (as a reinforcement)?
static integer withdrawRange; // At what range do I stop shooting (as a reinforcement)?
static integer triggerID; // The index of my global trigger
static LocPoint destination; // The destination to move to when ready
static integer piloting; // Piloting skill
static integer gunnery; // Gunnery skill/chance to hit
static real minDelay; // Minimum amount of time I will wait between shots once a weapon is reloaded
static real maxDelay; // Maximum amount of time I will wait between shots once a weapon is reloaded
static integer speed; // What speed so I move at?
static integer elitelevel; // Elite level. This helps determine tactics, defensive manuevers, opportunity fire
// and other things. It indicates a general level of combat experience.
static integer attackThrottle; // My attack throttle
static integer findTypes; // What kind of enemies to look for
static integer isshotradius; // How far away from me will I detect an enemy shot?
static integer attackSound; // The attack sound I play when I first attack
static integer deathSound; // The sound I play when I die
static integer mood; // My default mood.
static integer takeOffDistance; // My take-off distance if I'm an airplane (ignored if not an airplane)
//------------------------------------------------------------------
// Init: my initialization function
//------------------------------------------------------------------
function Init;
code
// Variables set by editor
attackRange1 = <attackRange>;
withdrawRange = <withdrawRange>;
takeOffDistance = <takeOffDistance>;
piloting = <piloting>;
gunnery = <gunnery>;
minDelay = <minDelay>;
maxDelay = <maxDelay>;
eliteLevel = <eliteLevel>;
isShotRadius = <isShotRadius>;
attackThrottle = <attackThrottle>;
speed = <speed>;
triggerID = <trigger>;
destination[0] = <DestX>;
destination[1] = <DestY>;
destination[2] = <DestZ>;
// script-specific variables
attackRange2 = attackrange1;
// driver settings
attackSound = -1; // no sound
deathSound = -1; // no sound
mood = NEUTRAL_START;
findTypes = FT_DEFAULT;
endfunction;
//------------------------------------------------------------------
// StartState: my initial state
//------------------------------------------------------------------
state StartState;
code
SetFiringDelay (ME,minDelay,maxDelay);
SetIgnoreFriendlyFire (ME,true);
SetIsShotRadius (ME,isshotradius);
SetEntropyMood (ME,mood);
SetCurMood (ME,mood);
SetSkillLevel (ME,piloting,gunnery,elitelevel);
SetAttackThrottle (ME,attackThrottle);
trans ShutdownAndWaitState;
endstate;
//------------------------------------------------------------------
// ShutdownAndWaitState: shut down and wait for the trigger to be set, then go
//------------------------------------------------------------------
state ShutdownAndWaitState;
code
Shutdown(ME);
if ((GetGlobalTrigger(triggerID)) or (isshot(me))) then
if (orderTakeOff(takeOffDistance) == true) then
Startup(ME);
if ((destination[0] == -1) and (destination[1] == -1) and (destination[2] == -1)) then
trans AttackState;
endif;
trans MoveToPointState;
endif;
endif;
endstate;
//------------------------------------------------------------------
// MoveToPointState: go to the destination, and attack when we get there
//------------------------------------------------------------------
state MoveToPointState;
code
if (OrderMoveToLocPoint(destination,speed,true,true)) then
orderstopattacking;
SetTarget(ME,NO_UNIT);
trans WaitAtPointState;
else
if (FindEnemy(attackRange1,findTypes)) then
if (attackSound <> -1) then
PlaySoundOnce(attackSound);
endif;
OrderAttack(false);
endif;
endif;
endstate;
//------------------------------------------------------------------
// WaitAtPointState: I got to the point; let's look around
//------------------------------------------------------------------
state WaitAtPointState;
code
if (FindEnemy(attackRange2,findTypes)) then
trans AttackState;
endif;
endstate;
//------------------------------------------------------------------
// AttackState: let's find someone and hurt them
//------------------------------------------------------------------
state AttackState;
code
if (LeaveAttackState(withdrawRange)) then
OrderStopAttacking;
SetTarget(ME,NO_UNIT);
trans MoveToPointState;
endif;
if (attackSound <> -1) then
PlaySoundOnce(attackSound);
endif;
OrderAttack(TRUE);
endstate;
//------------------------------------------------------------------
// DeadState: OK, I kicked the bucket.
//------------------------------------------------------------------
state DeadState;
code
if (deathSound <> -1) then
PlaySoundOnce(deathSound);
endif;
orderDie;
endstate;
endfsm.
@@ -0,0 +1,244 @@
//------------------------------------------------------------------
// NOTE: The fsm name below MUST be changed in order for the
// script to be considered a unique entity!
fsm Sample_FriendlyFireWarn : integer;
//------------------------------------------------------------------
// Sample_FriendlyFireWarn:
// This script encapsulates the code you need to copy into a
// script to get it to do a friendly fire warning -- and
// eventually attack -- when the player shoots it.
// INSTRUCTIONS FOR USE:
// 1. Copy the static integers in the "var" section of this script
// into your existing script.
// 2. Copy the variable initialization stuff from the Init function
// of this script into your existing script. You will need to
// specify the correct sound IDs, and you may need to set custom
// timer IDs as well to avoid timer ID conflicts (see below).
// 3. Copy the CheckIfPlayerShotMe function to your existing script.
// 4. Add a call to CheckIfPlayerShotMe to the beginning of each
// state in your existing script.
// 5. Copy the KillPlayerState into your existing script.
// Be sure to also ...
// -Add the sound files to Content\Audio, and check them in!
// -Add the sound file names to the mission's .table & .audio files!
//------------------------------------------------------------------
//------------------------------------------------------------------
// Constants
//------------------------------------------------------------------
const
#include_ <content\ABLScripts\mwconst.abi>
//------------------------------------------------------------------
// Types
//------------------------------------------------------------------
type
#include_ <content\ABLScripts\mwtype.abi>
//------------------------------------------------------------------
// Variables
//------------------------------------------------------------------
var
static integer friendlyFireFrustrationLevel; // An integer indicating how frustrated I am with the player
static integer frustration_timer; // A timer I use to wait after I'm hit by friendly fire before calling IsShot() again
static integer attack_player_timer; // A timer I use when I'm really pissed off to give the "OK, you die now" sound enough time to play before I attack
static integer warn_sound_1; // Sound ID: "Hey, watch the friendly fire."
static integer warn_sound_2; // Sound ID: "I warned you, now knock it off."
static integer warn_sound_3; // Sound ID: "One more friendly fire incident and you're toast."
static integer warn_sound_4; // Sound ID: "OK, that's it, I'm taking you out, traitor."
//------------------------------------------------------------------
// Init: my initialization function
//------------------------------------------------------------------
function Init;
code
friendlyFireFrustrationLevel = 0;
// NOTE: replace the following with the warning sound IDs ...
// such as "eso_FFWarn1" or "eso_FFWarn2".
warn_sound_1 = -1;
warn_sound_2 = -1;
warn_sound_3 = -1;
warn_sound_4 = -1;
// NOTE: try to give each friendly unit its own timer IDs; if you can't,
// it's no problem, but then try to make sure each friendly unit script
// is using a unique pair of timers.
// These timers MUST be different from any timers you are using
// elsewhere in your scripts for a given mission!!
frustration_timer = gti_Timer_25;
attack_player_timer = gti_Timer_26;
StartTimer(frustration_timer);
SetTimer(frustration_timer,100);
endfunction;
//------------------------------------------------------------------
// CheckIfPlayerShotMe: this function checks to see if I took
// friendly fire from the player and responds appropriately.
// You should call this function at the beginning of every state in
// your script.
//------------------------------------------------------------------
function CheckIfPlayerShotMe : integer;
var
ObjectID who_shot;
code
// cool down for at least 8 seconds after I'm shot to give IsShot() a chance to reset
if (Not TimeGreater(frustration_timer,8)) then
return (0);
endif;
// Have I been shot?
if (Not IsShot(ME)) then
return (0);
endif;
who_shot = WhoShot(me);
// OK, I was shot -- was it the player that did it?
if (who_shot <> getplayervehicle(epl_player0)) then
return (0);
endif;
ResetTimer(frustration_timer);
// Level 1: "Knock off the friendly fire."
if (friendlyFireFrustrationLevel == 0) then
if (warn_sound_1 <> -1) then
PlaySound(warn_sound_1);
endif;
friendlyFireFrustrationLevel = 1;
return (1);
endif;
// Level 2: "Hey! I warned you, knock it off."
if (friendlyFireFrustrationLevel == 1) then
if (warn_sound_2 <> -1) then
PlaySound(warn_sound_2);
endif;
friendlyFireFrustrationLevel = 2;
return (1);
endif;
// Level 3: "What we've got here is a failure to communicate."
if (friendlyFireFrustrationLevel == 2) then
if (warn_sound_3 <> -1) then
PlaySound(warn_sound_3);
endif;
friendlyFireFrustrationLevel = 3;
return (1);
endif;
// Level 4: "OK, you're gonna die now."
if (warn_sound_4 <> -1) then
PlaySound(warn_sound_4);
endif;
StartTimer(attack_player_timer);
ResetTimer(attack_player_timer);
trans KillPlayerState;
return (1);
endfunction;
//------------------------------------------------------------------
// StartState: my initial state
//------------------------------------------------------------------
state StartState;
code
// IMPORTANT!!! -- You must turn off friendly-fire-ignoring
// for this to work!
SetIgnoreFriendlyFire(me,FALSE);
CheckIfPlayerShotMe;
endstate;
//------------------------------------------------------------------
// StartState: my initial state
//------------------------------------------------------------------
state SitState;
code
CheckIfPlayerShotMe;
// other state stuff here ...
endstate;
state AttackState;
code
CheckIfPlayerShotMe;
// other state stuff here ...
endstate;
state EveryOtherStateInTheWholeGoddamnScript;
code
CheckIfPlayerShotMe;
// other state stuff here ...
endstate;
//------------------------------------------------------------------
// KillPlayerState: too much friendly fire -- get pissed, turn into
// an UberBot, and attack the player
//------------------------------------------------------------------
state KillPlayerState;
code
if (TimeGreater(attack_player_timer,6)) then
SetFiringDelay (ME,0.0,0.0);
SetSkillLevel (ME,100,999,100);
SetAutoTargeting(ME,FALSE);
SetTarget(ME,getplayervehicle(epl_player0));
OrderAttack(TRUE);
endif;
endstate;
//------------------------------------------------------------------
// DeadState: OK, I kicked the bucket.
//------------------------------------------------------------------
state DeadState;
code
orderDie;
endstate;
endfsm.
@@ -0,0 +1,168 @@
UIFIELDS
{
FIELD< INT,attackRange,"Attack Range",500>; // At what range do I start shooting?
FIELD< INT,withdrawRange,"Withdraw Range",750>; // At what range do I withdraw from combat entirely?
FIELD< INT,piloting,"Piloting Skill",50>; // Piloting skill
FIELD< INT,gunnery,"Gunnery Skill",50>; // Gunnery skill/chance to hit
FIELD< FLOAT,minDelay,"Minimum fire Delay",1.0>; // Minimum amount of time I will wait between shots once a weapon is reloaded
FIELD< FLOAT,maxDelay,"Maximum fire Delay",2.0>; // Maximum amount of time I will wait between shots once a weapon is reloaded
FIELD< INT,eliteLevel,"Elite Level",60>; // Elite level. This helps determine tactics, defensive manuevers, opportunity fire
// and other things. It indicates a general level of combat experience.
FIELD< INT,isShotRadius,"Is Shot Radius",120>; // How far away from me will I detect an enemy shot?
FIELD<INT, takeOffDistance,"Take Off Distance (ignored if not a plane)",160>;
FIELD<INT, attackThrottle,"Percent throttle when in combat",80>;
}
//------------------------------------------------------------------
// NOTE: The fsm name below MUST be changed in order for the
// script to be considered a unique entity!
fsm Generic_Sentry : integer;
//------------------------------------------------------------------
// Generic_Sentry:
// Stands still. Moves to attack anything that comes near.
//
//------------------------------------------------------------------
//------------------------------------------------------------------
// Constants
//------------------------------------------------------------------
const
#include_ <content\ABLScripts\mwconst.abi>
//------------------------------------------------------------------
// Types
//------------------------------------------------------------------
type
#include_ <content\ABLScripts\mwtype.abi>
//------------------------------------------------------------------
// Variables
//------------------------------------------------------------------
var
static integer attackRange; // At what range do I start shooting?
static integer withdrawRange; // At what range do I withdraw from combat completely?
static integer piloting; // Piloting skill
static integer gunnery; // Gunnery skill/chance to hit
static real minDelay; // Minimum amount of time I will wait between shots once a weapon is reloaded
static real maxDelay; // Maximum amount of time I will wait between shots once a weapon is reloaded
static integer eliteLevel; // Elite level. This helps determine tactics, defensive manuevers, opportunity fire
// and other things. It indicates a general level of combat experience.
static integer attackThrottle; // My attack throttle
static integer findTypes; // What kind of enemies to look for
static integer isShotRadius; // How far away from me will I detect an enemy shot?
static integer attackSound; // The attack sound I play when I first attack
static integer deathSound; // The sound I play when I die
static integer mood; // My default mood.
static integer takeOffDistance; // My take-off distance if I'm an airplane (ignored if not an airplane)
//------------------------------------------------------------------
// Init: my initialization function
//------------------------------------------------------------------
function Init;
code
// Variables set by editor
attackRange = <attackRange>;
withdrawRange = <withdrawRange>;
takeOffDistance = <takeOffDistance>;
piloting = <piloting>;
gunnery = <gunnery>;
minDelay = <minDelay>;
maxDelay = <maxDelay>;
eliteLevel = <eliteLevel>;
isShotRadius = <isShotRadius>;
attackThrottle = <attackThrottle>;
attackSound = -1; // no sound
deathSound = -1; // no sound
mood = NEUTRAL_START;
findTypes = FT_DEFAULT;
endfunction;
//------------------------------------------------------------------
// StartState: my initial state
//------------------------------------------------------------------
state StartState;
code
SetFiringDelay (ME,minDelay,maxDelay);
SetIgnoreFriendlyFire (ME,true);
SetIsShotRadius (ME,isShotRadius);
SetEntropyMood (ME,mood);
SetCurMood (ME,mood);
SetSkillLevel (ME,piloting,gunnery,eliteLevel);
SetAttackThrottle (ME,attackThrottle);
if (orderTakeOff(takeOffDistance) == true) then
trans WaitState;
endif;
endstate;
//------------------------------------------------------------------
// WaitState: wait for something to shoot
//------------------------------------------------------------------
state WaitState;
code
OrderMoveLookOut;
if (FindEnemy(attackRange,findTypes)) then
trans AttackState;
endif;
endstate;
//------------------------------------------------------------------
// AttackState: look for something to shoot
//------------------------------------------------------------------
state AttackState;
code
if (LeaveAttackState(withdrawRange)) then
OrderStopAttacking;
SetTarget(ME,NO_UNIT);
trans WaitState;
endif;
OrderAttack(true);
endstate;
//------------------------------------------------------------------
// DeadState: OK, I kicked the bucket.
//------------------------------------------------------------------
state DeadState;
code
if (deathSound <> -1) then
PlaySoundOnce(deathSound);
endif;
orderDie;
endstate;
endfsm.
@@ -0,0 +1,236 @@
UIFIELDS
{
FIELD< INT,attackRange,"Attack Range",500>; // At what range do I start shooting?
FIELD< INT,withdrawRange,"Withdraw Range",750>; // At what range do I withdraw from combat entirely?
FIELD< INT,piloting,"Piloting Skill",50>; // Piloting skill
FIELD< INT,gunnery,"Gunnery Skill",50>; // Gunnery skill/chance to hit
FIELD< FLOAT,minDelay,"Minimum fire Delay",1.0>; // Minimum amount of time I will wait between shots once a weapon is reloaded
FIELD< FLOAT,maxDelay,"Maximum fire Delay",2.0>; // Maximum amount of time I will wait between shots once a weapon is reloaded
FIELD< INT,eliteLevel,"Elite Level",60>; // Elite level. This helps determine tactics, defensive manuevers, opportunity fire
// and other things. It indicates a general level of combat experience.
FIELD< INT,isShotRadius,"Is Shot Radius",120>; // How far away from me will I detect an enemy shot?
FIELD<INT, takeOffDistance,"Take Off Distance (ignored if not a plane)",160>;
FIELD<INT, attackThrottle,"Percent throttle when in combat",80>;
FIELD<INT, speed,"Movement Speed",600>;
FIELD<INT, DestX,"X coordinate of destination (-1 = none)",-1>;
FIELD<INT, DestY,"Y coordinate of destination (-1 = none)",-1>;
FIELD<INT, DestZ,"Z coordinate of destination (-1 = none)",-1>;
FIELD<INT, trigger,"ID of trigger that makes the unit wake up",1>;
}
//------------------------------------------------------------------
// NOTE: The fsm name below MUST be changed in order for the
// script to be considered a unique entity!
fsm Generic_SentryReinforcement : integer;
//------------------------------------------------------------------
// Generic_SentryReinforcement:
// Performs sentry, attacking anything that comes near.
// Once a trigger is set, goes to a predefined point and
// attacks anything within range at that point.
//------------------------------------------------------------------
//------------------------------------------------------------------
// Constants
//------------------------------------------------------------------
const
#include_ <content\ABLScripts\mwconst.abi>
//------------------------------------------------------------------
// Types
//------------------------------------------------------------------
type
#include_ <content\ABLScripts\mwtype.abi>
//------------------------------------------------------------------
// Variables
//------------------------------------------------------------------
var
static integer attackRange1; // At what range do I start shooting when I'm attacking?
static integer withdrawRange1; // At what range do I give up?
static integer attackRange2; // At what range do I start shooting (as a reinforcement)?
static integer withdrawRange2; // At what range do I stop shooting (as a reinforcement)?
static integer triggerID; // The index of my global trigger
static LocPoint destination; // The destination to move to when ready
static integer piloting; // Piloting skill
static integer gunnery; // Gunnery skill/chance to hit
static real minDelay; // Minimum amount of time I will wait between shots once a weapon is reloaded
static real maxDelay; // Maximum amount of time I will wait between shots once a weapon is reloaded
static integer speed; // What speed so I move at?
static integer elitelevel; // Elite level. This helps determine tactics, defensive manuevers, opportunity fire
// and other things. It indicates a general level of combat experience.
static integer attackThrottle; // My attack throttle
static integer findTypes; // What kind of enemies to look for
static integer isshotradius; // How far away from me will I detect an enemy shot?
static integer attackSound; // The attack sound I play when I first attack
static integer deathSound; // The sound I play when I die
static integer mood; // My default mood.
static integer takeOffDistance; // My take-off distance if I'm an airplane (ignored if not an airplane)
//------------------------------------------------------------------
// Init: my initialization function
//------------------------------------------------------------------
function Init;
code
// Variables set by editor
attackRange = <attackRange>;
withdrawRange = <withdrawRange>;
takeOffDistance = <takeOffDistance>;
piloting = <piloting>;
gunnery = <gunnery>;
minDelay = <minDelay>;
maxDelay = <maxDelay>;
eliteLevel = <eliteLevel>;
isShotRadius = <isShotRadius>;
attackThrottle = <attackThrottle>;
triggerID = <trigger>;
destination[0] = <DestX>;
destination[1] = <DestY>;
destination[2] = <DestZ>;
attackRange2 = attackRange1;
withdrawRange2 = withdrawrange1;
// driver settings
attackSound = -1; // no sound
deathSound = -1; // no sound
mood = NEUTRAL_START;
findTypes = FT_DEFAULT;
endfunction;
//------------------------------------------------------------------
// StartState: my initial state
//------------------------------------------------------------------
state StartState;
code
SetFiringDelay (ME,minDelay,maxDelay);
SetIgnoreFriendlyFire (ME,true);
SetIsShotRadius (ME,isShotRadius);
SetEntropyMood (ME,mood);
SetCurMood (ME,mood);
SetSkillLevel (ME,piloting,gunnery,eliteLevel);
SetAttackThrottle (ME,attackThrottle);
if (orderTakeOff(takeOffDistance) == true) then
trans WaitState;
endif;
endstate;
//------------------------------------------------------------------
// WaitState: wait something to happen (my original state)
//------------------------------------------------------------------
state WaitState;
code
if (GetGlobalTrigger(triggerID)) then
trans MoveToPointState;
endif;
if (FindEnemy(attackRange1,findTypes)) then
trans Attack1State;
endif;
OrderMoveLookOut;
endstate;
//------------------------------------------------------------------
// Attack1State: attack someone (before I'm called as a reinforcement)
//------------------------------------------------------------------
state Attack1State;
code
if (LeaveAttackState(withdrawRange1)) then
trans WaitState;
endif;
if (GetGlobalTrigger(triggerID)) then
trans Attack2State;
endif;
if (attackSound <> -1) then
PlaySoundOnce(attackSound);
endif;
OrderAttack(TRUE);
endstate;
//------------------------------------------------------------------
// MoveToPointState: go to the destination, and attack when we get there
//------------------------------------------------------------------
state MoveToPointState;
code
if (OrderMoveToLocPoint(destination,speed,true,true)) then
OrderStopAttacking;
if (FindEnemy(attackRange2,findTypes)) then
trans Attack2State;
endif;
endif;
endstate;
//------------------------------------------------------------------
// Attack2State: attack a target (after I'm called as a reinforcement)
//------------------------------------------------------------------
state Attack2State;
code
if (LeaveAttackState(withdrawRange2)) then
trans MoveToPointState;
endif;
if (attackSound <> -1) then
PlaySoundOnce(attackSound);
endif;
OrderAttack(TRUE);
endstate;
//------------------------------------------------------------------
// DeadState: OK, I kicked the bucket.
//------------------------------------------------------------------
state DeadState;
code
if (deathSound <> -1) then
PlaySoundOnce(deathSound);
endif;
orderDie;
endstate;
endfsm.
@@ -0,0 +1,206 @@
//------------------------------------------------------------------
// NOTE: The fsm name below MUST be changed in order for the
// script to be considered a unique entity!
UIFIELDS
{
FIELD< INT,attackRange,"Attack Range",500>; // At what range do I start shooting?
FIELD< INT,withdrawRange,"Withdraw Range",750>; // At what range do I withdraw from combat entirely?
FIELD< INT,piloting,"Piloting Skill",50>; // Piloting skill
FIELD< INT,gunnery,"Gunnery Skill",50>; // Gunnery skill/chance to hit
FIELD< FLOAT,minDelay,"Minimum fire Delay",1.0>; // Minimum amount of time I will wait between shots once a weapon is reloaded
FIELD< FLOAT,maxDelay,"Maximum fire Delay",2.0>; // Maximum amount of time I will wait between shots once a weapon is reloaded
FIELD< INT,takeOffDistance,"Take off distance",150>;
FIELD< INT,eliteLevel,"Elite Level",60>; // Elite level. This helps determine tactics, defensive manuevers, opportunity fire
// and other things. It indicates a general level of combat experience.
FIELD< INT,isShotRadius,"Is Shot Radius",120>; // How far away from me will I detect an enemy shot?
FIELD< INT,attackThrottle,"Percent throttle when in combat",80>;
FIELD< INT,tower,"Unit ID of the Turret Tower",-1>;
}
fsm Generic_Turret : integer;
//------------------------------------------------------------------
// Generic_Turret:
// This shoots anything that comes near, but never moves.
// It can be used for turrets.
//------------------------------------------------------------------
//------------------------------------------------------------------
// Constants
//------------------------------------------------------------------
const
#include_ <content\ABLScripts\mwconst.abi>
//------------------------------------------------------------------
// Types
//------------------------------------------------------------------
type
#include_ <content\ABLScripts\mwtype.abi>
//------------------------------------------------------------------
// Variables
//------------------------------------------------------------------
var
static integer attackRange; // At what range do I start shooting?
static integer withdrawRange; // At what range do I stop attacking?
static ObjectID turretTower; // My control tower: if destroyed, I stop firing
static integer piloting; // Piloting skill
static integer gunnery; // Gunnery skill/chance to hit
static real minDelay; // Minimum amount of time I will wait between shots once a weapon is reloaded
static real maxDelay; // Maximum amount of time I will wait between shots once a weapon is reloaded
static integer eliteLevel; // Elite level. This helps determine tactics, defensive manuevers, opportunity fire
// and other things. It indicates a general level of combat experience.
static integer isShotRadius; // How far away from me will I detect an enemy shot?
static integer findTypes; // What kind of enemies to look for
static integer attackSound; // The attack sound I play when I first attack
static integer deathSound; // The sound I play when I die
static integer mood; // My default mood.
static integer takeOffDistance; // My take-off distance if I'm an airplane (ignored if not an airplane)
static integer attackThrottle; // My take-off distance if I'm an airplane (ignored if not an airplane)
//------------------------------------------------------------------
// Init: my initialization function
//------------------------------------------------------------------
function Init;
code
// Variables set by editor
attackRange = <attackRange>;
withdrawRange = <withdrawRange>;
takeOffDistance = <takeOffDistance>;
piloting = <piloting>;
gunnery = <gunnery>;
minDelay = <minDelay>;
maxDelay = <maxDelay>;
eliteLevel = <eliteLevel>;
isShotRadius = <isShotRadius>;
attackThrottle = <attackThrottle>;
turretTower = <tower>;
// takeOffDistance = 150;
attackSound = -1; // no sound
deathSound = -1; // no sound
mood = NEUTRAL_START;
findTypes = FT_DEFAULT;
endfunction;
//------------------------------------------------------------------
// StartState: my initial state
//------------------------------------------------------------------
state StartState;
code
SetFiringDelay (ME,minDelay,maxDelay);
SetIgnoreFriendlyFire (ME,true);
SetIsShotRadius (ME,isshotradius);
SetEntropyMood (ME,mood);
SetCurMood (ME,mood);
SetSkillLevel (ME,piloting,gunnery,elitelevel);
if (orderTakeOff(takeOffDistance) == true) then
trans WaitState;
endif;
endstate;
//------------------------------------------------------------------
// WaitState: wait for someone to come near
//------------------------------------------------------------------
state WaitState;
code
if (FindEnemy(attackRange,findTypes)) then
trans AttackState;
endif;
if (turretTower <> NO_UNIT) then
if (IsDead(turretTower) == true) then
trans TowerGoneState;
endif;
endif;
SetSensorVisibility(ME,FALSE);
OrderMoveLookOut;
endstate;
//------------------------------------------------------------------
// AttackState: let's see what's around, and destroy it
//------------------------------------------------------------------
state AttackState;
code
if (LeaveAttackState(withdrawRange)) then
OrderStopAttacking;
SetTarget(ME,NO_UNIT);
trans WaitState;
endif;
if (turretTower <> NO_UNIT) then
if (IsDead(turretTower) == true) then
trans TowerGoneState;
endif;
endif;
if (attackSound <> -1) then
PlaySoundOnce(attackSound);
endif;
SetSensorVisibility(ME,TRUE);
OrderAttackTactic(TACTIC_SHOOT_ONLY,true);
endstate;
//------------------------------------------------------------------
// TowerGoneState: my control tower is destroyed; I can do nothing
//------------------------------------------------------------------
state TowerGoneState;
code
SetTarget(ME,NO_UNIT);
OrderStopAttacking;
ClearMoveOrder(ME);
SetTargetDesirability(ME,-1);
SetSensorVisibility(ME,FALSE);
endstate;
//------------------------------------------------------------------
// DeadState: OK, I kicked the bucket.
//------------------------------------------------------------------
state DeadState;
code
if (deathSound <> -1) then
PlaySoundOnce(deathSound);
endif;
orderDie;
endstate;
endfsm.
@@ -0,0 +1,178 @@
UIFIELDS
{
FIELD< INT,attackRange,"Attack Range",500>; // At what range do I start shooting?
FIELD< INT,withdrawRange,"Withdraw Range",750>; // At what range do I withdraw from combat entirely?
FIELD< INT,piloting,"Piloting Skill",50>; // Piloting skill
FIELD< INT,gunnery,"Gunnery Skill",50>; // Gunnery skill/chance to hit
FIELD< FLOAT,minDelay,"Minimum fire Delay",1.0>; // Minimum amount of time I will wait between shots once a weapon is reloaded
FIELD< FLOAT,maxDelay,"Maximum fire Delay",2.0>; // Maximum amount of time I will wait between shots once a weapon is reloaded
FIELD< INT,eliteLevel,"Elite Level",60>; // Elite level. This helps determine tactics, defensive manuevers, opportunity fire
// and other things. It indicates a general level of combat experience.
FIELD< INT,isShotRadius,"Is Shot Radius",120>; // How far away from me will I detect an enemy shot?
FIELD<INT, takeOffDistance,"Take Off Distance (ignored if not a plane)",160>;
FIELD<INT, attackThrottle,"Percent throttle when in combat",80>;
}
//------------------------------------------------------------------
// NOTE: The fsm name below MUST be changed in order for the
// script to be considered a unique entity!
fsm Generic_Ambush : integer;
//------------------------------------------------------------------
// Generic_Ambush:
// Shuts down, waits until an enemy comes near, and then attacks.
//------------------------------------------------------------------
//------------------------------------------------------------------
// Constants
//------------------------------------------------------------------
const
#include_ <content\ABLScripts\mwconst.abi>
//------------------------------------------------------------------
// Types
//------------------------------------------------------------------
type
#include_ <content\ABLScripts\mwtype.abi>
//------------------------------------------------------------------
// Variables
//------------------------------------------------------------------
var
static integer attackRange; // At what range do I start shooting?
static integer withdrawRange; // At what range do I withdraw from combat entirely?
static integer piloting; // Piloting skill
static integer gunnery; // Gunnery skill/chance to hit
static real minDelay; // Minimum amount of time I will wait between shots once a weapon is reloaded
static real maxDelay; // Maximum amount of time I will wait between shots once a weapon is reloaded
static integer eliteLevel; // Elite level. This helps determine tactics, defensive manuevers, opportunity fire
// and other things. It indicates a general level of combat experience.
static integer attackThrottle; // My attack throttle
static integer isShotRadius; // How far away from me will I detect an enemy shot?
static integer attackSound; // The attack sound I play when I first attack
static integer deathSound; // The sound I play when I die
static integer mood; // My default mood.
static integer takeOffDistance; // My take-off distance if I'm an airplane (ignored if not an airplane)
//------------------------------------------------------------------
// Init: my initialization function
//------------------------------------------------------------------
function Init;
code
// Variables set by editor
attackRange = <attackRange>;
withdrawRange = <withdrawRange>;
speed = <speed>;
takeOffDistance = <takeOffDistance>;
piloting = <piloting>;
gunnery = <gunnery>;
minDelay = <minDelay>;
maxDelay = <maxDelay>;
eliteLevel = <eliteLevel>;
isShotRadius = <isShotRadius>;
attackThrottle = <attackThrottle>;
// driver settings
attackSound = -1; // no sound
deathSound = -1; // no sound
mood = NEUTRAL_START;
endfunction;
//------------------------------------------------------------------
// StartState: my initial state
//------------------------------------------------------------------
state StartState;
code
SetFiringDelay (ME,minDelay,maxDelay);
SetIgnoreFriendlyFire (ME,true);
SetIsShotRadius (ME,isShotRadius);
SetEntropyMood (ME,mood);
SetCurMood (ME,mood);
SetSkillLevel (ME,piloting,gunnery,eliteLevel);
SetAttackThrottle (ME,attackThrottle);
if (orderTakeOff(takeOffDistance) == true) then
trans WaitToAmbushState;
endif;
endstate;
//------------------------------------------------------------------
// WaitInAmbushState: wait for someone to come close enough to attack
//------------------------------------------------------------------
state WaitToAmbushState;
code
Shutdown(ME);
if (FindEnemy(attackrange,FT_DEFAULT)) then
trans AttackState;
endif;
endstate;
//------------------------------------------------------------------
// AttackState: the ambush is over -- let's kick some ass!
//------------------------------------------------------------------
state AttackState;
code
if (LeaveAttackState(withdrawRange)) then
trans WaitToAmbushState;
endif;
if (attackSound <> -1) then
PlaySoundOnce(attackSound);
endif;
Startup(ME);
OrderAttack(TRUE);
endstate;
//------------------------------------------------------------------
// DeadState: OK, I kicked the bucket.
//------------------------------------------------------------------
state DeadState;
code
if (deathSound <> -1) then
PlaySoundOnce(deathSound);
endif;
orderDie;
endstate;
endfsm.
@@ -0,0 +1,172 @@
//*********************************************************************************
fsm GENERIC : integer;
//------------------------------------------------------------------
//
// Constant Definitions
//
//------------------------------------------------------------------
const
#include_ <content\ABLScripts\mwconst.abi>
//------------------------------------------------------------------
//
// Type Definitions
//
//------------------------------------------------------------------
type
#include_ <content\ABLScripts\mwtype.abi>
//------------------------------------------------------------------
//
// Variable Declarations
//
//------------------------------------------------------------------
var
eternal integer playermech;
static integer cinema_cut;
//------------------------------------------------------------------
//
// Init Function (automatically run first time through)
//
//------------------------------------------------------------------
function init;
var
integer i;
code
playermech = getplayervehicle(epl_player0);
GroupAddObject(GroupObjectId(1),playermech);
//GroupAddObject(GroupObjectId(X),eve_SOMETHING);
//SetGroupAI(groupobjectid(X),GROUPAI_MOODSQUAD);
cinema_cut = 0;
endfunction;
//------------------------------------------------------------------
//
// Main Code
//
//------------------------------------------------------------------
state startState;
code
//playsound(eso_start);
//setactivationdistance(6800);
//trans opening;
trans sit;
endstate;
state deadState;
code
endstate;
//------------------------------------------------------------------
//
// Sit state : description
//
//------------------------------------------------------------------
state sit;
code
//Reveal the objectives
//Fail the mission when the player dies
if (isdead(playermech)) then
failobjectiveall(9);
endif;
endstate;
//-----------------------------------------
//HERE THERE BE CINEMAS
//-----------------------------------------
state opening;
code
switch (cinema_cut)
case 0:
endcase;
case 1:
endcase;
case 2:
endcase;
case 3:
endcase;
endswitch;
endstate;
state won;
code
switch cinema_cut
case 0:
endcase;
case 1:
endcase;
endswitch;
endstate;
state lost;
code
switch cinema_cut
case 0:
endcase;
case 1:
endcase;
endswitch;
endstate;
endfsm.
//******************************************************************
@@ -0,0 +1,37 @@
fsm StockAbsoluteAttrition : integer;
const
#include_ <content\ABLScripts\mwconst.abi>
type
#include_ <content\ABLScripts\mwtype.abi>
function init;
code
SetupScoring_AbsoluteAttrition;
TeamSetNav(0,ena_Nav_Center);
endfunction;
state startState;
code
revealnavpoint(ena_Nav_Center);
setnavpoint(ena_Nav_Center);
trans SitState;
endstate;
state sitState;
code
endstate;
state deadState;
code
endstate;
endfsm.
@@ -0,0 +1,29 @@
fsm StockAttrition : integer;
const
#include_ <content\ABLScripts\mwconst.abi>
type
#include_ <content\ABLScripts\mwtype.abi>
function init;
code
SetupScoring_Attrition;
TeamSetNav(0,ena_Nav_Center);
endfunction;
state startState;
code
revealnavpoint(ena_Nav_Center);
endstate;
state deadState;
code
endstate;
endfsm.
@@ -0,0 +1,37 @@
fsm StockAbsoluteAttrition : integer;
const
#include_ <content\ABLScripts\mwconst.abi>
type
#include_ <content\ABLScripts\mwtype.abi>
function init;
code
SetupScoring_Battle;
TeamSetNav(0,ena_Nav_Center);
endfunction;
state startState;
code
revealnavpoint(ena_Nav_Center);
setnavpoint(ena_Nav_Center);
trans SitState;
endstate;
state sitState;
code
endstate;
state deadState;
code
endstate;
endfsm.
@@ -0,0 +1,49 @@
fsm StockCaptureTheFlag : integer;
const
#include_ <content\ABLScripts\mwconst.abi>
type
#include_ <content\ABLScripts\mwtype.abi>
function init;
code
SetupScoring_CTF;
TeamSetNav(1,ena_Nav_Center);
TeamSetNav(2,ena_Nav_Center);
TeamSetNav(3,ena_Nav_Center);
TeamSetNav(4,ena_Nav_Center);
TeamSetNav(5,ena_Nav_Center);
TeamSetNav(6,ena_Nav_Center);
TeamSetNav(7,ena_Nav_Center);
TeamSetNav(8,ena_Nav_Center);
endfunction;
state startState;
code
revealnavpoint(ena_Nav_Center);
// revealnavpoint(ena_Team_1_Drop_Zone);
// revealnavpoint(ena_Team_2_Drop_Zone);
// revealnavpoint(ena_Team_3_Drop_Zone);
// revealnavpoint(ena_Team_4_Drop_Zone);
// revealnavpoint(ena_Team_5_Drop_Zone);
// revealnavpoint(ena_Team_6_Drop_Zone);
// revealnavpoint(ena_Team_7_Drop_Zone);
// revealnavpoint(ena_Team_8_Drop_Zone);
revealnavpoint(ena_Team_1);
revealnavpoint(ena_Team_2);
endstate;
state deadState;
code
endstate;
endfsm.
@@ -0,0 +1,65 @@
fsm StockCaptureBase : integer;
const
#include_ <content\ABLScripts\mwconst.abi>
type
#include_ <content\ABLScripts\mwtype.abi>
var
static ObjectID baseBuilding1;
static ObjectID baseBuilding2;
static ObjectID baseBuilding3;
static ObjectID baseBuilding4;
static ObjectID baseBuilding5;
static ObjectID baseBuilding6;
static ObjectID baseBuilding7;
static ObjectID baseBuilding8;
function CheckIfBuildingDestroyed(ObjectID building, integer team) : integer;
code
if (building <> -1) then
if (IsDead(building)) then
Destroy(TeamObjectID(team));
return (1);
endif;
endif;
return (0);
endfunction;
function init;
code
baseBuilding1 = -1;
baseBuilding2 = -1;
baseBuilding3 = -1;
baseBuilding4 = -1;
baseBuilding5 = -1;
baseBuilding6 = -1;
baseBuilding7 = -1;
baseBuilding8 = -1;
SetupScoring_CaptureBase;
endfunction;
state startState;
code
CheckIfBuildingDestroyed(baseBuilding1,1);
CheckIfBuildingDestroyed(baseBuilding2,2);
CheckIfBuildingDestroyed(baseBuilding3,3);
CheckIfBuildingDestroyed(baseBuilding4,4);
CheckIfBuildingDestroyed(baseBuilding5,5);
CheckIfBuildingDestroyed(baseBuilding6,6);
CheckIfBuildingDestroyed(baseBuilding7,7);
CheckIfBuildingDestroyed(baseBuilding8,8);
endstate;
state deadState;
code
endstate;
endfsm.
@@ -0,0 +1,40 @@
fsm StockClanVsInnerSphere : integer;
const
#include_ <content\ABLScripts\mwconst.abi>
type
#include_ <content\ABLScripts\mwtype.abi>
function init;
code
SetupScoring_ClanVsInnerSphere;
TeamSetNav(1,ena_Nav_Center);
TeamSetNav(2,ena_Nav_Center);
endfunction;
state startState;
code
revealnavpoint(ena_Nav_Center);
revealnavpoint(ena_Team_1_Drop_Zone);
revealnavpoint(ena_Team_2_Drop_Zone);
trans sitState;
endstate;
state sitState;
code
endstate;
state deadState;
code
endstate;
endfsm.
@@ -0,0 +1,46 @@
fsm StockDestroyObjective : integer;
const
#include_ <content\ABLScripts\mwconst.abi>
type
#include_ <content\ABLScripts\mwtype.abi>
var
static ObjectID objective;
function CheckIfObjectiveDestroyed(ObjectID obj) : integer;
var
ObjectID who_killed;
code
if (obj <> -1) then
if (IsDead(obj) == true) then
who_killed = WhoDestroyed(obj);
// TODO: objective dead
endif;
endif;
endfunction;
function init;
code
objective = -1;
SetupScoring_DestroyObjective;
endfunction;
state startState;
code
CheckIfObjectiveDestroyed(objective);
endstate;
state deadState;
code
endstate;
endfsm.
@@ -0,0 +1,29 @@
fsm StockDestruction : integer;
const
#include_ <content\ABLScripts\mwconst.abi>
type
#include_ <content\ABLScripts\mwtype.abi>
function init;
code
SetupScoring_Destruction;
TeamSetNav(0,ena_Nav_Center);
endfunction;
state startState;
code
revealnavpoint(ena_Nav_Center);
endstate;
state deadState;
code
endstate;
endfsm.
@@ -0,0 +1,179 @@
fsm Frostbite_Escort : integer;
const
#include_ <content\ABLScripts\mwconst.abi>
type
#include_ <content\ABLScripts\mwtype.abi>
var
static ObjectID Blue_goal1;
static ObjectID Blue_goal2;
static ObjectID Red_goal1;
static ObjectID Red_goal2;
static integer goal_distance;
static boolean Blue_vip_alive;
static boolean Red_vip_alive;
static ObjectID Blue_currentgoal;
static ObjectID Red_currentgoal;
static integer Blue_score_add;
static integer Red_score_add;
static integer Blue_VIP_team;
static integer Blue_Guard_team;
static integer Red_VIP_team;
static integer Red_Guard_team;
function UpdateRedTeamGoal;
code
TeamSetNav(4,Red_currentgoal);
endfunction;
function UpdateBlueTeamGoal;
code
TeamSetNav(3,Blue_currentgoal);
endfunction;
function init;
code
Blue_goal1 = ena_Nav_Alpha;
Blue_goal2 = ena_Nav_Beta;
Red_goal1 = ena_Nav_Beta;
Red_goal2 = ena_Nav_Alpha;
Blue_VIP_team = TeamObjectID(3);
Blue_Guard_team = TeamObjectID(1);
Red_VIP_team = TeamObjectID(4);
Red_Guard_team = TeamObjectID(2);
goal_distance = 100;
Blue_score_add = 1000;
Red_score_add = 1000;
Blue_vip_alive = false;
Red_vip_alive = false;
Blue_currentgoal = Blue_goal2;
UpdateBlueTeamGoal;
Red_currentgoal = Red_goal2;
UpdateRedTeamGoal;
SetupScoring_Escort;
endfunction;
function BlueTeamScores;
code
AddPoints(Blue_VIP_team,Blue_score_add);
AddPoints(Blue_Guard_team,Blue_score_add);
if (Blue_score_add < 4000000) then
Blue_score_add = Blue_score_add + Blue_score_add;
endif;
endfunction;
function RefreshBlueTeam;
code
if (GroupAllDead(Blue_VIP_team) == true) then
Blue_score_add = 1000;
Blue_currentgoal = Blue_goal2;
Blue_vip_alive = false;
UpdateBlueTeamGoal;
else
if (Blue_vip_alive == false) then
Blue_vip_alive = true;
ChatMessage("Blue Team: Go to Nav Beta!");
endif;
if (IsWithin(Blue_VIP_team,Blue_currentgoal,goal_distance) == true) then
PlayTeamBettySound(3,SOUND_TRIGGER_NAVPOINT_REACHED);
BlueTeamScores;
if (Blue_currentgoal == Blue_goal2) then
Blue_currentgoal = Blue_goal1;
UpdateBlueTeamGoal;
ChatMessage("Blue Team Has Scored - Go to Nav Alpha!");
else
Blue_currentgoal = Blue_goal2;
UpdateBlueTeamGoal;
ChatMessage("Blue Team Has Scored - Go to Nav Beta!");
endif;
endif;
endif;
endfunction;
function RedTeamScores;
code
AddPoints(Red_VIP_team,Red_score_add);
AddPoints(Red_Guard_team,Red_score_add);
if (Red_score_add < 4000000) then
Red_score_add = Red_score_add + Red_score_add;
endif;
endfunction;
function RefreshRedTeam;
code
if (GroupAllDead(Red_VIP_team) == true) then
Red_score_add = 1000;
Red_currentgoal = Red_goal2;
Red_vip_alive = false;
UpdateRedTeamGoal;
else
if (Red_vip_alive == false) then
Red_vip_alive = true;
ChatMessage("Red Team: Go to Nav Alpha!");
endif;
if (IsWithin(Red_VIP_team,Red_currentgoal,goal_distance) == true) then
PlayTeamBettySound(4,SOUND_TRIGGER_NAVPOINT_REACHED);
RedTeamScores;
if (Red_currentgoal == Red_goal2) then
Red_currentgoal = Red_goal1;
UpdateRedTeamGoal;
ChatMessage("Red Team Has Scored - Go to Nav Beta!");
else
Red_currentgoal = Red_goal2;
UpdateRedTeamGoal;
ChatMessage("Red Team Has Scored - Go to Nav Alpha!");
endif;
endif;
endif;
endfunction;
state startState;
code
revealnavpoint(ena_Nav_Center);
revealnavpoint(ena_Nav_Alpha);
revealnavpoint(ena_Nav_Beta);
SetRadarNav(ena_Nav_Alpha,1);
SetRadarNav(ena_Nav_Beta,2);
trans goState;
endstate;
state goState;
code
RefreshBlueTeam;
RefreshRedTeam;
endstate;
state deadState;
code
endstate;
endfsm.
@@ -0,0 +1,41 @@
fsm StockGiantKillers : integer;
const
#include_ <content\ABLScripts\mwconst.abi>
type
#include_ <content\ABLScripts\mwtype.abi>
function init;
code
SetupScoring_GiantKillers;
TeamSetNav(1,ena_Nav_Center);
TeamSetNav(2,ena_Nav_Center);
endfunction;
state startState;
code
revealnavpoint(ena_Nav_Center);
revealnavpoint(ena_Team_1_Drop_Zone);
revealnavpoint(ena_Team_2_Drop_Zone);
trans sitState;
endstate;
state sitState;
code
endstate;
state deadState;
code
endstate;
endfsm.
@@ -0,0 +1,37 @@
fsm StockKingOfTheHill : integer;
const
#include_ <content\ABLScripts\mwconst.abi>
type
#include_ <content\ABLScripts\mwtype.abi>
var
static ObjectID hill_drop_zone;
static integer hill_radius;
function init;
code
hill_drop_zone = edr_hill;
hill_radius = 100;
SetupScoring_KOTH(hill_drop_zone,hill_radius);
TeamSetNav(0,ena_The_Hill);
endfunction;
state startState;
code
revealnavpoint(ena_The_Hill);
endstate;
state deadState;
code
endstate;
endfsm.
@@ -0,0 +1,31 @@
fsm Stock_MasterTrial : integer;
const
#include_ <content\ABLScripts\mwconst.abi>
type
#include_ <content\ABLScripts\mwtype.abi>
function init;
code
SetupScoring_MasterTrial;
TeamSetNav(1,ena_Nav_Center);
TeamSetNav(2,ena_Nav_Center);
endfunction;
state startState;
code
revealnavpoint(ena_Nav_Center);
revealnavpoint(ena_Blue_Team_Drop_Zone);
revealnavpoint(ena_Red_Team_Drop_Zone);
endstate;
state deadState;
code
endstate;
endfsm.
@@ -0,0 +1,30 @@
fsm StockStealTheBacon : integer;
const
#include_ <content\ABLScripts\mwconst.abi>
type
#include_ <content\ABLScripts\mwtype.abi>
function init;
code
SetupScoring_STB;
TeamSetNav(0,ena_The_Hill);
endfunction;
state startState;
code
revealnavpoint(ena_The_Hill);
endstate;
state deadState;
code
endstate;
endfsm.
@@ -0,0 +1,196 @@
fsm StockSiegeAssault : integer;
const
#include_ <content\ABLScripts\mwconst.abi>
type
#include_ <content\ABLScripts\mwtype.abi>
var
static ObjectID Blue_goal1;
static ObjectID Blue_goal2;
static ObjectID Red_goal1;
static ObjectID Red_goal2;
static integer Blue_score_add;
static integer Red_score_add;
static integer Blue_Guard_team;
static integer Red_Guard_team;
static boolean Winning;
static boolean RedHQ; // This is whether the Red HQ building is alive
static boolean RedComm; // This is whether the Red Comm building is alive
// Timers
static integer game_timer;
static integer pause_timer;
static integer toggler; // This makes it so there is a lengthier pause b/n some sounds
function PlayBigAlerts;
code
PlayTeamBettySound(1,SOUND_TRIGGER_MISSILE_LOCKED_ON_ME);
PlayTeamBettySound(2,SOUND_TRIGGER_MISSILE_LOCKED_ON_ME);
Return;
endfunction;
function PlaySmallAlerts;
code
PlayTeamBettySound(1,SOUND_TRIGGER_NARC_SIGNAL_START);
PlayTeamBettySound(2,SOUND_TRIGGER_NARC_SIGNAL_START);
Return;
endfunction;
function init;
code
SetupScoring_SiegeAssault;
// Goal for Team 1 - Kill this
GroupAddObject(GroupObjectId(20),ebu_Red_HQ);
GroupAddObject(GroupObjectId(20),ebu_Red_Communications);
MarkBuildingAsScorable(ebu_Red_HQ);
MarkBuildingAsScorable(ebu_Red_Communications);
Blue_Guard_team = TeamObjectID(1);
Red_Guard_team = TeamObjectID(2);
Blue_score_add = 350;
Red_score_add = 350;
LogDefendingTeam(team2);
// Misc Setup
winning = false;
// Timers
game_timer = gti_timer_1;
pause_timer = gti_timer_2;
endfunction;
function BlueTeamScores;
code
AddPoints(Blue_Guard_team,Blue_score_add);
endfunction;
function RedTeamScores;
code
AddPoints(Red_Guard_team,Red_score_add);
endfunction;
state StartState;
code
revealnavpoint(ena_Nav_Center);
revealnavpoint(ena_Blue_Drop_Zone);
revealnavpoint(ena_Red_Base);
TeamSetNav(1,ena_Red_Base);
TeamSetNav(2,ena_Nav_Center);
//ChatMessage("Game Starting.");
//StartTimer(1); // This is to make sure everyone is in
StartTimer(3); // This is the defense point timer
ResetTimer(3);
StartTimer(4); // This is the timer for the warning messages about buildings
ResetTimer(4);
ResetTimer(Game_Timer);
trans GoState;
endstate;
state goState;
code
if (timegreater(game_timer,90)) then
if (timegreater(3,30)) then
AddPoints(Red_Guard_team,125);
LogDefendTimeAward(team2,125);
PlaySmallalerts;
ResetTimer(3);
endif;
endif;
if (GroupAllDead(GroupObjectID(20))) then
BlueTeamScores;
PlayBigAlerts;
ChatMessage("Red Base has been destroyed!");
// ChatMessage("Respawn 2x slowly in 5");
ChatMessage("Respawn in 5 seconds.");
ResetTimer(Pause_Timer);
trans deadstate;
endif;
if (timegreater(4,5)) then
if (not RedComm) then
if (isshot(GroupObjectID(20))) then
if (toggler>3) then
PlayTeamBettySound(2,SOUND_TRIGGER_ALARM1);
ChatMessage("Red Base buildings are under attack.");
toggler = 0;
endif;
endif;
endif;
if (not RedHQ) then
if (isdead(ebu_Red_HQ)) then
BlueTeamScores;
PlayTeamBettySound(1,SOUND_TRIGGER_ALARM2);
PlayTeamBettySound(2,SOUND_TRIGGER_ALARM2);
ChatMessage("Red HQ has been destroyed.");
RedHQ = true;
endif;
endif;
if (not RedComm) then
if (isdead(ebu_Red_Communications)) then
BlueTeamScores;
PlayTeamBettySound(1,SOUND_TRIGGER_ALARM2);
PlayTeamBettySound(2,SOUND_TRIGGER_ALARM2);
ChatMessage("Red Communications has been destroyed.");
RedComm = true;
endif;
endif;
Toggler = Toggler + 1;
resettimer(4);
endif;
endstate;
state deadState;
code
if (timegreater (pause_timer,5)) then
LogHQDestroyed(team2,team1);
LogMMapRespawn;
Winning = False;
RedComm = False;
RedHQ = False;
RespawnMission;
ResetTimer(Pause_timer);
//ChatMessage("Respawn Done, one more in 5 sec.");
// ChatMessage("Respawn in 5");
ChatMessage("Game respawned.");
// trans RestartState;
trans Startstate
endif;
endstate;
/* state RestartState;
code
if (timegreater (pause_timer,5)) then
ResetTimer(Game_Timer);
ResetTimer(Pause_Timer);
RespawnMission;
ChatMessage("2nd Respawn done.");
trans StartState;
endif;
endstate; */
endfsm.
@@ -0,0 +1,30 @@
fsm StockStealTheBacon : integer;
const
#include_ <content\ABLScripts\mwconst.abi>
type
#include_ <content\ABLScripts\mwtype.abi>
function init;
code
SetupScoring_STB;
TeamSetNav(0,ena_The_Hill);
endfunction;
state startState;
code
revealnavpoint(ena_The_Hill);
endstate;
state deadState;
code
endstate;
endfsm.
@@ -0,0 +1,234 @@
fsm StockStrongholds : integer;
const
#include_ <content\ABLScripts\mwconst.abi>
type
#include_ <content\ABLScripts\mwtype.abi>
var
static ObjectID Blue_goal1;
static ObjectID Blue_goal2;
static ObjectID Red_goal1;
static ObjectID Red_goal2;
static integer Blue_score_add;
static integer Red_score_add;
static integer game_timer;
static integer pause_timer;
static integer respawn_timer;
static integer Blue_Guard_team;
static integer Red_Guard_team;
static boolean winning;
static boolean RedHQ; // This is whether the Red HQ building is alive
static boolean RedComm; // This is whether the Red Comm building is alive
static boolean BlueHQ; // This is whether the Blue HQ building is alive
static boolean BlueComm; // This is whether the Blue Comm building is alive
static integer toggler1; // This makes it so there is a lengthier pause b/n some sounds
static integer toggler2; // This makes it so there is a lengthier pause b/n some sounds
function PlayBigAlerts;
code
PlayTeamBettySound(1,SOUND_TRIGGER_MISSILE_LOCKED_ON_ME);
PlayTeamBettySound(2,SOUND_TRIGGER_MISSILE_LOCKED_ON_ME);
Return;
endfunction;
function PlaySmallAlerts;
code
PlayTeamBettySound(1,SOUND_TRIGGER_NARC_SIGNAL_START);
PlayTeamBettySound(2,SOUND_TRIGGER_NARC_SIGNAL_START);
Return;
endfunction;
function init;
code
// Goal for Team 2 - Kill this
GroupAddObject(GroupObjectId(20),ebu_Blue_HQ);
GroupAddObject(GroupObjectId(20),ebu_Blue_Communications);
MarkBuildingAsScorable(ebu_Blue_HQ);
MarkBuildingAsScorable(ebu_Blue_Communications);
// Goal for Team 1 - Kill this
GroupAddObject(GroupObjectId(30),ebu_Red_HQ);
GroupAddObject(GroupObjectId(30),ebu_Red_Communications);
MarkBuildingAsScorable(ebu_Red_HQ);
MarkBuildingAsScorable(ebu_Red_Communications);
Blue_Guard_team = TeamObjectID(1);
Red_Guard_team = TeamObjectID(2);
Blue_score_add = 350;
Red_score_add = 350;
SetupScoring_Strongholds;
// Misc setup
winning = false;
game_timer = gti_timer_1;
pause_timer = gti_timer_2;
respawn_timer = gti_timer_3;
endfunction;
function BlueTeamScores;
code
AddPoints(Blue_Guard_team,Blue_score_add);
endfunction;
function RedTeamScores;
code
AddPoints(Red_Guard_team,Red_score_add);
endfunction;
state StartState;
code
revealnavpoint(ena_Nav_Center);
revealnavpoint(ena_Blue_Base);
revealnavpoint(ena_Red_Base);
TeamSetNav(1,ena_Red_Base);
TeamSetNav(2,ena_Blue_Base);
ResetTimer(Game_timer);
StartTimer(4); // This is the timer for the warning messages about buildings
ResetTimer(4);
trans goState;
endstate;
state goState;
code
if (not winning) then
if (GroupAllDead(GroupObjectID(20))) then
RedTeamScores;
ChatMessage("Blue Team's Base has been destroyed!");
ChatMessage("Respawn in 5 seconds.");
LogHQDestroyed(team1,team2);
ResetTimer(Pause_Timer);
ResetTimer(Respawn_Timer);
winning = true;
trans deadState;
endif;
endif;
if (not winning) then
if (GroupAllDead(GroupObjectID(30))) then
BlueTeamScores;
ChatMessage("Red Team's Base has been destroyed!");
ChatMessage("Respawn in 5 seconds.");
LogHQDestroyed(team2,team1);
ResetTimer(Pause_Timer);
ResetTimer(Respawn_Timer);
winning = true;
trans deadState;
endif;
endif;
if (timegreater(4,5)) then
if (not RedComm) then
if (isshot(GroupObjectID(30))) then
if (toggler1>3) then
PlayTeamBettySound(2,SOUND_TRIGGER_ALARM1);
ChatMessage("Red base is under attack.");
toggler1=0;
endif;
endif;
endif;
if (not RedHQ) then
if (isdead(ebu_Red_HQ)) then
BlueTeamScores;
ChatMessage("Red HQ has been destroyed.");
PlayTeamBettySound(1,SOUND_TRIGGER_ALARM2);
PlayTeamBettySound(2,SOUND_TRIGGER_ALARM2);
PlayBigAlerts;
RedHQ = true;
endif;
endif;
if (not RedComm) then
if (isdead(ebu_Red_Communications)) then
BlueTeamScores;
PlayTeamBettySound(1,SOUND_TRIGGER_ALARM2);
PlayTeamBettySound(2,SOUND_TRIGGER_ALARM2);
ChatMessage("Red Communications has been destroyed.");
PlayBigAlerts;
RedComm = true;
endif;
endif;
if (not BlueComm) then
if (isshot(GroupObjectID(20))) then
if (toggler2>3) then
PlayTeamBettySound(1,SOUND_TRIGGER_ALARM1);
ChatMessage("Blue base is under attack.");
toggler2=0;
endif;
endif;
endif;
if (not BlueHQ) then
if (isdead(ebu_Blue_HQ)) then
RedTeamScores;
PlayTeamBettySound(1,SOUND_TRIGGER_ALARM2);
PlayTeamBettySound(2,SOUND_TRIGGER_ALARM2);
ChatMessage("Blue HQ has been destroyed.");
PlayBigAlerts;
BlueHQ = true;
endif;
endif;
if (not BlueComm) then
if (isdead(ebu_Blue_Communications)) then
RedTeamScores;
PlayTeamBettySound(1,SOUND_TRIGGER_ALARM2);
PlayTeamBettySound(2,SOUND_TRIGGER_ALARM2);
ChatMessage("Blue Communications has been destroyed.");
PlayBigAlerts;
BlueComm = true;
endif;
endif;
Toggler1 = Toggler1 + 1;
Toggler2 = Toggler2 + 1;
resettimer(4);
endif;
if (not ismusicplaying) then
StartMusic("Music\DesertAmbLoop",0.0,10.0,20);
endif;
endstate;
state deadState;
code
if (timegreater (pause_timer,5)) then
LogMMapRespawn;
Winning = False;
RedComm = False;
RedHQ = False;
BlueComm = False;
BlueHQ = False;
RespawnMission;
ResetTimer(Pause_timer);
//ChatMessage("Respawn Done, one more in 5 sec.");
// ChatMessage("Respawn in 5");
ChatMessage("Game respawned.");
// trans RestartState;
trans Startstate
endif;
endstate;
state over;
code
endstate;
endfsm.
@@ -0,0 +1,52 @@
fsm StockTeamKingOfTheHill : integer;
const
#include_ <content\ABLScripts\mwconst.abi>
type
#include_ <content\ABLScripts\mwtype.abi>
var
static ObjectID hill_drop_zone;
static integer hill_radius;
function init;
code
hill_drop_zone = edr_hill;
hill_radius = 100;
SetupScoring_TKOTH(hill_drop_zone,hill_radius);
TeamSetNav(1,ena_The_Hill);
TeamSetNav(2,ena_The_Hill);
TeamSetNav(3,ena_The_Hill);
TeamSetNav(4,ena_The_Hill);
TeamSetNav(5,ena_The_Hill);
TeamSetNav(6,ena_The_Hill);
TeamSetNav(7,ena_The_Hill);
TeamSetNav(8,ena_The_Hill);
endfunction;
state startState;
code
revealnavpoint(ena_The_Hill);
revealnavpoint(ena_Team_1_Drop_Zone);
revealnavpoint(ena_Team_2_Drop_Zone);
revealnavpoint(ena_Team_3_Drop_Zone);
revealnavpoint(ena_Team_4_Drop_Zone);
revealnavpoint(ena_Team_5_Drop_Zone);
revealnavpoint(ena_Team_6_Drop_Zone);
revealnavpoint(ena_Team_7_Drop_Zone);
revealnavpoint(ena_Team_8_Drop_Zone);
endstate;
state deadState;
code
endstate;
endfsm.
@@ -0,0 +1,50 @@
fsm StockTeamAbsoluteAttrition : integer;
const
#include_ <content\ABLScripts\mwconst.abi>
type
#include_ <content\ABLScripts\mwtype.abi>
function init;
code
SetupScoring_TeamAbsoluteAttrition;
TeamSetNav(1,ena_Nav_Center);
TeamSetNav(2,ena_Nav_Center);
TeamSetNav(3,ena_Nav_Center);
TeamSetNav(4,ena_Nav_Center);
TeamSetNav(5,ena_Nav_Center);
TeamSetNav(6,ena_Nav_Center);
TeamSetNav(7,ena_Nav_Center);
TeamSetNav(8,ena_Nav_Center);
endfunction;
state startState;
code
revealnavpoint(ena_Nav_Center);
revealnavpoint(ena_Team_1_Drop_Zone);
revealnavpoint(ena_Team_2_Drop_Zone);
revealnavpoint(ena_Team_3_Drop_Zone);
revealnavpoint(ena_Team_4_Drop_Zone);
revealnavpoint(ena_Team_5_Drop_Zone);
revealnavpoint(ena_Team_6_Drop_Zone);
revealnavpoint(ena_Team_7_Drop_Zone);
revealnavpoint(ena_Team_8_Drop_Zone);
trans sitState;
endstate;
state sitState;
code
endstate;
state deadState;
code
endstate;
endfsm.
@@ -0,0 +1,45 @@
fsm StockTeamAttrition : integer;
const
#include_ <content\ABLScripts\mwconst.abi>
type
#include_ <content\ABLScripts\mwtype.abi>
function init;
code
SetupScoring_TeamAttrition;
TeamSetNav(1,ena_Nav_Center);
TeamSetNav(2,ena_Nav_Center);
TeamSetNav(3,ena_Nav_Center);
TeamSetNav(4,ena_Nav_Center);
TeamSetNav(5,ena_Nav_Center);
TeamSetNav(6,ena_Nav_Center);
TeamSetNav(7,ena_Nav_Center);
TeamSetNav(8,ena_Nav_Center);
endfunction;
state startState;
code
revealnavpoint(ena_Nav_Center);
revealnavpoint(ena_Team_1_Drop_Zone);
revealnavpoint(ena_Team_2_Drop_Zone);
revealnavpoint(ena_Team_3_Drop_Zone);
revealnavpoint(ena_Team_4_Drop_Zone);
revealnavpoint(ena_Team_5_Drop_Zone);
revealnavpoint(ena_Team_6_Drop_Zone);
revealnavpoint(ena_Team_7_Drop_Zone);
revealnavpoint(ena_Team_8_Drop_Zone);
endstate;
state deadState;
code
endstate;
endfsm.
@@ -0,0 +1,50 @@
fsm StockTeamAbsoluteAttrition : integer;
const
#include_ <content\ABLScripts\mwconst.abi>
type
#include_ <content\ABLScripts\mwtype.abi>
function init;
code
SetupScoring_TeamBattle;
TeamSetNav(1,ena_Nav_Center);
TeamSetNav(2,ena_Nav_Center);
TeamSetNav(3,ena_Nav_Center);
TeamSetNav(4,ena_Nav_Center);
TeamSetNav(5,ena_Nav_Center);
TeamSetNav(6,ena_Nav_Center);
TeamSetNav(7,ena_Nav_Center);
TeamSetNav(8,ena_Nav_Center);
endfunction;
state startState;
code
revealnavpoint(ena_Nav_Center);
revealnavpoint(ena_Team_1_Drop_Zone);
revealnavpoint(ena_Team_2_Drop_Zone);
revealnavpoint(ena_Team_3_Drop_Zone);
revealnavpoint(ena_Team_4_Drop_Zone);
revealnavpoint(ena_Team_5_Drop_Zone);
revealnavpoint(ena_Team_6_Drop_Zone);
revealnavpoint(ena_Team_7_Drop_Zone);
revealnavpoint(ena_Team_8_Drop_Zone);
trans sitState;
endstate;
state sitState;
code
endstate;
state deadState;
code
endstate;
endfsm.
@@ -0,0 +1,44 @@
fsm StockTeamDestruction : integer;
const
#include_ <content\ABLScripts\mwconst.abi>
type
#include_ <content\ABLScripts\mwtype.abi>
function init;
code
SetupScoring_TeamDestruction;
TeamSetNav(1,ena_Nav_Center);
TeamSetNav(2,ena_Nav_Center);
TeamSetNav(3,ena_Nav_Center);
TeamSetNav(4,ena_Nav_Center);
TeamSetNav(5,ena_Nav_Center);
TeamSetNav(6,ena_Nav_Center);
TeamSetNav(7,ena_Nav_Center);
TeamSetNav(8,ena_Nav_Center);
endfunction;
state startState;
code
revealnavpoint(ena_Nav_Center);
revealnavpoint(ena_Team_1_Drop_Zone);
revealnavpoint(ena_Team_2_Drop_Zone);
revealnavpoint(ena_Team_3_Drop_Zone);
revealnavpoint(ena_Team_4_Drop_Zone);
revealnavpoint(ena_Team_5_Drop_Zone);
revealnavpoint(ena_Team_6_Drop_Zone);
revealnavpoint(ena_Team_7_Drop_Zone);
revealnavpoint(ena_Team_8_Drop_Zone);
endstate;
state deadState;
code
endstate;
endfsm.
@@ -0,0 +1,32 @@
fsm StockTerritories : integer;
const
#include_ <content\ABLScripts\mwconst.abi>
type
#include_ <content\ABLScripts\mwtype.abi>
var
static ObjectID hill_drop_zone;
static integer hill_radius;
function init;
code
hill_drop_zone = -1;
hill_radius = 100;
SetupScoring_Territories(hill_drop_zone,hill_radius);
endfunction;
state startState;
code
endstate;
state deadState;
code
endstate;
endfsm.
@@ -0,0 +1,58 @@
//*********************************************************************************
fsm <fsm name> : integer;
//------------------------------------------------------------------
//
// Constant Definitions
//
//------------------------------------------------------------------
const
#include_ <content\ABLScripts\mwconst.abi>
//------------------------------------------------------------------
//
// Type Definitions
//
//------------------------------------------------------------------
type
#include_ <content\ABLScripts\mwtype.abi>
//------------------------------------------------------------------
//
// Variable Declarations
//
//------------------------------------------------------------------
var
//------------------------------------------------------------------
//
// Local Functions
//
//------------------------------------------------------------------
function init;
code
endfunction;
//------------------------------------------------------------------
//
// Main Code
//
//------------------------------------------------------------------
state startState;
code
endstate;
state deadState;
code
orderDie;
endstate;
endfsm.
//******************************************************************
@@ -0,0 +1,562 @@
library mwfunc;
const
#include_ "mwconst.abi"
type
#include_ "mwtype.abi"
var
static ObjectID last_sound_played;
static Boolean any_sounds_played;
//------------------------------------------------------------------------------------
function init;
code
any_sounds_played = FALSE;
endfunction;
function getRelativeAlignment (ObjectID p1,ObjectID p2) : integer;
var
integer align1;
integer align2;
code
align1 = getAlignment (p1);
align2 = getAlignment (p2);
if align2 == NEUTRAL_ALIGNMENT then
return (NEUTRAL);
endif;
if align1 <> align2 then
return (ENEMY);
endif;
return (FRIENDLY);
endfunction;
function SnapToGround(ObjectID obj);
var
LocPoint l;
code
getLocation(obj,l);
l[1] = -1;
teleport(obj,l);
endfunction;
function ProtectAGroup(integer group_num) : integer;
// This one may or may not work. Needs testing.
var
code
if (isShot (GroupObjectId(group_num))) then
if (getRelativeAlignment(me,WhoShot(GroupObjectId(group_num))) == ENEMY) then
setTarget(me,WhoShot(GroupObjectId(group_num)));
return (1);
endif;
endif;
return (0);
endfunction;
function GeneralPlayChatter(ObjectId sound,
integer which_timer, integer what_delay, integer what_chance);
// if Timer which_timer is over what_delay, there is a chance what_chance
// that the sound sound is played. After this, the timer is reset.
// use this function for easy handling of radio chatter.
// what_chance is a number from 0 to 1000. The percentage chance of the sound playing is
// what_chance / 10
var
code
if (any_sounds_played == TRUE) then
if (last_sound_played == sound) then
what_chance = -1;
endif;
endif;
if (TimeGreater(which_timer,what_delay)) then
if (Rand(0,1000) <= what_chance) then
PlaySound(sound);
last_sound_played = sound;
any_sounds_played = TRUE;
ResetTimer(which_timer);
endif;
endif;
endfunction;
function SetMyTarget(integer searchrange) : boolean;
var
integer foe;
code
foe = FindObject(ME,FA_ENEMY,FT_DEFAULT,FC_BEST_TARGET,FF_WHO_SHOT + FF_SEEPLAYER,searchrange);
if (foe <> no_unit) then
SetTarget (me,foe);
return (true);
endif;
return (false);
endfunction;
function FindEnemy(integer searchrange, integer flags) : boolean;
var
integer foe;
code
foe = FindObject(ME,FA_ENEMY,flags,FC_BEST_TARGET,FF_WHO_SHOT + FF_SEEPLAYER,searchrange);
if (foe <> no_unit) then
SetTarget (me,foe);
return (true);
endif;
return (false);
endfunction;
function Bot_FindEnemy(integer searchrange) : boolean;
var
integer foe;
code
foe = FindObject(ME,FA_ENEMY,FT_DEFAULT,FC_BEST_TARGET,FF_WHO_SHOT + FF_SEEPLAYER + FF_LOOK_EVERYWHERE,searchrange);
if (foe <> no_unit) then
SetTarget (me,foe);
return (true);
endif;
return (false);
endfunction;
function LeaveAttackState(integer withdrawrange) : boolean;
var
integer target;
code
target = gettarget(me);
//1. I somehow got here without a legitimate target
if (target < 0) then
return(true);
else
//2. My target is dead
if (isDead (target) == TRUE) then
return(true);
else
//3. My target has gotten too far from me
if ((isWithin(target,me,withdrawrange)) == FALSE) then
if (WhoShot(me) <> target) then
return(true);
endif;
endif;
endif;
endif;
return (false);
endfunction;
function PlayChatter(ObjectID who_speaks, ObjectId sound,
integer which_timer, integer what_delay, integer what_chance, Boolean check_combat);
// if Timer which_timer is over what_delay and unit who_speaks is
// alive, there is a chance what_chance
// that the sound sound is played. After this, the timer is reset.
// If check_combat is TRUE, the sound is only played if who_speaks is involved in a fight.
// use this function for easy handling of radio chatter.
// what_chance is a number from 0 to 1000. The percentage chance of the sound playing is
// what_chance / 10
var
code
if (any_sounds_played == TRUE) then
if (last_sound_played == sound) then
what_chance = -1;
endif;
endif;
if ((IsDead(who_speaks) == FALSE) and (TimeGreater(which_timer,what_delay))) then
if (Rand(0,1000) <= what_chance) then
if ((check_combat == FALSE) or
((check_combat == TRUE) and (IsShot(who_speaks)))) then
PlaySound(sound);
last_sound_played = sound;
any_sounds_played = TRUE;
ResetTimer(which_timer);
endif;
endif;
endif;
endfunction;
function GroupPlayChatter(integer group_who_speaks, ObjectId sound,
integer which_timer, integer what_delay, integer what_chance, Boolean check_combat);
// if Timer which_timer is over what_delay and group group_who_speaks is
// alive, there is a chance what_chance
// that the sound sound is played. After this, the timer is reset.
// If check_combat is TRUE, the sound is only played if the group is involved in a fight.
// use this function for easy handling of radio chatter.
// what_chance is a number from 0 to 1000. The percentage chance of the sound playing is
// what_chance / 10
var
code
if (any_sounds_played == TRUE) then
if (last_sound_played == sound) then
what_chance = -1;
endif;
endif;
if ((GroupAllDead(GroupObjectId(group_who_speaks)) == FALSE) and (TimeGreater(which_timer,what_delay))
and (Rand(0,1000) <= what_chance)) then
if ((check_combat == FALSE) or
((check_combat == TRUE) and (IsShot(GroupObjectId(group_who_speaks))))) then
PlaySound(sound);
last_sound_played = sound;
any_sounds_played = TRUE;
ResetTimer(which_timer);
endif;
endif;
endfunction;
// Cinema_ZoomOut():
// Does a generic zoom-out camera animation suitable for mission victory or failure cut scenes.
// "who" is the unit to zoom out from; it must be a single unit (typically the player's 'Mech).
// "unique_timer_id" is the ID of a timer that the function can use that's not used for anything
// else in any of the ABL scripts related to this mission.
// "duration" is how long the zoom-out sequence will last. 10 to 20 seconds is generally
// recommended, though this may be anything above 0. Since the distance to zoom out
// is fixed, a longer duration will mean a slower zoom-out.
function Cinema_ZoomOut(ObjectID who, integer unique_timer_id, real duration) : Boolean;
var
real time_remaining;
code
if (Not TimeGreater(unique_timer_id,0)) then
StartTimer(unique_timer_id);
Targetfollowobject(who);
camerafollowobject(who);
SetCameraFootShake(who,100);
TargetOffset(0.0,5.0,0.0,0.0,true);
CameraOffset(0.0,5.0,30.0,0.0,true);
return (false);
endif;
if (TimeGreater(unique_timer_id,duration)) then
return (true);
endif;
if (duration > 2.0) then
if (TimeGreater(unique_timer_id,2.0)) then
time_remaining = duration - 2.0;
TargetOffset(0.0,9.0,-20.0,time_remaining,true);
CameraOffset(0.0,40.0,150.0,time_remaining,true);
endif;
endif;
return (false);
endfunction;
// IsShotOrDead():
// Returns true if the unit was shot recently or is destroyed.
function IsShotOrDead(ObjectID who) : Boolean;
var
code
if (IsDead(who)) then
return (true);
endif;
return (IsShot(who));
endfunction;
// WhoShotOrKilled():
// Indicates who shot or destroyed a given unit
function WhoShotOrKilled(ObjectID who) : ObjectID;
var
code
if (IsDead(who)) then
return (WhoDestroyed(who));
endif;
if (IsShot(who) == false) then
return (WhoShot(who));
endif;
return (NO_UNIT);
endfunction;
// ReachedNav():
// Indicates whether a unit (or group or team) IsWithin() a nav point
function ReachedNav(ObjectID who, ObjectID nav) : Boolean;
var
code
return (IsWithin(who,nav,150));
endfunction;
function AddStandardBuckets;
var
code
TrackBucket(Bucket_KILLS,0,true);
TrackBucket(Bucket_DEATHS,0,true);
TrackBucket(Bucket_CUSTOM,0,true);
endfunction;
function SetupScoring_Attrition;
var
code
SetFlagsEnabled(FLAGS_HIDE);
SetCustomBucketNameIndex(843);
AddStandardBuckets;
AddCustomBucketParameter(Bucket_ENEMY_DAMAGE_INFLICT,1);
AddCustomBucketParameter(Bucket_FRIENDLY_DAMAGE_INFLICT,-1);
AddCustomBucketParameter(Bucket_ENEMY_KILLS,500);
AddCustomBucketParameter(Bucket_FRIENDLY_KILLS,-500);
AddCustomBucketParameter(Bucket_SUICIDES,-500);
AddCustomBucketParameter(Bucket_ENEMY_KILLS_BY_TONNAGE,5);
AddCustomBucketParameter(Bucket_ENEMY_COMPONENT_KILLS,50);
AddCustomBucketParameter(Bucket_FRIENDLY_COMPONENT_KILLS,-50);
endfunction;
function SetupScoring_Cthulu;
var
code
SetFlagsEnabled(FLAGS_HIDE);
SetCustomBucketNameIndex(843);
AddStandardBuckets;
AddCustomBucketParameter(Bucket_ENEMY_DAMAGE_INFLICT,1);
AddCustomBucketParameter(Bucket_FRIENDLY_DAMAGE_INFLICT,-1);
AddCustomBucketParameter(Bucket_SUICIDES,-500);
AddCustomBucketParameter(Bucket_ENEMY_KILLS_BY_TONNAGE,5);
AddCustomBucketParameter(Bucket_ENEMY_COMPONENT_KILLS,50);
AddCustomBucketParameter(Bucket_FRIENDLY_COMPONENT_KILLS,-50);
endfunction;
function SetupScoring_TeamAttrition;
var
code
SetFlagsEnabled(FLAGS_HIDE);
SetCustomBucketNameIndex(844);
AddStandardBuckets;
AddCustomBucketParameter(Bucket_ENEMY_DAMAGE_INFLICT,1);
AddCustomBucketParameter(Bucket_FRIENDLY_DAMAGE_INFLICT,-1);
AddCustomBucketParameter(Bucket_ENEMY_KILLS,500);
AddCustomBucketParameter(Bucket_FRIENDLY_KILLS,-500);
AddCustomBucketParameter(Bucket_SUICIDES,-500);
AddCustomBucketParameter(Bucket_ENEMY_KILLS_BY_TONNAGE,5);
AddCustomBucketParameter(Bucket_ENEMY_COMPONENT_KILLS,50);
AddCustomBucketParameter(Bucket_FRIENDLY_COMPONENT_KILLS,-50);
endfunction;
function SetupScoring_Destruction;
var
code
SetFlagsEnabled(FLAGS_HIDE);
SetCustomBucketNameIndex(845);
AddStandardBuckets;
AddCustomBucketParameter(Bucket_ENEMY_KILLS,1);
AddCustomBucketParameter(Bucket_SUICIDES,-1);
endfunction;
function SetupScoring_TeamDestruction;
var
code
SetFlagsEnabled(FLAGS_HIDE);
SetCustomBucketNameIndex(846);
AddStandardBuckets;
AddCustomBucketParameter(Bucket_ENEMY_KILLS,1);
AddCustomBucketParameter(Bucket_FRIENDLY_KILLS,-1);
AddCustomBucketParameter(Bucket_SUICIDES,-1);
endfunction;
function SetupScoring_STB;
var
code
SetFlagsEnabled(FLAGS_UNIVERSAL_ONLY);
SetFlagCaptureEnabled(false);
ShowFlagsAsNavPoints(TRUE);
SetCustomBucketNameIndex(850);
AddStandardBuckets;
AddCustomBucketParameter(Bucket_FLAG_HOLD_TIME,1);
endfunction;
function SetupScoring_KOTH(ObjectID hill, integer radius);
var
code
SetFlagsEnabled(FLAGS_HIDE);
if (hill <> -1) then
TrackObjectBucket(Bucket_OBJECTIVE_CONTESTED,hill,radius,false);
TrackObjectBucket(Bucket_OBJECTIVE_UNCONTESTED,hill,radius,false);
endif;
SetCustomBucketNameIndex(848);
AddStandardBuckets;
AddCustomBucketParameter(Bucket_OBJECTIVE_CONTESTED,1);
AddCustomBucketParameter(Bucket_OBJECTIVE_UNCONTESTED,5);
endfunction;
function SetupScoring_TKOTH(ObjectID hill, integer radius);
var
code
SetFlagsEnabled(FLAGS_HIDE);
if (hill <> -1) then
TrackObjectBucket(Bucket_OBJECTIVE_CONTESTED,hill,radius,false);
TrackObjectBucket(Bucket_OBJECTIVE_UNCONTESTED,hill,radius,false);
endif;
SetCustomBucketNameIndex(849);
AddStandardBuckets;
AddCustomBucketParameter(Bucket_OBJECTIVE_CONTESTED,1);
AddCustomBucketParameter(Bucket_OBJECTIVE_UNCONTESTED,5);
endfunction;
function SetupScoring_CTF;
var
code
SetFlagsEnabled(FLAGS_TEAM_ONLY);
ShowFlagsAsNavPoints(TRUE);
SetCustomBucketNameIndex(847);
AddStandardBuckets;
AddCustomBucketParameter(Bucket_FLAGS_CAPTURED,1000);
AddCustomBucketParameter(Bucket_ENEMY_KILLS,250);
AddCustomBucketParameter(Bucket_FRIENDLY_KILLS,-25);
AddCustomBucketParameter(Bucket_SUICIDES,-25);
endfunction;
function SetupScoring_Territories(ObjectID hill, integer radius);
var
code
SetFlagsEnabled(FLAGS_HIDE);
if (hill <> -1) then
TrackObjectBucket(Bucket_OBJECTIVE_UNCONTESTED,hill,radius,false);
endif;
SetCustomBucketNameIndex(852);
AddStandardBuckets;
AddCustomBucketParameter(Bucket_OBJECTIVE_UNCONTESTED,1);
endfunction;
function SetupScoring_CaptureBase;
var
code
SetFlagsEnabled(FLAGS_HIDE);
SetCustomBucketNameIndex(853);
AddStandardBuckets;
AddCustomBucketParameter(Bucket_ENEMY_KILLS,25);
AddCustomBucketParameter(Bucket_FRIENDLY_KILLS,-25);
AddCustomBucketParameter(Bucket_SUICIDES,-25);
endfunction;
function SetupScoring_DestroyObjective;
var
code
SetFlagsEnabled(FLAGS_HIDE);
SetCustomBucketNameIndex(854);
AddStandardBuckets;
// TODO: add scoring for objective destruction
AddCustomBucketParameter(Bucket_ENEMY_KILLS,25);
AddCustomBucketParameter(Bucket_FRIENDLY_KILLS,-25);
AddCustomBucketParameter(Bucket_SUICIDES,-25);
endfunction;
function SetupScoring_Escort;
var
code
SetFlagsEnabled(FLAGS_HIDE);
SetCustomBucketNameIndex(851);
AddStandardBuckets;
AddCustomBucketParameter(Bucket_ENEMY_KILLS,500);
AddCustomBucketParameter(Bucket_FRIENDLY_KILLS,-500);
AddCustomBucketParameter(Bucket_SUICIDES,-500);
endfunction;
function SetupScoring_SiegeAssault;
var
code
SetFlagsEnabled (FLAGS_HIDE);
SetCustomBucketNameIndex (862);
AddStandardBuckets;
AddCustomBucketParameter(Bucket_ENEMY_KILLS,25);
AddCustomBucketParameter(Bucket_FRIENDLY_KILLS,-25);
AddCustomBucketParameter(Bucket_SUICIDES,-25);
AddCustomBucketParameter(Bucket_ENEMY_BUILDING_KILLS,350);
AddCustomBucketParameter(Bucket_FRIENDLY_BUILDING_KILLS,-350);
AddCustomBucketParameter(Bucket_ENEMY_TURRET_KILLS,25);
AddCustomBucketParameter(Bucket_FRIENDLY_TURRET_KILLS,-25);
endfunction;
function SetupScoring_MasterTrial;
var
code
SetFlagsEnabled(FLAGS_HIDE);
SetCustomBucketNameIndex(861);
AddStandardBuckets;
AddCustomBucketParameter(Bucket_ENEMY_DAMAGE_INFLICT,1);
AddCustomBucketParameter(Bucket_FRIENDLY_DAMAGE_INFLICT,-1);
AddCustomBucketParameter(Bucket_ENEMY_KILLS,500);
AddCustomBucketParameter(Bucket_FRIENDLY_KILLS,-500);
AddCustomBucketParameter(Bucket_SUICIDES,-500);
endfunction;
code
print("mwfunc");
endlibrary.
+813
View File
@@ -0,0 +1,813 @@
//************************
//MW4 Mission Const Include File 4/8
//------------------------
//----------------
// Alignments
//----------------
ENEMY_ALIGNMENT = 2;
NEUTRAL_ALIGNMENT = 0;
FRIENDLY_ALIGNMENT = 1;
ENEMY = 2;
NEUTRAL = 0;
FRIENDLY = 1;
//----------------
// Units
//----------------
ME = -1;
NO_UNIT = -2;
//----------------
// Teams
//----------------
NO_TEAM = 8;
//----------------
// Timers
//----------------
gti_TIMER_0 = 0 ;
gti_TIMER_1 = 1 ;
gti_TIMER_2 = 2 ;
gti_TIMER_3 = 3 ;
gti_TIMER_4 = 4 ;
gti_TIMER_5 = 5 ;
gti_TIMER_6 = 6 ;
gti_TIMER_7 = 7 ;
gti_TIMER_8 = 8 ;
gti_TIMER_9 = 9 ;
gti_TIMER_10 = 10;
gti_TIMER_11 = 11;
gti_TIMER_12 = 12;
gti_TIMER_13 = 13;
gti_TIMER_14 = 14;
gti_TIMER_15 = 15;
gti_TIMER_16 = 16;
gti_TIMER_17 = 17;
gti_TIMER_18 = 18;
gti_TIMER_19 = 19;
gti_TIMER_20 = 20;
gti_TIMER_21 = 21;
gti_TIMER_22 = 22;
gti_TIMER_23 = 23;
gti_TIMER_24 = 24;
gti_TIMER_25 = 25;
gti_TIMER_26 = 26;
gti_TIMER_27 = 27;
gti_TIMER_28 = 28;
gti_TIMER_29 = 29;
gti_TIMER_30 = 30;
gti_TIMER_31 = 31;
//----------------
// Moods
// NOTE: The keywords and constants here must exactly match those in AI_Moods.hpp
// NOTE: "_START" indicates the low range of a mood; "_END" indicates the high range of a mood
//----------------
DESPERATE_START = 1;
DESPERATE_END = 2;
DEFENSIVE_START = 3;
DEFENSIVE_END = 4;
NEUTRAL_START = 5;
NEUTRAL_END = 6;
AGRESSIVE_START = 7;
AGRESSIVE_END = 8;
BRUTAL_START = 9;
BRUTAL_END = 10;
//----------------
// Paths
//----------------
MOVE_NOCYCLE = 1;
MOVE_CIRCLE = 2;
MOVE_SEESAW = 3;
//----------------
// FA_*: FindObject() Alignment Criteria
// NOTE: These can be combined arbitrarily by adding them together as desired.
// NOTE: The keywords and constants here must exactly match those in AI_FindObject.hpp
//----------------
FA_FRIENDLY = 1; // include friendly units
FA_ENEMY = 2; // include enemy units
FA_NEUTRAL = 4; // include neutral units
FA_ANY = 7; // include any units: = FA_FRIENDLY + FA_ENEMY + FA_NEUTRAL
//----------------
// FT_*: FindObject() Type Criteria
// NOTE: These can be combined arbitrarily by adding them together as desired.
// NOTE: The keywords and constants here must exactly match those in AI_FindObject.hpp
//----------------
FT_VEHICLE = 1; // if specified, include vehicles
FT_MECH = 2; // if specified, include 'Mechs
FT_AIRPLANE = 4; // if specified, include airplanes + helicopters
FT_BOAT = 8; // if specified, include boats
FT_MFB = 16; // if specified, include MFBs
FT_TURRET = 32; // if specified, include turrets
// the default:
FT_DEFAULT = 63; // include any units: = FT_VEHICLE + FT_MECH + FT_AIRPLANE + FT_BOAT + FT_MFB + FT_HOVER + FT_HELI + FT_BUILDING
// extras not included in the default
FT_BUILDING = 64; // if specified, take buildings into account (NOTE: ONLY BUILDINGS WITH "PLAYER" OR "ENEMY" ALIGNMENT WILL BE COUNTED HERE -- NEUTRAL BUILDINGS ARE ALWAYS IGNORED!!!)
FT_UNARMED = 128; // if specified, include unarmed units (such as APCs)
//----------------
// FC_*: FindObject() Search Criteria
// NOTE: You cannot add these constants; you can use only one.
// NOTE: The keywords and constants here must exactly match those in AI_FindObject.hpp
//----------------
FC_BEST_TARGET = 1001; // find the "best target" based on multiple factors
// Currently, this is (0.45 * distance) + (0.35 * damage) +
// (0.2 * tonnage), but will become (0.4 * distance) +
// (0.3 * damage) + (0.2 * weapons) + (0.1 * tonnage)
// when we can query weapons' values for these attributes.
// The most desirable target is the one which is nearest, most
// badly damaged, largest, and has the most weapons.
FC_GREATEST_THREAT = 1002; // find the greatest immediate threat
// currently, this is (0.6 * distance) + (0.4 * tonnage),
// but "tonnage" will be replaced with "weapons" eventually.
FC_LEAST_THREAT = 1003; // find the least immediate threat
// Each vehicle evaluates to 1 - (its score for FQ_GREATEST_THREAT).
FC_MOST_DAMAGED = 1004; // find the most damaged object
// This is (1.0 * damage).
FC_NEAREST = 1005; // find the nearest object
// This is (1.0 * distance).
//----------------
// FF_*: FindObject() Flags
// NOTE: You can add these together to combine them, or specify 0 for none.
// NOTE: The keywords and constants here must exactly match those in AI_FindObject.hpp
//----------------
FF_WHO_SHOT = 1; // if specified and someone shot me, return that object, overriding anything else
FF_SEEPLAYER = 2; // if specified, we can also see the player if within fog radius and if we're facing toward him
FF_LOOK_EVERYWHERE = 4; // if specified, we look through every potential enemy in the whole mission
// WARNING -- THIS CAN BE VERY EXPENSIVE!!! Use only on small, limited maps!
FF_TARGETLOS = 8; // if specified, will NOT return a target that is out of LOS
//----------------
// Tactics
// NOTE: The keywords and constants here must exactly match those in AI_Tactics.hpp
//----------------
TACTIC_PICK_BEST = 2000;
// Tells the Combat AI to pick the best tactic. This is the same as a generic OrderAttack().
TACTIC_STOP_AND_FIRE = 2001;
// Approach the targeted enemy to close range. Attempt to fire continuously at all times on approach and arrival.
TACTIC_RAM = 2002;
// Head toward the targeted enemy at all times while firing.
TACTIC_JOUST = 2003;
// Not yet implemented.
TACTIC_RUSH = 2004;
// Attempt to stay within close range of the enemy at all times and maneuver at a close range. Always fire.
TACTIC_HIT_AND_RUN = 2005;
// Approach the enemy, run away to a distant range, and repeat. Always fire.
TACTIC_FRONT = 2006;
// Attempt to stay in front of the enemy at all times. Always fire.
TACTIC_REAR = 2007;
// Attempt to stay several meters behind the enemy's back at all times. Always fire.
TACTIC_CIRCLE_OF_DEATH = 2008;
TACTIC_CIRCLE = 2008; // alternate name
// Attempt to circle around the enemy. Always fire.
TACTIC_BACK_UP_AND_FIRE = 2009;
// Flee the enemy while walking backwards to long weapons range. Always fire.
TACTIC_RETREAT = 2010;
// Flee the enemy. Do not fire.
TACTIC_CIRCLE_HOVER = 2011;
// Intended for helicopters. Hover in a circle around the enemy.
TACTIC_STRAFE = 2012;
// Intended for Shilone bombers. Strafe directly over the enemy.
TACTIC_STAND_GROUND = 2013;
// Hold still and fire at the target.
TACTIC_JUMP_AND_SHOOT = 2014;
// Stay in one place, and if the enemy is in range, jump over the nearby obstacles and shoot it.
// Similar to TACTIC_AMBUSH, this tactic is automatically quit if the target can see the AI unit
// (i.e. it has a clear line of sight to the unit) when the AI unit is standing on the ground.
TACTIC_SNIPE = 2015;
// Stay at maximum weapons range from the enemy. Wander around a bit to make yourself harder to hit.
// Fire at the enemy. Give up & switch to a new tactic if you can't fire after a certain amount of time.
TACTIC_SHOOT_ONLY = 2016;
// Only shoot; don't try to move under any circumstances. This is the ONLY tactic turrets can use.
TACTIC_DEFEND = 2017;
// Defend the current target from any potential enemies.
TACTIC_LOCAL_PATROL = 2018;
// Similar to TACTIC_STAND_GROUND, but the mech patrols randomly in a small area
TACTIC_SURRENDER = 2019;
// Stop, pitch torso down, put both arms up, and hold fire.
TACTIC_AMBUSH = 2020;
// Rush forward from behind your hiding place, fire, and walk backwards to the same spot again.
// Like TACTIC_JUMP_AND_SHOOT, this tactic is automatically quit if the target can see the AI unit
// (i.e. it has a clear line of sight to the unit) when the AI unit is standing in its hiding place
// (i.e. the spot where it was first given the attack order with this tactic).
TACTIC_DEATH_FROM_ABOVE = 2021;
TACTIC_DFA = 2021;
// Shoot whenever possible, and try to use jump jets to kick the target in the face.
// This will only ever be assigned to mechs with jump jets
// (or assigned explicitly by a designer -- make sure it is a mech that has jump jets!).
TACTIC_HELI_POPUP = 2022;
// For helicopters only ... will pop up and down over hills.
TACTIC_DIVE_BOMB = 2023;
// will dive-bomb the target (Nightshades and Peregrines only)
TACTIC_FAST_CIRCLE = 2024;
// Like Circle of Death, but only moves forwards, and tries to avoid stopping
TACTIC_STARE = 2025;
// Stand and stare evilly
//----------------
// Group AIs
// NOTE: The keywords and constants here must exactly match those in AI_Squad.hpp
//----------------
GROUPAI_NONE = 4000;
// No group AI.
GROUPAI_LANCEMATE = 4001;
// Uses lancemate AI -- all vehicles after the first are considered lancemates of the first.
GROUPAI_RADIOSQUAD = 4002;
// Serves no purpose other than to propagate IsShot() notifications through all members of the group
GROUPAI_MOODSQUAD = 4003;
// Same as a "radio squad," but members' moods are shared -- i.e. there is a single "group mood" that is
// affected proportionally by anything that happens to any individual unit, and each unit responds
// according to this group mood.
GROUPAI_FOCUSFIRESQUAD = 4004;
// Same as a "radio squad", but members use auto-targeting (see ABL SetAutoTargeting()) to
// pick on the same target most of the time.
//----------------
// Lancemate Commands
// NOTE: The keywords and constants here must exactly match those in AI_LancemateCommands.hpp
//----------------
LANCEMATE_DEFAULT = 5000; // default = no order
LANCEMATE_ATTACKPLAYERSTARGET = 5001;
LANCEMATE_DEFENDPLAYERSTARGET = 5002;
LANCEMATE_FORMONME = 5003;
LANCEMATE_HOLDFIRE = 5004;
LANCEMATE_GOTOMYNAVPOINT = 5005;
LANCEMATE_STOP = 5006;
LANCEMATE_SHUTDOWN = 5007;
LANCEMATE_ATTACKNEARESTTHREAT = 5008;
LANCEMATE_REPAIRATNEARESTREPAIRBAY = 5009;
LANCEMATE_CAPTUREPLAYERSFLAG = 5010;
//----------------
// Formation Types
// NOTE: The keywords and constants here must exactly match those in move_formation.hpp
//----------------
FORMTYPE_SPARSE = 1;
FORMTYPE_NORMAL = 2;
FORMTYPE_DENSE = 3;
//----------------
// Objective Status
// NOTE: The keywords and constants here must exactly match those in objective.hpp
//----------------
OBJECTIVE_NEUTRAL = 2;
OBJECTIVE_SUCCEEDED = 1;
OBJECTIVE_FAILED = 0;
//----------------
// Difficulty Levels
// NOTE: The keywords and constants here must exactly match those in mwplayer.hpp
//----------------
EASY_DIFFICULTY = 0;
MEDIUM_DIFFICULTY = 1;
HARD_DIFFICULTY = 2;
IMPOSSIBLE_DIFFICULTY = 3;
//----------------
// Different players
//----------------
epl_player0 = 0;
epl_player1 = 1;
epl_player2 = 2;
epl_player3 = 3;
epl_player4 = 4;
epl_player5 = 5;
epl_player6 = 6;
epl_player7 = 7;
epl_player8 = 8;
epl_player9 = 9;
epl_player10 = 10;
epl_player11 = 11;
epl_player12 = 12;
epl_player13 = 13;
epl_player14 = 14;
epl_player15 = 15;
epl_player16 = 16;
epl_player17 = 17;
epl_player18 = 18;
epl_player19 = 19;
epl_player20 = 20;
epl_player21 = 21;
epl_player22 = 22;
epl_player23 = 23;
epl_player24 = 24;
epl_player25 = 25;
epl_player26 = 26;
epl_player27 = 27;
epl_player28 = 28;
epl_player29 = 29;
epl_player30 = 30;
epl_player31 = 31;
Bucket_KILL_LINK = 0;
Bucket_DEATH_LINK = 1;
Bucket_KILLS = 2; // How many kills I can take credit for
Bucket_FRIENDLY_KILLS = 3; // How many friendly-fire kills I've committed
Bucket_ENEMY_KILLS = 4; // How many enemies I've killed
Bucket_KILLS_BY_TONNAGE = 5; // Total tonnage of everyone I've killed
Bucket_FRIENDLY_KILLS_BY_TONNAGE = 6; // Total tonnage of all friendlies I've killed
Bucket_ENEMY_KILLS_BY_TONNAGE = 7; // Total tonnage of all enemies I've killed
Bucket_DEATHS = 8; // How many times I've died
Bucket_SUICIDES = 9; // How many times I killed myself
Bucket_DAMAGE_INFLICT = 10; // How much damage I've inflicted
Bucket_FRIENDLY_DAMAGE_INFLICT = 11; // How much damage I've inflicted on friendlies
Bucket_ENEMY_DAMAGE_INFLICT = 12; // How much damage I've inflicted on enemies
Bucket_DAMAGE_RECEIVE = 13; // How much damage I've received
Bucket_FRIENDLY_DAMAGE_RECEIVE = 14; // How much damage I've received from friendlies
Bucket_ENEMY_DAMAGE_RECEIVE = 15; // How much damage I've received from enemies
Bucket_COMPONENT_KILLS = 16; // How many components I've killed
Bucket_COMPONENT_DEATHS = 17; // How many components I've lost
Bucket_FRIENDLY_COMPONENT_KILLS = 18; // How many friendly units' components I've killed
Bucket_FRIENDLY_COMPONENT_DEATHS = 19; // How many components I've lost to friendly fire
Bucket_ENEMY_COMPONENT_KILLS = 20; // How many enemy units' components I've killed
Bucket_ENEMY_COMPONENT_DEATHS = 21; // How many components I've lost to enemy units
Bucket_DFA = 22; // How many times I've been able to pull off a Death From Above
Bucket_SHOTS_HIT = 23; // How many of my shots have hit
Bucket_SHOTS_FIRED = 24; // How many shots I've fired
Bucket_HEAD_SHOTS = 25; // How many of my shots have hit a 'Mech's head
Bucket_ARM_SHOTS = 26; // How many of my shots have hit a 'Mech's arm
Bucket_LEG_SHOTS = 27; // How many of my shots have hit a 'Mech's leg
Bucket_TORSO_SHOTS = 28; // How many of my shots have hit a 'Mech's torso
Bucket_KILLS_PC = 29;
Bucket_KILLS_AI = 30;
Bucket_BLANK = 31;
Bucket_SHUTDOWN_TIMER = 32;
Bucket_OBJECTIVE = 33; // How many seconds (total) I've remained within an objective area
Bucket_OBJECTIVE_CONTESTED = 34; // How many seconds (total) I've remained within an objective area with enemies in the same area
Bucket_OBJECTIVE_UNCONTESTED = 35; // How many seconds (total) I've remained within an objective area with no enemies in the same area
Bucket_FLAGS_TAKEN = 36; // How many flags I've picked up
Bucket_FLAGS_DROPPED = 37; // How many flags I've dropped due to dying while carrying the flag
Bucket_FLAGS_CAPTURED = 38; // How many flags I've successfully returned to my capture zone
Bucket_FLAG_HOLD_TIME = 39; // Total amount of time I've held any flags
Bucket_TIME = 40;
Bucket_ALIVE_PLAYERS = 41;
Bucket_DEAD_PLAYERS = 42;
Bucket_CUSTOM = 43;
Bucket_ENEMY_TURRET_KILLS = 44;
Bucket_FRIENDLY_TURRET_KILLS = 45;
Bucket_ENEMY_BUILDING_KILLS = 46;
Bucket_FRIENDLY_BUILDING_KILLS = 47;
Bucket_Team1 = -1;
Bucket_Team2 = -2;
Bucket_Team3 = -3;
Bucket_Team4 = -4;
Bucket_Team5 = -5;
Bucket_Team6 = -6;
Bucket_Team7 = -7;
Bucket_Team8 = -8;
Affects_Single = 0;
Affects_All = 1;
//----------------
// Game Parameter Flags (for GetGameParam())
// NOTE: these must EXACTLY match the constants in ABLXSTD.CPP!
//----------------
GameParam_heatOn = 0;
GameParam_killLimit = 1;
GameParam_killLimitNumber = 2;
GameParam_respawnLimit = 3;
GameParam_respawnLimitNumber = 4;
GameParam_forceRespawn = 5;
GameParam_splashOn = 6;
GameParam_weaponjamOn = 7;
GameParam_ammobayfireOn = 8;
GameParam_advancemodeOn = 9;
GameParam_armormodeOn = 10;
GameParam_splashPercentage = 11;
GameParam_unlimitedAmmo = 12;
GameParam_friendlyFirePercentage = 13;
GameParam_allowZoom = 14;
GameParam_allow3rdPerson = 15;
GameParam_allowAutoAim = 16;
GameParam_allowDeadToChat = 17;
GameParam_invulnerableDrop = 18;
GameParam_isNight = 19;
GameParam_weather = 20;
GameParam_visibility = 21;
GameParam_reportStats = 22;
GameParam_serverConnection = 23;
GameParam_serverBandwidth = 24;
GameParam_onlyStockMech = 25;
GameParam_minimumTonnage = 26;
GameParam_maximumTonnage = 27;
GameParam_gameLength = 28;
GameParam_serverRecycle = 29;
GameParam_recycleDelay = 30;
GameParam_playMissionReview = 31;
GameParam_ruleType = 32;
GameParam_deadMechCantSee = 33;
GameParam_deadMechCantSeeOtherTeam = 34;
GameParam_allowdecaltransfer = 35;
GameParam_useMapCycle = 36;
GameParam_pureMapCycle = 37;
GameParam_teamAllowed = 38;
GameParam_teamCount = 39;
GameParam_closedGame = 40;
GameParam_playerLimit = 41;
//----------------
// Mech type constants (for GetMechType())
// NOTE: these must EXACTLY match the constants in MechLabHeaders.h!
//----------------
// MSL ADD MECH
FirstMechID = 0 ;
M_Annihilator = 0 ;
M_Archer = 1 ;
M_ArcticWolf = 2 ;
M_Ares = 3 ;
M_Argus = 4 ;
M_Assassin2 = 5 ;
M_Atlas = 6 ;
M_Avatar = 7 ;
M_Awesome = 8 ;
M_Battlemaster = 9 ;
M_Battlemasteriic = 10 ;
M_Behemoth = 11 ;
M_BehemothII = 12 ;
M_Blackhawk = 13 ;
M_BlackKnight = 14 ;
M_Blacklanner = 15 ;
M_Brigand = 16 ;
M_Bushwacker = 17 ;
M_Catapult = 18 ;
M_CauldronBorn = 19 ;
M_Chimera = 20 ;
M_Commando = 21 ;
M_Cougar = 22 ;
M_Cyclops = 23 ;
M_Daishi = 24 ;
M_Deimos = 25 ;
M_Dragon = 26 ;
M_Fafnir = 27 ;
M_Flea = 28 ;
M_Gladiator = 29 ;
M_Grizzly = 30 ;
M_Hauptmann = 31 ;
M_Hellhound = 32 ;
M_Hellspawn = 33 ;
M_Highlander = 34 ;
M_HollanderII = 35 ;
M_Hunchback = 36 ;
M_Kodiak = 37 ;
M_Loki = 38 ;
M_Longbow = 39 ;
M_Madcat = 40 ;
M_Madcat_MKII = 41 ;
M_Masakari = 42 ;
M_Mauler = 43 ;
M_Novacat = 44 ;
M_Osiris = 45 ;
M_Owens = 46 ;
M_Puma = 47 ;
M_Raven = 48 ;
M_Rifleman = 49 ;
M_Ryoken = 50 ;
M_Shadowcat = 51 ;
M_Solitaire = 52 ;
M_Sunder = 53 ;
M_Templar = 54 ;
M_Thanatos = 55 ;
M_Thor = 56 ;
M_Uller = 57 ;
M_Urbanmech = 58 ;
M_Uziel = 59 ;
M_Victor = 60 ;
M_Vulture = 61 ;
M_Warhammer = 62 ;
M_Wolfhound = 63 ;
M_Zeus = 64 ;
LastMechID = 64 ;
NoMechID = 65 ;
//----------------
// SetFlagsEnabled() constants
// NOTE: these must EXACTLY match the constants in MWMission.hpp!
//----------------
FLAGS_HIDE = 0;
FLAGS_TEAM_ONLY = 1;
FLAGS_UNIVERSAL_ONLY = 2;
FLAGS_SHOW_ALL = 3;
//----------------
// GetViewMode()/SetViewMode() constants
//----------------
VIEW_OUTSIDE_CENTER = 0;
VIEW_OUTSIDE_RIGHT = 1;
VIEW_OUTSIDE_LEFT = 2;
VIEW_IN_MECH = 3;
//----------------
// Sensor Mode constants
// NOTE: these must match the constants in Sensor.hpp
//----------------
SENSOR_ACTIVE = 0;
SENSOR_PASSIVE = 1;
SENSOR_SHUTDOWN = 2;
//----------------
// Input Trainer constants
// NOTE: these must EXACTLY match the constants in InputTrainer.hpp!
//----------------
INPUT_NONE = 0;
INPUT_THROTTLE = 1;
INPUT_TURN = 2;
INPUT_TORSO = 4;
INPUT_FIRING = 8;
INPUT_VIEW_MODES = 16;
INPUT_TARGET_SELECTION = 32;
INPUT_ZOOM = 64;
INPUT_HEAT = 128;
INPUT_NAV_SWITCHING = 256;
INPUT_MISC = 32768;
INPUT_ALL = 65535;
//----------------
// HUD elements
// NOTE: The keywords and constants here must exactly match those in MWGUIManager.hpp!
//----------------
HUD_NAV = 0;
HUD_TARGETARROW = 1;
HUD_TORSOBAR = 2;
HUD_ZOOM = 3;
HUD_HEAT = 4;
HUD_COOLANT = 5;
HUD_JUMP = 6;
HUD_SPEED = 7;
HUD_DAMAGE = 8;
HUD_TARGETDAMAGE = 9;
HUD_WEAPON = 10;
HUD_RETICLE = 11;
HUD_RADAR = 12;
HUD_CHAT = 13;
HUD_COMM = 14;
HUD_HELP = 15;
HUD_MAP = 16;
HUD_OBJECTIVE = 17;
HUD_SCORE = 18;
HUD_TIMER = 19;
HUD_HELPARROW = 20;
//----------------
// Sound triggers
// NOTE: The keywords and constants here must exactly match those in VehicleInterface.hpp!
//----------------
SOUND_TRIGGER_CRITICAL_HIT_WEAPON = 0;
SOUND_TRIGGER_CRITICAL_HIT_GIMP = 1;
SOUND_TRIGGER_DAMAGE_CRITICAL = 2;
SOUND_TRIGGER_NO_HEAT = 3;
SOUND_TRIGGER_LOW_HEAT = 4;
SOUND_TRIGGER_MED_HEAT = 5;
SOUND_TRIGGER_HIGH_HEAT = 6;
SOUND_TRIGGER_MELTDOWN = 7;
SOUND_TRIGGER_AUTO_SHUTDOWN_OVERRIDE = 8;
SOUND_TRIGGER_SHUTDOWN = 9;
SOUND_TRIGGER_POWER_UP = 10;
SOUND_TRIGGER_MISSILE_LOCKED = 11;
SOUND_TRIGGER_MISSILE_LOCKLOST = 12;
SOUND_TRIGGER_MISSILE_LOCKED_ON_ME = 13;
SOUND_TRIGGER_RADAR_RANGE_CHANGE = 14;
SOUND_TRIGGER_RADAR_ON = 15;
SOUND_TRIGGER_RADAR_OFF = 16;
SOUND_TRIGGER_ZOOM_RETICAL_ENGAGED = 17;
SOUND_TRIGGER_AMS_ENGAGED = 18;
SOUND_TRIGGER_LAMS_ENGAGED = 19;
SOUND_TRIGGER_NARC_SIGNAL_START = 20;
SOUND_TRIGGER_NARC_HIT = 21;
SOUND_TRIGGER_NEW_VEHICLE_RADAR_POWER_UP = 22;
SOUND_TRIGGER_TORSO_TWIST = 23;
SOUND_TRIGGER_TORSO_TWIST_MAX_REACHED = 24;
SOUND_TRIGGER_RADAR_JAMMED = 25;
SOUND_TRIGGER_COOLANT_FLUSH_START = 26;
SOUND_TRIGGER_COOLANT_FLUSH_STOP = 27;
SOUND_TRIGGER_OUT_OF_AMMO = 28;
SOUND_TRIGGER_OBJECT_SCANNED = 29;
SOUND_TRIGGER_INTERNAL_PPC_WASH = 30;
SOUND_TRIGGER_HILL_TOO_STEEP = 31;
SOUND_TRIGGER_TARGET_DESTROYED = 32;
SOUND_TRIGGER_TERRAIN_BAD = 33;
SOUND_TRIGGER_NARC_SIGNAL_STOP = 34;
SOUND_TRIGGER_RECHARGE_BEAM = 35;
SOUND_TRIGGER_RECHARGE_MISSILE = 36;
SOUND_TRIGGER_RECHARGE_PROJECTILE = 37;
SOUND_TRIGGER_RECHARGE_PPC = 38;
SOUND_TRIGGER_STEP_WATER_START = 39;
SOUND_TRIGGER_STEP_WATER_STOP = 40;
SOUND_TRIGGER_ENGINE_WALK = 41;
SOUND_TRIGGER_ENGINE_RUN = 42;
SOUND_TRIGGER_ENGINE_STOP = 43;
SOUND_TRIGGER_ENGINE_REVERSE = 44;
SOUND_TRIGGER_NAVPOINT_REACHED = 45;
SOUND_TRIGGER_KILLAWARDED = 46;
SOUND_TRIGGER_FRIENDLYFIREPENALTY = 47;
SOUND_TRIGGER_YOUHAVEFLAG = 48;
SOUND_TRIGGER_YOUINLEAD = 49;
SOUND_TRIGGER_TEAMMATEDESTROYED = 50;
SOUND_TRIGGER_FLAGTAKEN = 51;
SOUND_TRIGGER_FLAGCAPTURED = 52;
SOUND_TRIGGER_FLAGCAPTUREDHORN = 53;
SOUND_TRIGGER_FLAGRETURNED = 54;
SOUND_TRIGGER_HILLCONTESTED = 55;
SOUND_TRIGGER_HILLCAPTURED = 56;
SOUND_TRIGGER_REPAIR_START = 57;
SOUND_TRIGGER_REPAIR_STOP = 58;
SOUND_TRIGGER_DEFENDEDDESTROYED = 59;
SOUND_TRIGGER_MECH_DESTROYED = 60;
SOUND_TRIGGER_ENEMY_DEAD = 61;
SOUND_TRIGGER_ALLY_DEAD = 62;
SOUND_TRIGGER_LANCE_DEAD = 63;
SOUND_TRIGGER_COMM_OFF = 64;
SOUND_TRIGGER_INIT_REPAIR = 65;
SOUND_TRIGGER_REPAIR_COMP = 66;
SOUND_TRIGGER_ENEMY_CAPTURED = 67;
SOUND_TRIGGER_NAV_ALPHA = 68;
SOUND_TRIGGER_NAV_BETA = 69;
SOUND_TRIGGER_NAV_GAMMA = 70;
SOUND_TRIGGER_NAV_DELTA = 71;
SOUND_TRIGGER_NAV_EPSL = 72;
SOUND_TRIGGER_EXTRACT_POINT = 73;
SOUND_TRIGGER_TEAM_DEAD = 74;
SOUND_TRIGGER_YOU_WIN = 75;
SOUND_TRIGGER_YOU_LOSE = 76;
SOUND_TRIGGER_VICTORY_BABY = 77;
SOUND_TRIGGER_ALL_HILLS = 78;
SOUND_TRIGGER_BASE_CAPTURED = 79;
SOUND_TRIGGER_COLISEUM_AHH = 80;
SOUND_TRIGGER_COLISEUM_AWW = 81;
SOUND_TRIGGER_COLISEUM_BOO1 = 82;
SOUND_TRIGGER_COLISEUM_BOO2 = 83;
SOUND_TRIGGER_COLISEUM_BOO3 = 84;
SOUND_TRIGGER_COLISEUM_CHANT1 = 85;
SOUND_TRIGGER_COLISEUM_CHANT3 = 86;
SOUND_TRIGGER_COLISEUM_CHEER1 = 87;
SOUND_TRIGGER_COLISEUM_CHEER2 = 88;
SOUND_TRIGGER_COLISEUM_CHEER3 = 89;
SOUND_TRIGGER_COLISEUM_CHEER4 = 90;
SOUND_TRIGGER_COLISEUM_CHEER5 = 91;
SOUND_TRIGGER_COLISEUM_CHEER8 = 92;
SOUND_TRIGGER_COLISEUM_CHEER9 = 93;
SOUND_TRIGGER_COLISEUM_CROWD1 = 94;
SOUND_TRIGGER_COLISEUM_CROWD2 = 95;
SOUND_TRIGGER_COLISEUM_ENERGYZAP = 96;
SOUND_TRIGGER_COLISEUM_HORN = 97;
SOUND_TRIGGER_COLISEUM_JEERS = 98;
SOUND_TRIGGER_COLISEUM_ROAR = 99;
SOUND_TRIGGER_COLISEUM_STADAMB = 100;
SOUND_TRIGGER_COLISEUM_FACTORYHORN = 101;
SOUND_TRIGGER_COLISEUM_FACTORYBANG = 102;
SOUND_TRIGGER_COLISEUM_FACTORYBUZZ = 103;
SOUND_TRIGGER_COLISEUM_FACTORYCLANG = 104;
SOUND_TRIGGER_COLISEUM_FACTORYDRILL = 105;
SOUND_TRIGGER_COLISEUM_FACTORYSTEAM = 106;
SOUND_TRIGGER_COLISEUMAMB = 107;
SOUND_TRIGGER_COLISEUM_JUNGLEBIRD1 = 108;
SOUND_TRIGGER_COLISEUM_JUNGLEBIRD2 = 109;
SOUND_TRIGGER_COLISEUM_JUNGLEBIRD3 = 110;
SOUND_TRIGGER_COLISEUM_JUNGLEBIRD4 = 111;
SOUND_TRIGGER_COLISEUM_JUNGLEMONKEY1 = 112;
SOUND_TRIGGER_COLISEUM_JUNGLEMONKEY2 = 113;
SOUND_TRIGGER_TARGETATTACKED = 114;
SOUND_TRIGGER_TARGETDESTROYED = 115;
SOUND_TRIGGER_COMPONENT_DESTROYED = 116;
SOUND_TRIGGER_COMPDESTROYED = 117;
SOUND_TRIGGER_ZOOM_FAIL = 118;
SOUND_TRIGGER_MECH_AMMOBAY_FIRE = 119;
SOUND_TRIGGER_RETICULE_WASH = 120;
SOUND_TRIGGER_WEAPON_DESTROYED = 121;
SOUND_TRIGGER_AMMO_DUMPED = 122;
SOUND_TRIGGER_NO_WEAPON = 123;
SOUND_TRIGGER_FLAGCAPTUREDBUZZER = 124;
SOUND_TRIGGER_ALARM1 = 125;
SOUND_TRIGGER_ALARM2 = 126;
//----------------
// Talker IDs
// NOTE: The keywords and constants here must exactly match those in ablxstd.cpp
//----------------
TALKER_IAN = 0;
TALKER_RAT = 1;
TALKER_CAS = 2;
TALKER_GON = 3;
TALKER_JEN = 4;
TALKER_TER = 5;
TALKER_DAM = 6;
TALKER_RES = 7;
TALKER_65C = 8;
TALKER_EV1 = 9;
TALKER_EV2 = 10;
TALKER_SAL = 11;
TALKER_REC = 12;
TALKER_SUP = 13;
TALKER_FO1 = 14;
TALKER_FO2 = 15;
TALKER_FO3 = 16;
TALKER_FO4 = 17;
TALKER_FO5 = 18;
TALKER_FO6 = 19;
TALKER_PI1 = 20;
TALKER_PI2 = 21;
TALKER_PI3 = 22;
TALKER_PI4 = 23;
TALKER_ART = 24;
TALKER_SHE = 25;
TALKER_BD1 = 26;
TALKER_BD2 = 27;
TALKER_FOX = 28;
TALKER_KIL = 29;
TALKER_SGT = 30;
TALKER_ROM = 31;
TALKER_XRY = 32;
TALKER_CCG = 33;
TALKER_ERL = 34;
TALKER_PA1 = 35;
TALKER_PA2 = 36;
TALKER_PA3 = 37;
TALKER_PA4 = 38;
TALKER_BRV = 39;
TALKER_CHL = 40;
TALKER_DEN = 41;
TALKER_RCG = 42;
TALKER_VRD = 43;
TALKER_VOR = 44;
TALKER_HQ1 = 45;
TALKER_HQ2 = 46;
TALKER_HQ3 = 47;
TALKER_MED = 48;
TALKER_SFQ = 49;
TALKER_CJK = 50;
TALKER_ABC = 51;
TALKER_BRK = 52;
TALKER_CST = 53;
TALKER_ROL = 54;
TALKER_WIL = 55;
TALKER_EPS = 56;
TALKER_PET = 57;
TALKER_EP2 = 58;
TALKER_BET = 59;
@@ -0,0 +1,14 @@
//************************
//MW4 Mission Type Include File 4/8
//------------------------
LocPoint = integer[3];
ObjectID = integer;
PathID = integer;
SoundID = integer;
NavID = integer;
ObjectiveID = integer;
TimerID = integer;
FindType = integer;
TacticType = integer;
GroupID = integer;
@@ -0,0 +1,57 @@
//*********************************************************************************
fsm playeraifsm : integer;
//------------------------------------------------------------------
//
// Constant Definitions
//
//------------------------------------------------------------------
const
#include_ <content\ABLScripts\mwconst.abi>
//------------------------------------------------------------------
//
// Type Definitions
//
//------------------------------------------------------------------
type
#include_ <content\ABLScripts\mwtype.abi>
//------------------------------------------------------------------
//
// Variable Declarations
//
//------------------------------------------------------------------
var
//------------------------------------------------------------------
//
// Local Functions
//
//------------------------------------------------------------------
function init;
code
endfunction;
//------------------------------------------------------------------
//
// Main Code
//
//------------------------------------------------------------------
state startState;
code
endstate;
state deadState;
code
endstate;
endfsm.
//******************************************************************
+476
View File
@@ -0,0 +1,476 @@
[Mood Entropy]
// This is how much we add or subtract to our current mood every 2 seconds if
// our current mood is different from our entropy mood
entropy_regeneration_at_0 = 0.1; // entropy regeneration every 2 seconds at elite level 0
entropy_regeneration_at_100 = 0.4; // entropy regeneration every 2 seconds at elite level 100
// NOTE: entropy_regeneration_at_100 *MUST* be greater than entropy_regeneration_at_0
[Friendly Fire Building Cheat]
building_ff_multiplier = 0.1; // when a friendly fire shot hits a building, this multiplier is applied to the damage the building takes
// (note: this should be very small so that friendly fire has a hard time destroying a base accidentally)
[Mood Modifiers]
// These are modifiers for the current mood when various events occur.
// NOTE: previously, these were multipliers; now, they are what is ADDED to the mood when the
// event occurs (usually a negative number to indicate that the mood has lowered).
shutdown = -0.5; // when we are about to be forced to shut down due to overheating
internal_armor_breached = -0.8; // when internal armor is damaged
fall_down = -2.5; // when we fall down
first_arm_hit = -2.0; // when our first arm is blown off
second_arm_hit = -4.0; // when both arms are now blown off
first_leg_hit = -2.5; // when one of our legs is taken out (gimped)
mood_squad_dead_unit_multiplier = 3.5; // when a unit dies, we subtract this number divided by the number of living units left in the group from all who remain
// i.e. in a 4-unit group, we subtract N/3 when the first unit dies, N/2 when the second unit dies, N when the third unit dies
// (of course, we don't care when the 4th unit dies, because by then the group is no more!)
interval_multiplier_desperate = 1.4; // multiplier for the attack interval when we're in a "desperate" mood
interval_multiplier_defensive = 1.1; // multiplier for the attack interval when we're in a "defensive" mood
interval_multiplier_neutral = 1.0; // multiplier for the attack interval when we're in a "neutral" mood
interval_multiplier_aggressive = 0.85; // multiplier for the attack interval when we're in an "aggressive" mood
interval_multiplier_brutal = 0.7; // multiplier for the attack interval when we're in a "brutal" mood
[Missed Shot Modifiers]
// These are modifiers used when we're about to fire a shot that we want to miss.
// The "skew_size" numbers indicate the maximum amount to randomly offset a point from the component we're trying
// to miss. Larger numbers mean shots should veer off further from the body part we're pretending to try to hit.
// WARNING: DO NOT SET THE SKEW SIZE BELOW 1.0!
// The "skew_increment" numbers indicate, for any given attempt to miss, the multiplier that we temporarily apply to the skew size.
// I.e. 1.2 indicates "We missed? OK, exaggerate the skew size by 20% and roll a new point. We missed again? OK, repeat."
// WARNING: DO NOT SET THE SKEW INCREMENT BELOW 1.2! Also, a larger skew size should be paired with a smaller skew increment and vice versa.
skew_at_0 = 7.0; // skew size at base (unmodified) chance-to_hit of 0%; should be less than skew_at_100
skew_at_100 = 1.5; // skew size at base (unmodified) chance-to_hit of 100%; should be greater than skew_at_0
skew_inc_at_0 = 1.3; // skew increment at base (unmodified) chance-to_hit of 0%
// NOTE: should be smaller than skew_inc_at_100 since the skew_at_0 is already a large number
skew_inc_at_100 = 1.5; // skew increment at base (unmodified) chance-to_hit of 100%
// NOTE: this should be higher than the skew_inc_at_0 to ensure that we can actually
// miss in a reasonable number of retries!
[Speed Definitions]
// This section defines "speeds" that will be used in a later section of this file.
// Each defines a maximum speed value for that level, in KPH.
speed_stopped = 5; // stopped, or very slow: 0 to N KPH
speed_slow = 20; // moving slowly
speed_medium = 50; // moving at a moderate clip
speed_fast = 80; // moving at a fast speed
speed_maximum = 1000; // moving very fast
[Tonnage Definitions]
// This section defines mech sizes in terms of tonnage that will be used in a later section of this file.
// Each size defines a maximum tonnage value for that level.
mech_tiny = 1; // tiny mech: 0 to N tons
mech_small = 35; // small mech
mech_medium = 55; // medium-size mech
mech_large = 75; // large mech
mech_huge = 200; // huge mech
[Distance Definitions]
// This section defines mech distances in terms of meters that will be used in a later section of this file.
// Each value defines a maximum distance value for that level.
distance_adjacent = 25; // target is very close: 0 to N meters
distance_near = 70; // target is not far
distance_medium = 200; // target is medium range
distance_far = 600; // target is kinda far away
distance_very_far = 2000; // target is near the edge of my perception
[To-Hit Modifiers]
// These are multipliers to the to-hit percentage roll for various attributes of the target.
if_crouched = 0.8; // if the target is crouched
if_tiny = 0.8;
if_small = 0.85;
if_medium_size = 0.9;
if_large = 0.95;
if_huge = 1.0;
if_stopped = 1.0;
if_slow = 0.95; \
if_medium_speed = 0.9;
if_fast = 0.8;
if_maximum = 0.65;
if_shooter_stopped = 1.0;
if_shooter_slow = 0.95;
if_shooter_medium = 0.90;
if_shooter_fast = 0.80;
if_shooter_maximum = 0.65;
if_adjacent = 1.0;
if_near = 0.95;
if_medium_range = 0.85;
if_far = 0.75;
if_very_far = 0.55;
if_firing_with_one_arm = 0.5;
if_turning = 0.97; // the multiplier to be used when the target is turning at the maximum rate (intermediate
// turning values will be smoothly interpolated between this number and 1)
// "if_bearing_90" is used as follows:
// -if the target is stopped or slow, the value is used
// -if the target is medium or fast, the value is squared, then used
// -if the target is maximum, the value is cubed, then used
if_bearing_90 = 0.95; // the multiplier to use when the target is sideways relative to us
// (we interpolate between this number and 1.0, with 1.0 used when target is
// facing toward or away from us)
[Elite Levels]
// These are the minimum and maximum elite levels (inclusive) required in order for a vehicle to perform a specific action.
// These are specified as percentage values, from 0 to 100. The "min" value must ALWAYS be less than or equal to
// (probably *much* less than) the max value. If min > max, the action cannot be carried out!
// If a unit's current elite level is less than the minimum or greater than the maximum, it will not perform the action.
// A "min" value of 0 and a "max" value of 100 indicates that the elite level is irrelevant to carrying out the specified task.
// The "min_tactic_*" numbers are the minimum and maximum elite levels to carry out a given tactic.
min_evade_when_missiles_shot_at_me = 65; // whether or not I will attempt to evade missiles shot directly at me
max_evade_when_missiles_shot_at_me = 100;
min_evade_when_targeted = 10; // whether or not I will avoid allowing myself to remain within the player's targeting reticule
max_evade_when_targeted = 100; // for more than a half-second or so (i.e. I try to avoid even letting him target me)
min_evade_by_jumping = 70; // whether or not I can jump as an evasive maneuver
max_evade_by_jumping = 100;
min_evade_by_throttle_override = 60; // whether or not I can override my attack throttle (i.e. increase my speed back up to full speed)
max_evade_by_throttle_override = 100; // as an evasive maneuver
min_evade_by_crouching = 75; // whether or not I can crouch as an evasive maneuver (considered for use only if I'm standing still)
max_evade_by_crouching = 100;
min_jump_if_rushed = 55; // whether or not I can jump if I think I'm about to collide with the player
max_jump_if_rushed = 100; // (NOTE: this is specifically for enemy AI units against the player; AI units will not use this on each other!)
min_opportunity_fire = 10; // whether or not I can fire at other potential targets when I
max_opportunity_fire = 100; // can't shoot my current target target (for whatever reason -- torso twisted wrong way, etc.)
min_look_left_or_right = 50; // whether or not a mech can look left/right out of the cockpit and shoot with only that arm
max_look_left_or_right = 100;
min_look_time_at_0 = 2; // minimum time a unit must be looking from left or right arm before it can fire (at elite level 0)
min_look_time_at_100 = 0; // minimum time a unit must be looking from left or right arm before it can fire (at elite level 100)
switch_to_random_component_picking = 65; // the point at which I switch from picking the least damaged
// component on my enemy to picking a random component to hit
switch_to_most_damaged_component_picking = 91; // the point at which I switch from picking a random component
// on my enemy to picking the most damaged
min_prefer_water = 0; // whether or not I should prefer to use water when executing an offensive tactic (i.e. not "retreat")
max_prefer_water = 100;
min_dont_use_limited_ammo_vs_non_mechs = 1; // whether I can use limited-ammo weapons against non-mech targets (assuming I have lasers)
max_dont_use_limited_ammo_vs_non_mechs = 100;
min_vulnerable_leg_hiding = 70; // whether or not I can take a single damaged/destroyed leg into account when maneuvering or turning in combat
max_vulnerable_leg_hiding = 100;
min_mood_vulnerable_leg_hiding = 2; // same as above, but based on mood
max_mood_vulnerable_leg_hiding = 7;
min_throttle_override = 10; // minimum elite skill required for certain tactics (such as Retreat) to override my current attack throttle setting
torso_twist_multiplier_at_0 = 0.65; // this specifies a multiplier that will be used at elite level 0; the AI will interpolate between this value and the value specified below
torso_twist_use_full_multiplier = 45; // specifies an elite skill to use 100% torso twist speed; less than this value, we interpolate according to the number above; greater or equal to this value, we use 100%
// MUST BE GREATER THAN 0!
[Evasion Characteristics]
jump_wait_time_at_0 = 30; // minimum time (in seconds) a mech at elite level 0 must wait between jumps
jump_wait_time_at_100 = 8; // minimum time (in seconds) a mech at elite level 100 must wait between jumps
evade_focus_time_at_0 = 3; // minimum time (in seconds) the player must be focused on a mech for it to decide to evade, at elite level 0
evade_focus_time_at_100 = 0.8; // minimum time (in seconds) the player must be focused on a mech for it to decide to evade, at elite level 100
[Lancemates]
lancemate_can_attack_radius = 450; // radius at which a lancemate searches for enemies to attack automatically
max_lancemate_distance_from_leader = 300; // the maximum distance a lancemate can go from its leader
[Tactics]
max_defend_distance_from_target = 120; // maximum distance anyone using the "defend" tactic can go from its target
jump_and_shoot_hover_height_min = 45; // minimum of how far off the ground a mech using the "jump and shoot" tactic will attempt to hover in midair
jump_and_shoot_hover_height_max = 100; // maximum of how far off the ground a mech using the "jump and shoot" tactic will attempt to hover in midair
[Firing]
max_fire_cheat_angle = 25; // maximum angle (in degrees) by which we can "cheat" when we fire
max_airplane_fire_cheat_angle = 50; // maximum cheat angle for air units
max_turret_fire_cheat_angle = 8; // maximum angle for laser turrets
[Tactic Selection]
// This section lists constants for automatic tactic selection/switching -- i.e. what tactics to select when you use OrderAttack()
min_tactic_time = 10; // minimum amount of time (in seconds) that we try any given tactic before switching to another tactic
// Joust
min_elite_joust = 0; // min elite level to select "Joust" tactic
max_elite_joust = 100; // max elite level to select "Joust" tactic
min_mood_joust = 6; // min mood to select "Joust" tactic
max_mood_joust = 8; // max mood to select "Joust" tactic
// Rush
min_elite_rush = 0; // min elite level to select "Rush" tactic
max_elite_rush = 100; // max elite level to select "Rush" tactic
min_mood_rush = 7; // min mood to select "Rush" tactic
max_mood_rush = 10; // max mood to select "Rush" tactic
// Hit + Run
min_elite_hitandrun = 0; // min elite level to select "Hit + Run" tactic
max_elite_hitandrun = 100; // max elite level to select "Hit + Run" tactic
min_mood_hitandrun = 5; // min mood to select "Hit + Run" tactic
max_mood_hitandrun = 7; // max mood to select "Hit + Run" tactic
// Rear
min_elite_rear = 0; // min elite level to select "Rear" tactic
max_elite_rear = 100; // max elite level to select "Rear" tactic
min_mood_rear = 3; // min mood to select "Rear" tactic
max_mood_rear = 10; // max mood to select "Rear" tactic
// Circle
min_elite_circle = 0; // min elite level to select "Circle of Death" tactic
max_elite_circle = 100; // max elite level to select "Circle of Death" tactic
min_mood_circle = 3; // min mood to select "Circle of Death" tactic
max_mood_circle = 8; // max mood to select "Circle of Death" tactic
// Retreat
min_elite_retreat = 0; // min elite level to select "Retreat" tactic
max_elite_retreat = 100; // max elite level to select "Retreat" tactic
min_mood_retreat = 0; // min mood to select "Retreat" tactic
max_mood_retreat = 2; // max mood to select "Retreat" tactic
// Death From Above
min_elite_dfa = 70; // min elite level to select "Death From Above" tactic
max_elite_dfa = 100; // max elite level to select "Death From Above" tactic
min_mood_dfa = 7; // min mood to select "Death From Above" tactic
max_mood_dfa = 10; // max mood to select "Death From Above" tactic
[AI Slope]
leg_up_slope = 0.707f; //cos (45 deg) slope order for best manuverablity
leg_down_slope = 0.5f; //cos (60 deg) must be leg, track, wheel, hover
track_up_slope = 0.766f; //cos (40 deg)
track_down_slope = 0.707f; //cos (45 deg)
wheel_up_slope = 0.819f; //cos (35 deg)
wheel_down_slope = 0.819f; //cos (35 deg)
hover_up_slope = 0.866f; //cos (30 deg)
hover_down_slope = 0.866f; //cos (30 deg)
[AI Movement Costs]
leg_dirt_cost = 0; // this is cost added to base cost of 1 to enter cell
leg_rock_cost = 0; // negative would be easier to enter
leg_steel_cost = 0; // positive would be harder
leg_blacktop_cost = 0; // use a number less than -100 for impassable
leg_glass_cost = 0;
leg_brick_cost = 0;
leg_grass_cost = 0;
leg_wood_cost = 0;
leg_tree_cost = 0;
leg_swamp_cost = 0;
leg_concrete_cost = 0;
leg_rough_cost = 0;
leg_snow_cost = 0;
leg_underbrush_cost = 0;
leg_shallowwater_cost = 0;
leg_midwater_cost = 0;
leg_oceanicwater_cost = 0;
leg_desert_cost = 0;
leg_flatswamp_cost = 0;
leg_thickswamp_cost = 0;
// leg_crackedlava_cost = 0.5;
// leg_openlava_cost = 0.75;
leg_crackedlava_cost = -150.0;
leg_openlava_cost = -150.0;
track_dirt_cost = 0;
track_rock_cost = 0;
track_steel_cost = 0;
track_blacktop_cost = 0;
track_glass_cost = 0;
track_brick_cost = 0;
track_grass_cost = 0;
track_wood_cost = 0;
track_tree_cost = 0;
track_swamp_cost = 0;
track_concrete_cost = 0;
track_rough_cost = 0;
track_snow_cost = 0;
track_underbrush_cost = 0;
track_shallowwater_cost = 0;
track_midwater_cost = 0;
track_oceanicwater_cost = 0;
track_desert_cost = 0;
track_flatswamp_cost = 0;
track_thickswamp_cost = 0;
track_crackedlava_cost = -150;
track_openlava_cost = -150;
wheel_dirt_cost = 0;
wheel_rock_cost = 0;
wheel_steel_cost = 0;
wheel_blacktop_cost = 0;
wheel_glass_cost = 0;
wheel_brick_cost = 0;
wheel_grass_cost = 0;
wheel_wood_cost = 0;
wheel_tree_cost = 0;
wheel_swamp_cost = 0;
wheel_concrete_cost = 0;
wheel_rough_cost = 0;
wheel_snow_cost = 0;
wheel_underbrush_cost = 0;
wheel_shallowwater_cost = 0;
wheel_midwater_cost = 0;
wheel_oceanicwater_cost = 0;
wheel_desert_cost = 0;
wheel_flatswamp_cost = 0;
wheel_thickswamp_cost = 0;
wheel_crackedlava_cost = -150;
wheel_openlava_cost = -150;
hover_dirt_cost = 0;
hover_rock_cost = 0;
hover_steel_cost = 0;
hover_blacktop_cost = 0;
hover_glass_cost = 0;
hover_brick_cost = 0;
hover_grass_cost = 0;
hover_wood_cost = 0;
hover_tree_cost = 0;
hover_swamp_cost = 0;
hover_concrete_cost = 0;
hover_rough_cost = 0;
hover_snow_cost = 0;
hover_underbrush_cost = 0;
hover_shallowwater_cost = 0;
hover_midwater_cost = 0;
hover_oceanicwater_cost = 0;
hover_desert_cost = 0;
hover_flatswamp_cost = 0;
hover_thickswamp_cost = 0;
hover_crackedlava_cost = -150;
hover_openlava_cost = -150;
[Objective]
objective_display_time = 30; // in seconds.
[Joystick]
throttle_center = 0.3 // 0-1
throttle_dead_low = 0.25 // on either side of throttle_center
throttle_dead_high = 0.06 // on either side of throttle_center
[Skills]
default_pilot = 20;
default_gunnery = 50;
default_elite = 30;
// default_minheat = 50;
// default_maxheat = 80;
default_minheat = 10;
default_maxheat = 35;
default_sensor = 2; // max time (in seconds) sensor data can be refreshed
default_blind = 80; // default multiplier (%) used for night and heavy fog missions if not specified
default_longrange = 100; // default additional multiplier (%) applied for long-range shots if not specified
default_shortrange = 100; // default additional multiplier (%) applied for short-range shots if not specified
default_addpilot = 10;
default_addgunnery = 1;
default_addelite = 10;
max_skill_add = 5; // max value a skill can increase per game
max_fog_dist_to_use_blind_skill = 400; // in a non-night mission, we use blind fighting skill if fog is <= this distance
[Piloting] // modifiers for piloting rolls
damage_amount = 1.1; // this amount is multiplied by tonage of the mech to get the damage to cause a skill check
fall_damage_minus = 40; // points of damage to subtract every second
fall_splash_multiplier = 0.115;
min_fall_timer = 10.0; // was 30.0
damage_mod = 0.8;
low_water_mod = 0.9;
mid_water_mod = 0.8;
concrete_mod = 0.9;
gimped_mod = 0.5;
double_damage_mod = 0.75;
moving_fast_mod = 0.75; // over 50% of max speed
jump_recover_mod = 0.75;
max_water_jump = 1; // maximum depth of water allowed for jumping
flying_turn_rate = 0.3; // turn rate to use while jump-jetting in radians per second (0.2 equals about 10 degrees)
// flying_turn_rate = 0.2; // turn rate to use while jump-jetting in radians per second (0.2 equals about 10 degrees)
[Ejecting] // modifiers for when pilots eject
eject_chance_for_non_lancemate = 25; // chance that a non-lancemate will eject
eject_chance_for_lancemate = 60; // chance that a lancemate will eject when destroyed
eject_chance_ok_when_ejected = 40; // chance that a lancemate will have "OK" status when he ejects
eject_chance_injured_when_ejected = 30; // chance that a lancemate will have "injured" status when he ejects
// NOTE: the chance to be "MIA" when ejected is 100 minus the sum of the chances to be OK or injured when ejected
[Difficulty] // modifier for difficulty levels
friend_easy_gunnery_mod = 1.3;
friend_medium_gunnery_mod = 1.1;
friend_hard_gunnery_mod = 1.0;
friend_impossible_gunnery_mod = 1.0;
enemy_easy_gunnery_mod = 0.35;
enemy_medium_gunnery_mod = 0.6;
enemy_hard_gunnery_mod = 1.00;
enemy_impossible_gunnery_mod = 2.0;
neutral_easy_gunnery_mod = 1.0;
neutral_medium_gunnery_mod = 1.0;
neutral_hard_gunnery_mod = 1.0;
neutral_impossible_gunnery_mod = 1.0;
[Collision] // modifiers for collision system
collision_mech_light_damage = 0.010 // was 0.003 points of damage done per ton per mps of impact
collision_mech_light_slowdown = 8.0 // was 8.0 mps of speed lost by a mech hitting a small building
collision_mech_light_mech_speed = 123.456 // was 123.456 square of minimum damaging impact speed in mps from mechs
collision_mech_light_building_speed = 25.0 // was 25.0 square of minimum damaging impact speed in mps to large buildings
collision_mech_medium_tonage = 20.0 // was 40 tons required for mech to be considered medium weight (now light/medium)
collision_mech_medium_damage = 0.010 // was 0.003 points of damage done per ton per mps of impact
collision_mech_medium_slowdown = 6.0 // was 7.0 mps of speed lost by a mech hitting a small building
collision_mech_medium_mech_speed = 123.456 // was 123.456 square of minimum damaging impact speed in mps from mechs
collision_mech_medium_building_speed = 25.0 // was 25.0 square of minimum damaging impact speed in mps to large buildings
collision_mech_heavy_tonage = 65.0 // was 75 tons required for mech to be considered heavy weight (now med/heavy/assault)
collision_mech_heavy_damage = 0.010 // was 0.003 points of damage done per ton per mps of impact
collision_mech_heavy_slowdown = 1.0 // was 6.0 mps of speed lost by a mech hitting a small building
collision_mech_heavy_mech_speed = 123.456 // was 123.456 square of minimum damaging impact speed in mps from mechs
collision_mech_heavy_building_speed = 25.0 // was 25.0 square of minimum damaging impact speed in mps to large buildings
collision_dfa_speed = 19.6 // (was 19.6) minimum downward impact speed in mps to use DFA constant
collision_dfa_damage_given = 0.050 // (was 0.016)points of damage done to target per ton per mps of dfa impact
collision_dfa_damage_taken = 0.01 // (was 0.006)points of damage done to landing mech per ton per mps of dfa impact
collision_tank_slowdown = 8.0 // mps of speed lost by a tank when hitting a small building or tree
[Salvage]
chance_salvage = 4 // chance for a destroyed mech to be added to salvage
[Mouse]
mouse_min_change = 0.015 // minimum the mouse must move to return to center
mouse_interia_mult = 0.02 // amount mouse delta is multiplied by, delta is in screen coordinates
mouse_max_mouse = 0.75 // maximum the mouse is allowed to be away from center 0-1 range
+152
View File
@@ -0,0 +1,152 @@
[1x12Line]
Pos1=0 0 -1
Pos2=0 0 -2
Pos3=0 0 -3
Pos4=0 0 -4
Pos5=0 0 -5
Pos6=0 0 -6
Pos7=0 0 -7
Pos8=0 0 -8
Pos9=0 0 -9
Pos10=1 0 -10
Pos11=1 0 -11
[Line]
Pos1=0 0 -1
Pos2=0 0 -2
Pos3=0 0 -3
Pos4=0 0 -4
Pos5=0 0 -5
Pos6=0 0 -6
Pos7=0 0 -7
Pos8=0 0 -8
Pos9=0 0 -9
Pos10=1 0 -10
Pos11=1 0 -11
[2x6Line]
Pos1=1 0 0
Pos2=0 0 -1
Pos3=1 0 -1
Pos4=0 0 -2
Pos5=1 0 -2
Pos6=0 0 -3
Pos7=1 0 -3
Pos8=0 0 -4
Pos9=1 0 -4
Pos10=0 0 -5
Pos11=1 0 -5
[6x2Line]
Pos1=0 0 -1
Pos2=1 0 0
Pos3=1 0 -1
Pos4=-1 0 0
Pos5=-1 0 -1
Pos6=2 0 0
Pos7=2 0 -1
Pos8=-2 0 0
Pos9=-2 0 -1
Pos10=3 0 0
Pos11=3 0 -1
[3x4Line]
Pos1=1 0 0
Pos2=-1 0 0
Pos3=0 0 -1
Pos4=1 0 -1
Pos5=-1 0 -1
Pos6=0 0 -2
Pos7=1 0 -2
Pos8=-1 0 -2
Pos9=0 0 -3
Pos10=1 0 -3
Pos11=-1 0 -3
[3x4Scout]
Pos1=0 0 -3
Pos2=1 0 -3
Pos3=-1 0 -3
Pos4=0 0 -4
Pos5=1 0 -4
Pos6=-1 0 -4
Pos7=0 0 -5
Pos8=1 0 -5
Pos9=-1 0 -5
Pos10=0 0 -6
Pos11=1 0 -6
Pos12=-1 0 -6
[11Wedge]
Pos1=-1 0 -1
Pos2=1 0 -1
Pos3=-2 0 -2
Pos4=2 0 -2
Pos5=-3 0 -3
Pos6=3 0 -3
Pos7=-4 0 -4
Pos8=4 0 -4
Pos9=-5 0 -5
Pos10=5 0 -5
[11FlyingV]
Pos1=5 0 -5
Pos2=-5 0 -5
Pos3=-4 0 -4
Pos4=4 0 -4
Pos5=3 0 -3
Pos6=-3 0 -3
Pos7=2 0 -2
Pos8=-2 0 -2
Pos9=1 0 -1
Pos10=-1 0 -1
[16WedgeFill]
Pos1=-1 0 -1
Pos2=1 0 -1
Pos3=0 0 -1
Pos4=-2 0 -2
Pos5=2 0 -2
Pos6=0 0 -2
Pos7=-1 0 -2
Pos8=1 0 -2
Pos9=-3 0 -3
Pos10=3 0 -3
Pos11=0 0 -3
Pos12=-1 0 -3
Pos13=1 0 -3
Pos14=-2 0 -3
Pos15=2 0 -3
[16FlyingVFill]
Pos1=-1 0 1
Pos2=1 0 1
Pos3=0 0 1
Pos4=-2 0 2
Pos5=2 0 2
Pos6=0 0 2
Pos7=-1 0 2
Pos8=1 0 2
Pos9=-3 0 3
Pos10=3 0 3
Pos11=0 0 3
Pos12=-1 0 3
Pos13=1 0 3
Pos14=-2 0 3
Pos15=2 0 3
[13CircleFill]
Pos1=-2 0 2
Pos2=2 0 2
Pos3=-2 0 -2
Pos4=2 0 -2
Pos5=0 0 3
Pos6=-3 0 0
Pos7=3 0 0
Pos8=0 0 -3
Pos9=-1 0 1
Pos10=1 0 1
Pos11=-1 0 -1
Pos12=1 0 -1
+30
View File
@@ -0,0 +1,30 @@
[Signal Flare]
signal_flare=effects\signal_flare\signal_flare.data
[Fireworks]
total=7
firework0=effects\fireworks\fireworks_burst.data
firework1=effects\fireworks\fireworks_glitter.data
firework2=effects\fireworks\fireworks_green.data
firework3=effects\fireworks\fireworks_red.data
firework4=effects\fireworks\fireworks_sparkles.data
firework5=effects\fireworks\fireworks_sparks.data
firework6=effects\fireworks\fireworks_sparks_gold.data
firework7=effects\fireworks\fireworks_starburst.data
[Confetti]
confetti=effects\confetti\confetti.data
[Fighter Smoke]
total=3
smoke0=effects\fighter_smoke\fighter_smoke_red.data
smoke1=effects\fighter_smoke\fighter_smoke_green.data
smoke2=effects\fighter_smoke\fighter_smoke_blue.data
+88
View File
@@ -0,0 +1,88 @@
[range]
type=integer
min=0
max=9999
default=1000
default_text=A distance (in meters).
[attack_range]
type=integer
min=0
max=9999
default=750
default_text=The range from an enemy at which I should automatically attack (in meters).
[withdraw_range]
type=integer
min=0
max=9999
default=750
default_text=The range from an enemy at which I should automatically withdraw (in meters).
[piloting_skill]
type=integer
min=0
max=100
default=50
default_text=The pilot's piloting skill.
[gunnery_skill]
type=integer
min=0
max=500
default=30
default_text=The pilot's gunnery skill.
[elite_level]
type=integer
min=0
max=100
default=30
default_text=The pilot's elite level.
[attack_throttle]
type=integer
min=0
max=100
default=80
default_text=The pilot's attack throttle (percentage of maximum throttle).
[min_delay]
type=real
min=0
max=20
default=1
default_text=The pilot's minimum firing delay.
[max_delay]
type=real
min=0
max=20
default=5
default_text=The pilot's maximum firing delay.
[is_shot_radius]
type=integer
min=0
max=200
default=100
default_text=The pilot's "is-shot" radius.
[mood]
type=integer
display=combobox
values=Desperate (1),Desperate (2),Defensive (3),Defensive(4),Neutral(5),Neutral(6),Aggressive(7),Aggressive(8),Brutal(9),Brutal(10)
min=1
max=10
default=5
default_text=The pilot's mood.
[attack_sound]
[death_sound]
[tactic]
type=string
display=combobox
values=TACTIC_PICK_BEST,TACTIC_STOP_AND_FIRE,TACTIC_RAM,TACTIC_JOUST,TACTIC_RUSH,TACTIC_HIT_AND_RUN,TACTIC_FRONT,TACTIC_REAR,TACTIC_CIRCLE_OF_DEATH,TACTIC_BACK_UP_AND_FIRE,TACTIC_RETREAT,TACTIC_CIRCLE_HOVER,TACTIC_STRAFE,TACTIC_STAND_GROUND,TACTIC_JUMP_AND_SHOOT,TACTIC_SNIPE,TACTIC_SHOOT_ONLY,TACTIC_DEFEND,TACTIC_LOCAL_PATROL,TACTIC_SURRENDER,TACTIC_AMBUSH,TACTIC_DEATH_FROM_ABOVE,TACTIC_HELI_POPUP,TACTIC_DIVE_BOMB
@@ -0,0 +1,2 @@
[GameData]
Class=Adept::AI
@@ -0,0 +1,2 @@
[GameData]
Class=MechWarrior4::CombatAI
@@ -0,0 +1,2 @@
[GameData]
Class=MechWarrior4::MechAI
@@ -0,0 +1,2 @@
[GameData]
Class=MechWarrior4::MoverAI
@@ -0,0 +1,2 @@
[GameData]
Class=MechWarrior4::NonComAI
@@ -0,0 +1,2 @@
[GameData]
Class=MechWarrior4::PlaneAI
@@ -0,0 +1,2 @@
[GameData]
Class=MechWarrior4::ShooterAI
@@ -0,0 +1,2 @@
[GameData]
Class=MechWarrior4::PlayerAI
Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More