1
+ /*%FSM<COMPILE "C:\Program Files (x86)\Bohemia Interactive\Tools\FSM Editor Personal Edition\scriptedFSM.cfg, AIDRIVEBEHAVIOR">*/
2
+ /*%FSM<HEAD>*/
3
+ /*
4
+ item0[] = {"Begin_State",0,250,27.230743,932.382141,117.230728,982.382141,0.000000,"Begin State"};
5
+ item1[] = {"_UseAI_NO",4,218,-71.160217,944.333618,12.189287,980.293701,50.000000,"_UseAI NO"};
6
+ item2[] = {"_UseAI_YES",4,218,25.820843,803.830933,115.820824,853.830933,49.000000,"_UseAI YES"};
7
+ item3[] = {"Exit_FSM",1,250,-172.898788,944.885925,-100.633377,980.107056,0.000000,"Exit FSM"};
8
+ item4[] = {"Set_Basic",2,250,47.992470,640.068420,137.992477,690.068420,0.000000,"Set Basic"};
9
+ item5[] = {"Start_Unit_Cycle",3,250,-277.033295,537.786499,-187.033173,587.786499,0.000000,"Start Unit Cycle" \n ""};
10
+ item6[] = {"InVehicle",4,218,-276.510803,634.950623,-186.510239,684.950623,50.000000,"InVehicle"};
11
+ item7[] = {"IsDriver_Check",3,250,-279.560516,747.013977,-189.559814,797.014038,0.000000,"IsDriver Check"};
12
+ item8[] = {"_",8,218,-567.255676,579.059387,-522.391418,605.396240,0.000000,""};
13
+ item9[] = {"IsDriver",4,218,-578.212097,754.860107,-516.528442,785.182373,50.000000,"IsDriver"};
14
+ item10[] = {"Driver_Checks",3,250,-589.049622,659.590881,-499.049805,709.590942,0.000000,"Driver Checks"};
15
+ item11[] = {"Wait",4,218,-56.132523,638.493347,5.441658,674.040039,0.000000,"Wait"};
16
+ item12[] = {"Dead",4,218,143.473557,376.974365,233.473541,426.974365,55.000000,"Dead"};
17
+ item13[] = {"IsPlayer",4,218,32.574532,368.949005,122.574593,418.948975,60.000000,"IsPlayer"};
18
+ item14[] = {"_UseAI_NO",4,218,-69.007370,370.299591,20.992760,420.299622,1000.000000,"_UseAI NO"};
19
+ item15[] = {"NO_AI",1,250,-8.550960,247.924850,81.449020,297.924774,0.000000,"NO AI"};
20
+ item16[] = {"DrivingAI",4,218,-722.849548,670.260925,-661.165894,700.583191,48.000000,"DrivingAI"};
21
+ item17[] = {"Driving_Code_Exe",3,250,-867.473022,656.991272,-777.473206,706.991333,0.000000,"Driving Code" \n "Execute"};
22
+ item18[] = {"Wait",4,218,-857.446228,573.621582,-788.383240,610.492249,0.000000,"Wait"};
23
+ item19[] = {"",7,210,-822.051941,78.762360,-814.051941,86.762352,0.000000,""};
24
+ item20[] = {"",7,210,292.207275,82.473511,300.207275,90.473503,0.000000,""};
25
+ item21[] = {"",7,210,293.973633,578.915894,301.973633,586.915894,0.000000,""};
26
+ item22[] = {"_",8,218,-259.642517,462.484131,-203.219254,498.278503,0.000000,""};
27
+ item23[] = {"_",8,218,-255.439270,840.784729,-210.575119,867.121582,0.000000,""};
28
+ item24[] = {"AirCheck",4,218,-722.944275,631.572998,-661.260620,661.895264,50.000000,"AirCheck"};
29
+ item25[] = {"IsNilCheck",4,218,-727.288208,705.030579,-665.604553,735.352844,49.000000,"IsNilCheck"};
30
+ item26[] = {"IsNilCheck",4,218,-177.272858,371.713593,-87.546654,424.469849,1001.000000,"IsNilCheck"};
31
+ link0[] = {0,1};
32
+ link1[] = {0,2};
33
+ link2[] = {1,3};
34
+ link3[] = {2,4};
35
+ link4[] = {4,11};
36
+ link5[] = {4,12};
37
+ link6[] = {4,13};
38
+ link7[] = {4,14};
39
+ link8[] = {4,26};
40
+ link9[] = {5,6};
41
+ link10[] = {5,22};
42
+ link11[] = {6,7};
43
+ link12[] = {7,9};
44
+ link13[] = {7,23};
45
+ link14[] = {8,19};
46
+ link15[] = {9,10};
47
+ link16[] = {10,8};
48
+ link17[] = {10,16};
49
+ link18[] = {10,24};
50
+ link19[] = {10,25};
51
+ link20[] = {11,5};
52
+ link21[] = {12,15};
53
+ link22[] = {13,15};
54
+ link23[] = {14,15};
55
+ link24[] = {16,17};
56
+ link25[] = {17,18};
57
+ link26[] = {18,19};
58
+ link27[] = {19,20};
59
+ link28[] = {20,21};
60
+ link29[] = {21,4};
61
+ link30[] = {22,19};
62
+ link31[] = {23,4};
63
+ link32[] = {24,19};
64
+ link33[] = {25,17};
65
+ link34[] = {26,19};
66
+ globals[] = {0.000000,0,0,0,0,640,480,2,302,6316128,1,-928.722717,437.508514,993.826660,-28.042513,1218,911,1};
67
+ window[] = {2,-1,-1,-1,-1,1225,250,1647,250,3,1236};
68
+ *//*%FSM</HEAD>*/
69
+ class FSM
70
+ {
71
+ fsmName = "AIDRIVEBEHAVIOR";
72
+ class States
73
+ {
74
+ /*%FSM<STATE "Begin_State">*/
75
+ class Begin_State
76
+ {
77
+ name = "Begin_State";
78
+ init = /*%FSM<STATEINIT""">*/"_Unit = _this select 0;" \n
79
+ "" \n
80
+ "if (VCOM_DRIVE_DEBUG isEqualTo 1) then {systemchat format [""FSM RUNNING ON: %1"",_Unit];};" \n
81
+ "" \n
82
+ "_Unit setVariable [""VCOM_FSMRunning"",1,false];" \n
83
+ "_Unit setVariable [""VCOM_DriverDetectionIsDriver"",0,false];" \n
84
+ "" \n
85
+ "//Determine if this AI should even execute new code" \n
86
+ "_UseAI = _Unit getVariable ""VCOM_NOAI"";" \n
87
+ "if (isNil (""_UseAI"")) then {" \n
88
+ "_UseAI = 0;" \n
89
+ "_Unit setVariable [""VCOM_NOAI"",0,false];" \n
90
+ "};" \n
91
+ ""/*%FSM</STATEINIT""">*/;
92
+ precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
93
+ class Links
94
+ {
95
+ /*%FSM<LINK "_UseAI_NO">*/
96
+ class _UseAI_NO
97
+ {
98
+ priority = 50.000000;
99
+ to="Exit_FSM";
100
+ precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
101
+ condition=/*%FSM<CONDITION""">*/"_UseAI isEqualTo 1"/*%FSM</CONDITION""">*/;
102
+ action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
103
+ };
104
+ /*%FSM</LINK>*/
105
+ /*%FSM<LINK "_UseAI_YES">*/
106
+ class _UseAI_YES
107
+ {
108
+ priority = 49.000000;
109
+ to="Set_Basic";
110
+ precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
111
+ condition=/*%FSM<CONDITION""">*/"_UseAI isEqualTo 0"/*%FSM</CONDITION""">*/;
112
+ action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
113
+ };
114
+ /*%FSM</LINK>*/
115
+ };
116
+ };
117
+ /*%FSM</STATE>*/
118
+ /*%FSM<STATE "Exit_FSM">*/
119
+ class Exit_FSM
120
+ {
121
+ name = "Exit_FSM";
122
+ init = /*%FSM<STATEINIT""">*/""/*%FSM</STATEINIT""">*/;
123
+ precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
124
+ class Links
125
+ {
126
+ };
127
+ };
128
+ /*%FSM</STATE>*/
129
+ /*%FSM<STATE "Set_Basic">*/
130
+ class Set_Basic
131
+ {
132
+ name = "Set_Basic";
133
+ init = /*%FSM<STATEINIT""">*/"_t = time;" \n
134
+ "_UseAI = _Unit getVariable ""VCOM_NOAI"";" \n
135
+ "" \n
136
+ "if (VCOM_DRIVE_DEBUG isEqualTo 1) then {systemchat ""Set Basic Hit!"";};"/*%FSM</STATEINIT""">*/;
137
+ precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
138
+ class Links
139
+ {
140
+ /*%FSM<LINK "IsNilCheck">*/
141
+ class IsNilCheck
142
+ {
143
+ priority = 1001.000000;
144
+ to="Set_Basic";
145
+ precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
146
+ condition=/*%FSM<CONDITION""">*/"isNil ""_UseAI"""/*%FSM</CONDITION""">*/;
147
+ action=/*%FSM<ACTION""">*/"_Unit setVariable [""VCOM_NOAI"",0,false];"/*%FSM</ACTION""">*/;
148
+ };
149
+ /*%FSM</LINK>*/
150
+ /*%FSM<LINK "_UseAI_NO">*/
151
+ class _UseAI_NO
152
+ {
153
+ priority = 1000.000000;
154
+ to="NO_AI";
155
+ precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
156
+ condition=/*%FSM<CONDITION""">*/"_UseAI isEqualTo 1"/*%FSM</CONDITION""">*/;
157
+ action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
158
+ };
159
+ /*%FSM</LINK>*/
160
+ /*%FSM<LINK "IsPlayer">*/
161
+ class IsPlayer
162
+ {
163
+ priority = 60.000000;
164
+ to="NO_AI";
165
+ precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
166
+ condition=/*%FSM<CONDITION""">*/"isPlayer _Unit"/*%FSM</CONDITION""">*/;
167
+ action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
168
+ };
169
+ /*%FSM</LINK>*/
170
+ /*%FSM<LINK "Dead">*/
171
+ class Dead
172
+ {
173
+ priority = 55.000000;
174
+ to="NO_AI";
175
+ precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
176
+ condition=/*%FSM<CONDITION""">*/"!alive _Unit"/*%FSM</CONDITION""">*/;
177
+ action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
178
+ };
179
+ /*%FSM</LINK>*/
180
+ /*%FSM<LINK "Wait">*/
181
+ class Wait
182
+ {
183
+ priority = 0.000000;
184
+ to="Start_Unit_Cycle";
185
+ precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
186
+ condition=/*%FSM<CONDITION""">*/"time > _t + 2"/*%FSM</CONDITION""">*/;
187
+ action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
188
+ };
189
+ /*%FSM</LINK>*/
190
+ };
191
+ };
192
+ /*%FSM</STATE>*/
193
+ /*%FSM<STATE "Start_Unit_Cycle">*/
194
+ class Start_Unit_Cycle
195
+ {
196
+ name = "Start_Unit_Cycle";
197
+ init = /*%FSM<STATEINIT""">*/"_t = time;" \n
198
+ "" \n
199
+ "if (VCOM_DRIVE_DEBUG isEqualTo 1) then {systemchat ""FSM: Vehicle Check"";};"/*%FSM</STATEINIT""">*/;
200
+ precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
201
+ class Links
202
+ {
203
+ /*%FSM<LINK "InVehicle">*/
204
+ class InVehicle
205
+ {
206
+ priority = 50.000000;
207
+ to="IsDriver_Check";
208
+ precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
209
+ condition=/*%FSM<CONDITION""">*/"((vehicle _Unit) != _Unit)"/*%FSM</CONDITION""">*/;
210
+ action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
211
+ };
212
+ /*%FSM</LINK>*/
213
+ /*%FSM<LINK "_">*/
214
+ class _
215
+ {
216
+ priority = 0.000000;
217
+ to="Set_Basic";
218
+ precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
219
+ condition=/*%FSM<CONDITION""">*/""/*%FSM</CONDITION""">*/;
220
+ action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
221
+ };
222
+ /*%FSM</LINK>*/
223
+ };
224
+ };
225
+ /*%FSM</STATE>*/
226
+ /*%FSM<STATE "IsDriver_Check">*/
227
+ class IsDriver_Check
228
+ {
229
+ name = "IsDriver_Check";
230
+ init = /*%FSM<STATEINIT""">*/"_t = time;" \n
231
+ "" \n
232
+ "_CheckDriver = [_Unit] call VCOM_fnc_IsDriver;" \n
233
+ "" \n
234
+ "if (VCOM_DRIVE_DEBUG isEqualTo 1) then {systemchat ""FSM: Driver Check"";};"/*%FSM</STATEINIT""">*/;
235
+ precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
236
+ class Links
237
+ {
238
+ /*%FSM<LINK "IsDriver">*/
239
+ class IsDriver
240
+ {
241
+ priority = 50.000000;
242
+ to="Driver_Checks";
243
+ precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
244
+ condition=/*%FSM<CONDITION""">*/"_CheckDriver isEqualTo 1"/*%FSM</CONDITION""">*/;
245
+ action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
246
+ };
247
+ /*%FSM</LINK>*/
248
+ /*%FSM<LINK "_">*/
249
+ class _
250
+ {
251
+ priority = 0.000000;
252
+ to="Set_Basic";
253
+ precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
254
+ condition=/*%FSM<CONDITION""">*/""/*%FSM</CONDITION""">*/;
255
+ action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
256
+ };
257
+ /*%FSM</LINK>*/
258
+ };
259
+ };
260
+ /*%FSM</STATE>*/
261
+ /*%FSM<STATE "Driver_Checks">*/
262
+ class Driver_Checks
263
+ {
264
+ name = "Driver_Checks";
265
+ init = /*%FSM<STATEINIT""">*/"_t = time;" \n
266
+ "" \n
267
+ "_AlreadyExecuted = _Unit getvariable ""VCOM_DriverDetectionIsDriver"";" \n
268
+ "" \n
269
+ "_ClassName = typeOf (vehicle _Unit);" \n
270
+ "_CheckClass = _ClassName isKindOf ""AIR"";" \n
271
+ "" \n
272
+ "" \n
273
+ "if (VCOM_DRIVE_DEBUG isEqualTo 1) then {systemchat ""FSM: Script Running Check"";};"/*%FSM</STATEINIT""">*/;
274
+ precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
275
+ class Links
276
+ {
277
+ /*%FSM<LINK "AirCheck">*/
278
+ class AirCheck
279
+ {
280
+ priority = 50.000000;
281
+ to="Set_Basic";
282
+ precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
283
+ condition=/*%FSM<CONDITION""">*/"_CheckClass"/*%FSM</CONDITION""">*/;
284
+ action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
285
+ };
286
+ /*%FSM</LINK>*/
287
+ /*%FSM<LINK "IsNilCheck">*/
288
+ class IsNilCheck
289
+ {
290
+ priority = 49.000000;
291
+ to="Driving_Code_Exe";
292
+ precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
293
+ condition=/*%FSM<CONDITION""">*/"isNil ""_AlreadyExecuted"""/*%FSM</CONDITION""">*/;
294
+ action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
295
+ };
296
+ /*%FSM</LINK>*/
297
+ /*%FSM<LINK "DrivingAI">*/
298
+ class DrivingAI
299
+ {
300
+ priority = 48.000000;
301
+ to="Driving_Code_Exe";
302
+ precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
303
+ condition=/*%FSM<CONDITION""">*/"_AlreadyExecuted isEqualTo 0"/*%FSM</CONDITION""">*/;
304
+ action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
305
+ };
306
+ /*%FSM</LINK>*/
307
+ /*%FSM<LINK "_">*/
308
+ class _
309
+ {
310
+ priority = 0.000000;
311
+ to="Set_Basic";
312
+ precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
313
+ condition=/*%FSM<CONDITION""">*/""/*%FSM</CONDITION""">*/;
314
+ action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
315
+ };
316
+ /*%FSM</LINK>*/
317
+ };
318
+ };
319
+ /*%FSM</STATE>*/
320
+ /*%FSM<STATE "NO_AI">*/
321
+ class NO_AI
322
+ {
323
+ name = "NO_AI";
324
+ init = /*%FSM<STATEINIT""">*/""/*%FSM</STATEINIT""">*/;
325
+ precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
326
+ class Links
327
+ {
328
+ };
329
+ };
330
+ /*%FSM</STATE>*/
331
+ /*%FSM<STATE "Driving_Code_Exe">*/
332
+ class Driving_Code_Exe
333
+ {
334
+ name = "Driving_Code_Exe";
335
+ init = /*%FSM<STATEINIT""">*/"_t = time;" \n
336
+ "" \n
337
+ "" \n
338
+ "" \n
339
+ " _Unit setVariable [""VCOM_DriverDetectionIsDriver"",1,false];" \n
340
+ " [_Unit] spawn VCOM_fnc_VehicleDetection;" \n
341
+ "" \n
342
+ "if (VCOM_DRIVE_DEBUG isEqualTo 1) then {systemchat ""FSM: Execute Code"";};"/*%FSM</STATEINIT""">*/;
343
+ precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
344
+ class Links
345
+ {
346
+ /*%FSM<LINK "Wait">*/
347
+ class Wait
348
+ {
349
+ priority = 0.000000;
350
+ to="Set_Basic";
351
+ precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
352
+ condition=/*%FSM<CONDITION""">*/"time > _t + 1"/*%FSM</CONDITION""">*/;
353
+ action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
354
+ };
355
+ /*%FSM</LINK>*/
356
+ };
357
+ };
358
+ /*%FSM</STATE>*/
359
+ };
360
+ initState="Begin_State";
361
+ finalStates[] =
362
+ {
363
+ "Exit_FSM",
364
+ "NO_AI",
365
+ };
366
+ };
367
+ /*%FSM</COMPILE>*/
0 commit comments