Epoch/Sources/epoch_code/System/sapperSwarmMemberWalking.fsm
2015-09-14 15:55:36 -05:00

220 lines
9.8 KiB
Plaintext

class FSM
{
fsmName = "sapper swarm member walking";
class States
{
class sapper
{
name = "sapper";
itemno = ;
init = "//Developer code" \n
"//Author: axeman (Andrew Gregory | andrew@andgregor.co.uk)" \n
"//Licence:" \n
"//You may not copy, reproduce, edit, move or transfer in any way without the express permission of the author." \n
"//All files contained in this MPMission folder also fall under the Epoch Mod Creative Commons Licence: https://creativecommons.org/licenses/by-nc-nd/4.0/" \n
"//Any files triggered, called, execVM'ed, execFSM'ed etc, by this file fall under the same agreement." \n
"" \n
"" \n
"_unit = _this select 0;" \n
"" \n
"_moveTo = [];" \n
"_nextPos = [];" \n
"" \n
"_callDispose = false;" \n
"_doDispose = false;" \n
"_decisionMade = false;" \n
"_t = diag_tickTime;" \n
"_c = diag_tickTime;" \n
"_sFreqCheck = 1.5;" \n
"_lFreqCheck = 12;" \n
"_doneCheck = false;" \n
"" \n
"//Debug" \n
"_showDebug = {" \n
"hint format [""SAPPER\nAnger: %2\nCanSee: %3\nTarget: %4\nHit: %5\nNear: %6FPS:%1"",diag_fps,_sAnger,_canSee,_trgt,_sHit,_sFiredNear];" \n
"};" \n
"" \n
"" \n
"" \n
"";
precondition = "";
class Links
{
class _
{
itemno = ;
priority = 0.000000;
to="reset___control";
precondition = "";
condition="";
action="";
};
};
};
class instinct
{
name = "instinct";
itemno = ;
init = "//systemchat format [""WI:%1"",diag_tickTime];";
precondition = "";
class Links
{
class instinct_done
{
itemno = ;
priority = 100.000000;
to="action";
precondition = "";
condition="_decisionMade;";
action="_decisionMade = false;";
};
class dispose
{
itemno = ;
priority = 90.000000;
to="instinct";
precondition = "";
condition="!alive _unit || _callDispose;";
action="_doDispose = true;" \n
"_decisionMade = true;" \n
"" \n
"" \n
"";
};
class move
{
itemno = ;
priority = 60.000000;
to="instinct";
precondition = "";
condition="!(_moveTo isEqualTo _nextPos)";
action="_doMove = true;" \n
"_decisionMade = true;" \n
"_moveTo = [] + _nextPos;" \n
"";
};
};
};
class action
{
name = "action";
itemno = ;
init = "//systemchat format [""WA:%1"",diag_tickTime];";
precondition = "";
class Links
{
class dispose
{
itemno = ;
priority = 120.000000;
to="end";
precondition = "";
condition="_doDispose;";
action="";
};
class complete
{
itemno = ;
priority = 100.000000;
to="reset___control";
precondition = "";
condition="_actionDone && ((call compile _criteria) || (diag_tickTime > (_t + _sWait)));";
action="" \n
"if(!isNil ""_criteriaMetAction"")then{" \n
"call _criteriaMetAction;" \n
"};" \n
"" \n
"" \n
"" \n
"" \n
"" \n
"" \n
"" \n
"" \n
"" \n
"";
};
class move
{
itemno = ;
priority = 5.000000;
to="do_move";
precondition = "";
condition="_doMove;" \n
"";
action="_doMove = false;" \n
"";
};
};
};
class reset___control
{
name = "reset___control";
itemno = ;
init = "//Brain Vars" \n
"_criteria =""(false)"";" \n
"_criteriaMetAction = nil;" \n
"_actionDone = false;" \n
"_sWait = 0;" \n
"" \n
"_newTrgt = false;" \n
"" \n
"" \n
"" \n
"";
precondition = "";
class Links
{
class _
{
itemno = ;
priority = 0.000000;
to="instinct";
precondition = "";
condition="";
action="";
};
};
};
class end
{
name = "end";
itemno = ;
init = "//systemchat format[""Walk Disposing for %1"",_unit];";
precondition = "";
class Links
{
};
};
class do_move
{
name = "do_move";
itemno = ;
init = "_unit moveTo _moveTo;" \n
"" \n
"" \n
"_actionDone = true;" \n
"_criteria = ""moveToCompleted _unit || _newTrgt"";" \n
"_sWait = (_unit distance _moveTo) * 2;" \n
"";
precondition = "";
class Links
{
class _
{
itemno = ;
priority = 0.000000;
to="action";
precondition = "";
condition="";
action="";
};
};
};
};
initState="sapper";
finalStates[] =
{
"end"
};
};