-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
42 changed files
with
2,368 additions
and
847 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,367 @@ | ||
/*%FSM<COMPILE "C:\Program Files (x86)\Bohemia Interactive\Tools\FSM Editor Personal Edition\scriptedFSM.cfg, AIDRIVEBEHAVIOR">*/ | ||
/*%FSM<HEAD>*/ | ||
/* | ||
item0[] = {"Begin_State",0,250,27.230743,932.382141,117.230728,982.382141,0.000000,"Begin State"}; | ||
item1[] = {"_UseAI_NO",4,218,-71.160217,944.333618,12.189287,980.293701,50.000000,"_UseAI NO"}; | ||
item2[] = {"_UseAI_YES",4,218,25.820843,803.830933,115.820824,853.830933,49.000000,"_UseAI YES"}; | ||
item3[] = {"Exit_FSM",1,250,-172.898788,944.885925,-100.633377,980.107056,0.000000,"Exit FSM"}; | ||
item4[] = {"Set_Basic",2,250,47.992470,640.068420,137.992477,690.068420,0.000000,"Set Basic"}; | ||
item5[] = {"Start_Unit_Cycle",3,250,-277.033295,537.786499,-187.033173,587.786499,0.000000,"Start Unit Cycle" \n ""}; | ||
item6[] = {"InVehicle",4,218,-276.510803,634.950623,-186.510239,684.950623,50.000000,"InVehicle"}; | ||
item7[] = {"IsDriver_Check",3,250,-279.560516,747.013977,-189.559814,797.014038,0.000000,"IsDriver Check"}; | ||
item8[] = {"_",8,218,-567.255676,579.059387,-522.391418,605.396240,0.000000,""}; | ||
item9[] = {"IsDriver",4,218,-578.212097,754.860107,-516.528442,785.182373,50.000000,"IsDriver"}; | ||
item10[] = {"Driver_Checks",3,250,-589.049622,659.590881,-499.049805,709.590942,0.000000,"Driver Checks"}; | ||
item11[] = {"Wait",4,218,-56.132523,638.493347,5.441658,674.040039,0.000000,"Wait"}; | ||
item12[] = {"Dead",4,218,143.473557,376.974365,233.473541,426.974365,55.000000,"Dead"}; | ||
item13[] = {"IsPlayer",4,218,32.574532,368.949005,122.574593,418.948975,60.000000,"IsPlayer"}; | ||
item14[] = {"_UseAI_NO",4,218,-69.007370,370.299591,20.992760,420.299622,1000.000000,"_UseAI NO"}; | ||
item15[] = {"NO_AI",1,250,-8.550960,247.924850,81.449020,297.924774,0.000000,"NO AI"}; | ||
item16[] = {"DrivingAI",4,218,-722.849548,670.260925,-661.165894,700.583191,48.000000,"DrivingAI"}; | ||
item17[] = {"Driving_Code_Exe",3,250,-867.473022,656.991272,-777.473206,706.991333,0.000000,"Driving Code" \n "Execute"}; | ||
item18[] = {"Wait",4,218,-857.446228,573.621582,-788.383240,610.492249,0.000000,"Wait"}; | ||
item19[] = {"",7,210,-822.051941,78.762360,-814.051941,86.762352,0.000000,""}; | ||
item20[] = {"",7,210,292.207275,82.473511,300.207275,90.473503,0.000000,""}; | ||
item21[] = {"",7,210,293.973633,578.915894,301.973633,586.915894,0.000000,""}; | ||
item22[] = {"_",8,218,-259.642517,462.484131,-203.219254,498.278503,0.000000,""}; | ||
item23[] = {"_",8,218,-255.439270,840.784729,-210.575119,867.121582,0.000000,""}; | ||
item24[] = {"AirCheck",4,218,-722.944275,631.572998,-661.260620,661.895264,50.000000,"AirCheck"}; | ||
item25[] = {"IsNilCheck",4,218,-727.288208,705.030579,-665.604553,735.352844,49.000000,"IsNilCheck"}; | ||
item26[] = {"IsNilCheck",4,218,-177.272858,371.713593,-87.546654,424.469849,1001.000000,"IsNilCheck"}; | ||
link0[] = {0,1}; | ||
link1[] = {0,2}; | ||
link2[] = {1,3}; | ||
link3[] = {2,4}; | ||
link4[] = {4,11}; | ||
link5[] = {4,12}; | ||
link6[] = {4,13}; | ||
link7[] = {4,14}; | ||
link8[] = {4,26}; | ||
link9[] = {5,6}; | ||
link10[] = {5,22}; | ||
link11[] = {6,7}; | ||
link12[] = {7,9}; | ||
link13[] = {7,23}; | ||
link14[] = {8,19}; | ||
link15[] = {9,10}; | ||
link16[] = {10,8}; | ||
link17[] = {10,16}; | ||
link18[] = {10,24}; | ||
link19[] = {10,25}; | ||
link20[] = {11,5}; | ||
link21[] = {12,15}; | ||
link22[] = {13,15}; | ||
link23[] = {14,15}; | ||
link24[] = {16,17}; | ||
link25[] = {17,18}; | ||
link26[] = {18,19}; | ||
link27[] = {19,20}; | ||
link28[] = {20,21}; | ||
link29[] = {21,4}; | ||
link30[] = {22,19}; | ||
link31[] = {23,4}; | ||
link32[] = {24,19}; | ||
link33[] = {25,17}; | ||
link34[] = {26,19}; | ||
globals[] = {0.000000,0,0,0,0,640,480,2,302,6316128,1,-928.722717,437.508514,993.826660,-28.042513,1218,911,1}; | ||
window[] = {2,-1,-1,-1,-1,1225,250,1647,250,3,1236}; | ||
*//*%FSM</HEAD>*/ | ||
class FSM | ||
{ | ||
fsmName = "AIDRIVEBEHAVIOR"; | ||
class States | ||
{ | ||
/*%FSM<STATE "Begin_State">*/ | ||
class Begin_State | ||
{ | ||
name = "Begin_State"; | ||
init = /*%FSM<STATEINIT""">*/"_Unit = _this select 0;" \n | ||
"" \n | ||
"if (VCOM_DRIVE_DEBUG isEqualTo 1) then {systemchat format [""FSM RUNNING ON: %1"",_Unit];};" \n | ||
"" \n | ||
"_Unit setVariable [""VCOM_FSMRunning"",1,false];" \n | ||
"_Unit setVariable [""VCOM_DriverDetectionIsDriver"",0,false];" \n | ||
"" \n | ||
"//Determine if this AI should even execute new code" \n | ||
"_UseAI = _Unit getVariable ""VCOM_NOAI"";" \n | ||
"if (isNil (""_UseAI"")) then {" \n | ||
"_UseAI = 0;" \n | ||
"_Unit setVariable [""VCOM_NOAI"",0,false];" \n | ||
"};" \n | ||
""/*%FSM</STATEINIT""">*/; | ||
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/; | ||
class Links | ||
{ | ||
/*%FSM<LINK "_UseAI_NO">*/ | ||
class _UseAI_NO | ||
{ | ||
priority = 50.000000; | ||
to="Exit_FSM"; | ||
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/; | ||
condition=/*%FSM<CONDITION""">*/"_UseAI isEqualTo 1"/*%FSM</CONDITION""">*/; | ||
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/; | ||
}; | ||
/*%FSM</LINK>*/ | ||
/*%FSM<LINK "_UseAI_YES">*/ | ||
class _UseAI_YES | ||
{ | ||
priority = 49.000000; | ||
to="Set_Basic"; | ||
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/; | ||
condition=/*%FSM<CONDITION""">*/"_UseAI isEqualTo 0"/*%FSM</CONDITION""">*/; | ||
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/; | ||
}; | ||
/*%FSM</LINK>*/ | ||
}; | ||
}; | ||
/*%FSM</STATE>*/ | ||
/*%FSM<STATE "Exit_FSM">*/ | ||
class Exit_FSM | ||
{ | ||
name = "Exit_FSM"; | ||
init = /*%FSM<STATEINIT""">*/""/*%FSM</STATEINIT""">*/; | ||
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/; | ||
class Links | ||
{ | ||
}; | ||
}; | ||
/*%FSM</STATE>*/ | ||
/*%FSM<STATE "Set_Basic">*/ | ||
class Set_Basic | ||
{ | ||
name = "Set_Basic"; | ||
init = /*%FSM<STATEINIT""">*/"_t = time;" \n | ||
"_UseAI = _Unit getVariable ""VCOM_NOAI"";" \n | ||
"" \n | ||
"if (VCOM_DRIVE_DEBUG isEqualTo 1) then {systemchat ""Set Basic Hit!"";};"/*%FSM</STATEINIT""">*/; | ||
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/; | ||
class Links | ||
{ | ||
/*%FSM<LINK "IsNilCheck">*/ | ||
class IsNilCheck | ||
{ | ||
priority = 1001.000000; | ||
to="Set_Basic"; | ||
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/; | ||
condition=/*%FSM<CONDITION""">*/"isNil ""_UseAI"""/*%FSM</CONDITION""">*/; | ||
action=/*%FSM<ACTION""">*/"_Unit setVariable [""VCOM_NOAI"",0,false];"/*%FSM</ACTION""">*/; | ||
}; | ||
/*%FSM</LINK>*/ | ||
/*%FSM<LINK "_UseAI_NO">*/ | ||
class _UseAI_NO | ||
{ | ||
priority = 1000.000000; | ||
to="NO_AI"; | ||
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/; | ||
condition=/*%FSM<CONDITION""">*/"_UseAI isEqualTo 1"/*%FSM</CONDITION""">*/; | ||
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/; | ||
}; | ||
/*%FSM</LINK>*/ | ||
/*%FSM<LINK "IsPlayer">*/ | ||
class IsPlayer | ||
{ | ||
priority = 60.000000; | ||
to="NO_AI"; | ||
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/; | ||
condition=/*%FSM<CONDITION""">*/"isPlayer _Unit"/*%FSM</CONDITION""">*/; | ||
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/; | ||
}; | ||
/*%FSM</LINK>*/ | ||
/*%FSM<LINK "Dead">*/ | ||
class Dead | ||
{ | ||
priority = 55.000000; | ||
to="NO_AI"; | ||
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/; | ||
condition=/*%FSM<CONDITION""">*/"!alive _Unit"/*%FSM</CONDITION""">*/; | ||
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/; | ||
}; | ||
/*%FSM</LINK>*/ | ||
/*%FSM<LINK "Wait">*/ | ||
class Wait | ||
{ | ||
priority = 0.000000; | ||
to="Start_Unit_Cycle"; | ||
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/; | ||
condition=/*%FSM<CONDITION""">*/"time > _t + 2"/*%FSM</CONDITION""">*/; | ||
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/; | ||
}; | ||
/*%FSM</LINK>*/ | ||
}; | ||
}; | ||
/*%FSM</STATE>*/ | ||
/*%FSM<STATE "Start_Unit_Cycle">*/ | ||
class Start_Unit_Cycle | ||
{ | ||
name = "Start_Unit_Cycle"; | ||
init = /*%FSM<STATEINIT""">*/"_t = time;" \n | ||
"" \n | ||
"if (VCOM_DRIVE_DEBUG isEqualTo 1) then {systemchat ""FSM: Vehicle Check"";};"/*%FSM</STATEINIT""">*/; | ||
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/; | ||
class Links | ||
{ | ||
/*%FSM<LINK "InVehicle">*/ | ||
class InVehicle | ||
{ | ||
priority = 50.000000; | ||
to="IsDriver_Check"; | ||
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/; | ||
condition=/*%FSM<CONDITION""">*/"((vehicle _Unit) != _Unit)"/*%FSM</CONDITION""">*/; | ||
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/; | ||
}; | ||
/*%FSM</LINK>*/ | ||
/*%FSM<LINK "_">*/ | ||
class _ | ||
{ | ||
priority = 0.000000; | ||
to="Set_Basic"; | ||
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/; | ||
condition=/*%FSM<CONDITION""">*/""/*%FSM</CONDITION""">*/; | ||
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/; | ||
}; | ||
/*%FSM</LINK>*/ | ||
}; | ||
}; | ||
/*%FSM</STATE>*/ | ||
/*%FSM<STATE "IsDriver_Check">*/ | ||
class IsDriver_Check | ||
{ | ||
name = "IsDriver_Check"; | ||
init = /*%FSM<STATEINIT""">*/"_t = time;" \n | ||
"" \n | ||
"_CheckDriver = [_Unit] call VCOM_fnc_IsDriver;" \n | ||
"" \n | ||
"if (VCOM_DRIVE_DEBUG isEqualTo 1) then {systemchat ""FSM: Driver Check"";};"/*%FSM</STATEINIT""">*/; | ||
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/; | ||
class Links | ||
{ | ||
/*%FSM<LINK "IsDriver">*/ | ||
class IsDriver | ||
{ | ||
priority = 50.000000; | ||
to="Driver_Checks"; | ||
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/; | ||
condition=/*%FSM<CONDITION""">*/"_CheckDriver isEqualTo 1"/*%FSM</CONDITION""">*/; | ||
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/; | ||
}; | ||
/*%FSM</LINK>*/ | ||
/*%FSM<LINK "_">*/ | ||
class _ | ||
{ | ||
priority = 0.000000; | ||
to="Set_Basic"; | ||
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/; | ||
condition=/*%FSM<CONDITION""">*/""/*%FSM</CONDITION""">*/; | ||
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/; | ||
}; | ||
/*%FSM</LINK>*/ | ||
}; | ||
}; | ||
/*%FSM</STATE>*/ | ||
/*%FSM<STATE "Driver_Checks">*/ | ||
class Driver_Checks | ||
{ | ||
name = "Driver_Checks"; | ||
init = /*%FSM<STATEINIT""">*/"_t = time;" \n | ||
"" \n | ||
"_AlreadyExecuted = _Unit getvariable ""VCOM_DriverDetectionIsDriver"";" \n | ||
"" \n | ||
"_ClassName = typeOf (vehicle _Unit);" \n | ||
"_CheckClass = _ClassName isKindOf ""AIR"";" \n | ||
"" \n | ||
"" \n | ||
"if (VCOM_DRIVE_DEBUG isEqualTo 1) then {systemchat ""FSM: Script Running Check"";};"/*%FSM</STATEINIT""">*/; | ||
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/; | ||
class Links | ||
{ | ||
/*%FSM<LINK "AirCheck">*/ | ||
class AirCheck | ||
{ | ||
priority = 50.000000; | ||
to="Set_Basic"; | ||
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/; | ||
condition=/*%FSM<CONDITION""">*/"_CheckClass"/*%FSM</CONDITION""">*/; | ||
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/; | ||
}; | ||
/*%FSM</LINK>*/ | ||
/*%FSM<LINK "IsNilCheck">*/ | ||
class IsNilCheck | ||
{ | ||
priority = 49.000000; | ||
to="Driving_Code_Exe"; | ||
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/; | ||
condition=/*%FSM<CONDITION""">*/"isNil ""_AlreadyExecuted"""/*%FSM</CONDITION""">*/; | ||
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/; | ||
}; | ||
/*%FSM</LINK>*/ | ||
/*%FSM<LINK "DrivingAI">*/ | ||
class DrivingAI | ||
{ | ||
priority = 48.000000; | ||
to="Driving_Code_Exe"; | ||
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/; | ||
condition=/*%FSM<CONDITION""">*/"_AlreadyExecuted isEqualTo 0"/*%FSM</CONDITION""">*/; | ||
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/; | ||
}; | ||
/*%FSM</LINK>*/ | ||
/*%FSM<LINK "_">*/ | ||
class _ | ||
{ | ||
priority = 0.000000; | ||
to="Set_Basic"; | ||
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/; | ||
condition=/*%FSM<CONDITION""">*/""/*%FSM</CONDITION""">*/; | ||
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/; | ||
}; | ||
/*%FSM</LINK>*/ | ||
}; | ||
}; | ||
/*%FSM</STATE>*/ | ||
/*%FSM<STATE "NO_AI">*/ | ||
class NO_AI | ||
{ | ||
name = "NO_AI"; | ||
init = /*%FSM<STATEINIT""">*/""/*%FSM</STATEINIT""">*/; | ||
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/; | ||
class Links | ||
{ | ||
}; | ||
}; | ||
/*%FSM</STATE>*/ | ||
/*%FSM<STATE "Driving_Code_Exe">*/ | ||
class Driving_Code_Exe | ||
{ | ||
name = "Driving_Code_Exe"; | ||
init = /*%FSM<STATEINIT""">*/"_t = time;" \n | ||
"" \n | ||
"" \n | ||
"" \n | ||
" _Unit setVariable [""VCOM_DriverDetectionIsDriver"",1,false];" \n | ||
" [_Unit] spawn VCOM_fnc_VehicleDetection;" \n | ||
"" \n | ||
"if (VCOM_DRIVE_DEBUG isEqualTo 1) then {systemchat ""FSM: Execute Code"";};"/*%FSM</STATEINIT""">*/; | ||
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/; | ||
class Links | ||
{ | ||
/*%FSM<LINK "Wait">*/ | ||
class Wait | ||
{ | ||
priority = 0.000000; | ||
to="Set_Basic"; | ||
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/; | ||
condition=/*%FSM<CONDITION""">*/"time > _t + 1"/*%FSM</CONDITION""">*/; | ||
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/; | ||
}; | ||
/*%FSM</LINK>*/ | ||
}; | ||
}; | ||
/*%FSM</STATE>*/ | ||
}; | ||
initState="Begin_State"; | ||
finalStates[] = | ||
{ | ||
"Exit_FSM", | ||
"NO_AI", | ||
}; | ||
}; | ||
/*%FSM</COMPILE>*/ |
Oops, something went wrong.