Advertisement
Guest User

player_monitor.fsm

a guest
Feb 5th, 2014
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 67.45 KB | None | 0 0
  1. /*%FSM<COMPILE "D:\Programme\Bohemia Interactive\Tools\FSM Editor Personal Edition\scriptedFSM.cfg, DayZ Player Monitor">*/
  2. /*%FSM<HEAD>*/
  3. /*
  4. item0[] = {"init",0,250,-75.000000,-350.000000,25.000000,-300.000000,0.000000,"init"};
  5. item1[] = {"isServer",4,218,50.000000,-350.000000,150.000000,-300.000000,0.000000,"isServer"};
  6. item2[] = {"wait",2,250,50.000000,-275.000000,150.000000,-225.000000,0.000000,"wait"};
  7. item3[] = {"Allow_Conn",4,218,50.000000,-200.000000,150.000000,-150.000000,0.000000,"Allow" \n "Conn"};
  8. item4[] = {"Loading",2,250,-75.000000,-200.000000,25.000000,-150.000000,0.000000,"Loading"};
  9. item5[] = {"Client",4,218,-75.000000,-275.000000,25.000000,-225.000000,0.000000,"Client"};
  10. item6[] = {"player_not_null",4,218,-175.000000,-50.000000,-75.000000,0.000000,0.000000,"player" \n "not null"};
  11. item7[] = {"Prepare",2,250,-75.000000,0.000000,25.000000,50.000000,0.000000,"Prepare"};
  12. item8[] = {"player___player",4,218,50.000000,50.000000,150.000000,100.000000,0.000000,"player =" \n "player"};
  13. item9[] = {"Collect",2,250,-75.000000,100.000000,25.000000,150.000000,0.000000,"Collect"};
  14. item10[] = {"Has_PlayerID",4,218,-75.000000,175.000000,25.000000,225.000000,1.000000,"Has PlayerID"};
  15. item11[] = {"no_PlayerID",4,218,50.000000,150.000000,150.000000,200.000000,2.000000,"no PlayerID"};
  16. item12[] = {"ERROR__No_Player",2,250,175.000000,150.000000,275.000000,200.000000,0.000000,"ERROR:" \n "No PlayerID"};
  17. item13[] = {"Request",2,250,-75.000000,400.000000,25.000000,450.000000,0.000000,"Request"};
  18. item14[] = {"Response",4,218,-175.000000,450.000000,-75.000000,500.000000,0.000000,"Response"};
  19. item15[] = {"Parse_Login",2,250,-75.000000,500.000000,25.000000,550.000000,0.000000,"Parse Login"};
  20. item16[] = {"Hive_Bad",4,218,50.000000,500.000000,150.000000,550.000000,10.000000,"Hive" \n "Bad"};
  21. item17[] = {"ERROR__Wrong_HIVE",2,250,175.000000,500.000000,275.000000,550.000000,0.000000,"ERROR:" \n "Wrong HIVE" \n "Version"};
  22. item18[] = {"Hive_Ok",4,218,-175.000000,550.000000,-75.000000,600.000000,0.000000,"Hive" \n "Ok"};
  23. item19[] = {"Phase_One",2,250,-75.000000,600.000000,25.000000,650.000000,0.000000,"Phase One"};
  24. item20[] = {"Response",4,218,-175.000000,650.000000,-75.000000,700.000000,0.000000,"Response"};
  25. item21[] = {"Phase_Two",2,250,-75.000000,700.000000,25.000000,750.000000,0.000000,"Phase Two"};
  26. item22[] = {"Dead_Player",4,218,50.000000,700.000000,150.000000,750.000000,0.000000,"Dead" \n "Player"};
  27. item23[] = {"ERROR__Player_Already",2,250,175.000000,700.000000,275.000000,750.000000,0.000000,"ERROR:" \n "Player Already" \n "Dead"};
  28. item24[] = {"Alive",4,218,-175.000000,750.000000,-75.000000,800.000000,0.000000,"Alive"};
  29. item25[] = {"Position",2,250,-75.000000,800.000000,25.000000,850.000000,0.000000,"Position"};
  30. item26[] = {"Version_Ok",4,218,-175.000000,850.000000,-75.000000,900.000000,0.000000,"Version" \n "Ok"};
  31. item27[] = {"Load_In",2,250,-75.000000,1000.000000,25.000000,1050.000000,0.000000,"Load In"};
  32. item28[] = {"Bad_Version",4,218,50.000000,800.000000,150.000000,850.000000,0.000000,"Bad" \n "Version"};
  33. item29[] = {"ERROR__Bad_Versi",2,250,175.000000,800.000000,275.000000,850.000000,0.000000,"ERROR:" \n "Bad Version"};
  34. item30[] = {"Display_Ready",4,218,-175.000000,1050.000000,-75.000000,1100.000000,0.000000,"Display" \n "Ready"};
  35. item31[] = {"Preload_Display",2,250,-75.000000,1100.000000,25.000000,1150.000000,0.000000,"Preload" \n "Display"};
  36. item32[] = {"Preload_Done",4,218,-175.000000,1150.000000,-75.000000,1200.000000,0.000000,"Preload" \n "Done"};
  37. item33[] = {"Initialize",2,250,-75.000000,1200.000000,25.000000,1250.000000,0.000000,"Initialize"};
  38. item34[] = {"Finish",1,250,-75.000000,1300.000000,25.000000,1350.000000,0.000000,"Finish"};
  39. item35[] = {"True",8,218,25.000000,1250.000000,125.000000,1300.000000,0.000000,"True"};
  40. item36[] = {"Too_Long",4,218,300.000000,150.000000,400.000000,200.000000,0.000000,"Too" \n "Long"};
  41. item37[] = {"Too_Long",4,218,300.000000,500.000000,400.000000,550.000000,0.000000,"Too" \n "Long"};
  42. item38[] = {"Too_Long",4,218,300.000000,700.000000,400.000000,750.000000,0.000000,"Too" \n "Long"};
  43. item39[] = {"Too_Long",4,218,300.000000,800.000000,400.000000,850.000000,0.000000,"Too" \n "Long"};
  44. item40[] = {"Enable_Sim",2,250,-75.000000,-100.000000,25.000000,-50.000000,0.000000,"Enable Sim"};
  45. item41[] = {"Initialized",4,218,-175.000000,-150.000000,-75.000000,-100.000000,0.000000,"Initialized"};
  46. item42[] = {"New_Character",4,218,-325.000000,400.000000,-225.000000,450.000000,5.000000,"New" \n "Character"};
  47. item43[] = {"Gender_Selection",2,250,-575.000000,400.000000,-475.000000,450.000000,0.000000,"Gender Selection" \n "Dialog"};
  48. item44[] = {"Selected",4,218,-575.000000,475.000000,-475.000000,525.000000,0.000000,"Selected"};
  49. item45[] = {"Process",2,250,-575.000000,550.000000,-475.000000,600.000000,0.000000,"Process"};
  50. item46[] = {"no_PlayerID",4,218,50.000000,-100.000000,150.000000,-50.000000,2.000000,"no PlayerID"};
  51. item47[] = {"ERROR__No_Player_1",2,250,175.000000,-100.000000,275.000000,-50.000000,0.000000,"ERROR:" \n "No PlayerID"};
  52. item48[] = {"Too_Long",4,218,300.000000,-100.000000,400.000000,-50.000000,0.000000,"Too" \n "Long"};
  53. item49[] = {"Stream",2,250,-75.000000,900.000000,25.000000,950.000000,0.000000,"Stream"};
  54. item50[] = {"Preloaded",4,218,-175.000000,950.000000,-75.000000,1000.000000,0.000000,"Preloaded"};
  55. item51[] = {"Retry",4,218,25.000000,375.000000,125.000000,425.000000,0.000000,"Retry"};
  56. item52[] = {"retry_",4,218,25.000000,425.000000,125.000000,475.000000,0.000000,"retry" \n ""};
  57. item53[] = {"Retry",2,250,125.000000,400.000000,225.000000,450.000000,0.000000,"Retry"};
  58. item54[] = {"auth_failed",4,218,250.000000,400.000000,350.000000,450.000000,0.000000,"auth failed"};
  59. item55[] = {"get_ready_to_clo",2,250,400.000000,400.000000,500.000000,450.000000,0.000000,"get ready to close"};
  60. item56[] = {"sleep_",4,218,550.000000,400.000000,650.000000,450.000000,0.000000,"sleep" \n ""};
  61. item57[] = {"Disconnect",2,250,825.000000,400.000000,925.000000,450.000000,0.000000,"Disconnect"};
  62. item58[] = {"No_time_date",4,218,25.000000,1150.000000,125.000000,1200.000000,0.000000,"No time/date"};
  63. item59[] = {"ERROR__No_Date_or",2,250,175.000000,1150.000000,275.000000,1200.000000,0.000000,"ERROR:" \n "No Date or Time"};
  64. item60[] = {"Too_Long",4,218,300.000000,1150.000000,400.000000,1200.000000,0.000000,"Too" \n "Long"};
  65. item61[] = {"get_ready_to_clo_1",2,250,450.000000,800.000000,550.000000,850.000000,0.000000,"get ready to close"};
  66. item62[] = {"sleep_",4,218,600.000000,800.000000,700.000000,850.000000,0.000000,"sleep" \n ""};
  67. item63[] = {"Server_Loading",2,250,-75.000000,250.000000,25.000000,300.000000,0.000000,"Server Loading"};
  68. item64[] = {"Too_Long",4,218,50.000000,250.000000,150.000000,300.000000,0.000000,"Too" \n "Long"};
  69. item65[] = {"Server_Ready",4,218,-75.000000,325.000000,25.000000,375.000000,0.000000,"Server Ready"};
  70. item66[] = {"New_Infected_Cha",4,218,-325.000000,475.000000,-225.000000,525.000000,5.000000,"New" \n "Infected" \n "Character"};
  71. item67[] = {"Player_Zombie__S",2,250,-450.000000,475.000000,-350.000000,525.000000,0.000000,"Player Zombie" \n " Selection"};
  72. item68[] = {"",7,210,-204.000000,521.000000,-196.000000,529.000000,0.000000,""};
  73. item69[] = {"",7,210,-204.000000,496.000000,-196.000000,504.000000,0.000000,""};
  74. item70[] = {"",7,210,-204.000000,421.000000,-196.000000,429.000000,0.000000,""};
  75. item71[] = {"",7,210,-404.000000,571.000000,-396.000000,579.000000,0.000000,""};
  76. item72[] = {"",7,210,871.000000,1171.000000,879.000000,1179.000000,0.000000,""};
  77. item73[] = {"",7,210,871.000000,821.000000,879.000000,829.000000,0.000000,""};
  78. item74[] = {"",7,210,871.000000,721.000000,879.000000,729.000000,0.000000,""};
  79. item75[] = {"",7,210,871.000000,521.000000,879.000000,529.000000,0.000000,""};
  80. item76[] = {"",7,210,871.000000,170.999985,879.000000,179.000015,0.000000,""};
  81. item77[] = {"",7,210,871.000000,-79.000000,879.000000,-71.000000,0.000000,""};
  82. item78[] = {"",7,210,871.000000,271.000000,879.000000,279.000000,0.000000,""};
  83. link0[] = {0,1};
  84. link1[] = {0,5};
  85. link2[] = {1,2};
  86. link3[] = {2,3};
  87. link4[] = {3,4};
  88. link5[] = {4,41};
  89. link6[] = {5,4};
  90. link7[] = {6,7};
  91. link8[] = {7,8};
  92. link9[] = {8,9};
  93. link10[] = {9,10};
  94. link11[] = {9,11};
  95. link12[] = {10,63};
  96. link13[] = {11,12};
  97. link14[] = {12,36};
  98. link15[] = {13,14};
  99. link16[] = {13,52};
  100. link17[] = {14,15};
  101. link18[] = {15,16};
  102. link19[] = {15,18};
  103. link20[] = {15,68};
  104. link21[] = {16,17};
  105. link22[] = {17,37};
  106. link23[] = {18,19};
  107. link24[] = {19,20};
  108. link25[] = {20,21};
  109. link26[] = {21,22};
  110. link27[] = {21,24};
  111. link28[] = {22,23};
  112. link29[] = {23,38};
  113. link30[] = {24,25};
  114. link31[] = {25,26};
  115. link32[] = {25,28};
  116. link33[] = {26,49};
  117. link34[] = {27,30};
  118. link35[] = {28,29};
  119. link36[] = {29,39};
  120. link37[] = {30,31};
  121. link38[] = {31,32};
  122. link39[] = {32,33};
  123. link40[] = {33,35};
  124. link41[] = {33,58};
  125. link42[] = {35,34};
  126. link43[] = {36,76};
  127. link44[] = {37,75};
  128. link45[] = {38,74};
  129. link46[] = {39,61};
  130. link47[] = {40,6};
  131. link48[] = {40,46};
  132. link49[] = {41,40};
  133. link50[] = {42,43};
  134. link51[] = {43,44};
  135. link52[] = {44,45};
  136. link53[] = {45,71};
  137. link54[] = {46,47};
  138. link55[] = {47,48};
  139. link56[] = {48,77};
  140. link57[] = {49,50};
  141. link58[] = {50,27};
  142. link59[] = {51,13};
  143. link60[] = {52,53};
  144. link61[] = {53,51};
  145. link62[] = {53,54};
  146. link63[] = {54,55};
  147. link64[] = {55,56};
  148. link65[] = {56,57};
  149. link66[] = {58,59};
  150. link67[] = {59,60};
  151. link68[] = {60,72};
  152. link69[] = {61,62};
  153. link70[] = {62,73};
  154. link71[] = {63,64};
  155. link72[] = {63,65};
  156. link73[] = {64,78};
  157. link74[] = {65,13};
  158. link75[] = {66,67};
  159. link76[] = {67,71};
  160. link77[] = {68,69};
  161. link78[] = {69,66};
  162. link79[] = {69,70};
  163. link80[] = {70,42};
  164. link81[] = {71,18};
  165. link82[] = {72,73};
  166. link83[] = {73,74};
  167. link84[] = {74,75};
  168. link85[] = {75,57};
  169. link86[] = {76,78};
  170. link87[] = {77,76};
  171. link88[] = {78,57};
  172. globals[] = {25.000000,1,0,0,0,640,480,1,143,6316128,1,-158.844666,996.923462,645.150146,-280.887787,1137,911,1};
  173. window[] = {2,-1,-1,-1,-1,908,150,1428,150,3,1155};
  174. *//*%FSM</HEAD>*/
  175. class FSM
  176. {
  177. fsmName = "DayZ Player Monitor";
  178. class States
  179. {
  180. /*%FSM<STATE "init">*/
  181. class init
  182. {
  183. name = "init";
  184. init = /*%FSM<STATEINIT""">*/"dayz_versionNo = getText(configFile >> ""CfgMods"" >> ""DayZ"" >> ""version"");" \n
  185. "diag_log (""DAYZ: CLIENT IS RUNNING DAYZ_CODE "" + str(dayz_versionNo));" \n
  186. "" \n
  187. "_AuthAttempt = 0;" \n
  188. "" \n
  189. "0 fadeSound 0;" \n
  190. "//player setPosATL [-2148,6655,0];" \n
  191. "" \n
  192. "progressLoadingScreen 0.1;" \n
  193. "0 cutText ["""",""BLACK""];" \n
  194. "" \n
  195. "_timeStart = diag_tickTime;" \n
  196. "_readytoAuth = false;" \n
  197. "_startCheck = 0;" \n
  198. "//player enableSimulation false;" \n
  199. "if(isNil ""DZEdebug"") then { DZEdebug = false; };" \n
  200. "_debug = DZEdebug;" \n
  201. "" \n
  202. ""/*%FSM</STATEINIT""">*/;
  203. precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
  204. class Links
  205. {
  206. /*%FSM<LINK "Client">*/
  207. class Client
  208. {
  209. priority = 0.000000;
  210. to="Loading";
  211. precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
  212. condition=/*%FSM<CONDITION""">*/"!isServer"/*%FSM</CONDITION""">*/;
  213. action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
  214. };
  215. /*%FSM</LINK>*/
  216. /*%FSM<LINK "isServer">*/
  217. class isServer
  218. {
  219. priority = 0.000000;
  220. to="wait";
  221. precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
  222. condition=/*%FSM<CONDITION""">*/"isServer"/*%FSM</CONDITION""">*/;
  223. action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
  224. };
  225. /*%FSM</LINK>*/
  226. };
  227. };
  228. /*%FSM</STATE>*/
  229. /*%FSM<STATE "wait">*/
  230. class wait
  231. {
  232. name = "wait";
  233. init = /*%FSM<STATEINIT""">*/""/*%FSM</STATEINIT""">*/;
  234. precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
  235. class Links
  236. {
  237. /*%FSM<LINK "Allow_Conn">*/
  238. class Allow_Conn
  239. {
  240. priority = 0.000000;
  241. to="Loading";
  242. precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
  243. condition=/*%FSM<CONDITION""">*/"allowConnection"/*%FSM</CONDITION""">*/;
  244. action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
  245. };
  246. /*%FSM</LINK>*/
  247. };
  248. };
  249. /*%FSM</STATE>*/
  250. /*%FSM<STATE "Loading">*/
  251. class Loading
  252. {
  253. name = "Loading";
  254. init = /*%FSM<STATEINIT""">*/"endLoadingScreen;" \n
  255. "if (_debug) then {" \n
  256. "diag_log (""PLOGIN: Initating"");" \n
  257. "};" \n
  258. "" \n
  259. "dayz_loadScreenMsg = (localize ""str_player_13""); " \n
  260. "" \n
  261. "progressLoadingScreen 0.2;" \n
  262. ""/*%FSM</STATEINIT""">*/;
  263. precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
  264. class Links
  265. {
  266. /*%FSM<LINK "Initialized">*/
  267. class Initialized
  268. {
  269. priority = 0.000000;
  270. to="Enable_Sim";
  271. precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
  272. condition=/*%FSM<CONDITION""">*/"!isnil ""bis_fnc_init"""/*%FSM</CONDITION""">*/;
  273. action=/*%FSM<ACTION""">*/"dayz_forceSave = {" \n
  274. "_gearSave = false;" \n
  275. "" \n
  276. "if (!dialog) then {" \n
  277. " createGearDialog [player, ""RscDisplayGear""];" \n
  278. " _gearSave = true;" \n
  279. "};" \n
  280. "" \n
  281. "_dialog = findDisplay 106;" \n
  282. "_magazineArray = [];" \n
  283. "" \n
  284. "//Primary Mags" \n
  285. "for ""_i"" from 109 to 120 do " \n
  286. "{" \n
  287. " _control = _dialog displayCtrl _i;" \n
  288. " _item = gearSlotData _control;" \n
  289. " _val = gearSlotAmmoCount _control;" \n
  290. " _max = getNumber (configFile >> ""CfgMagazines"" >> _item >> ""count"");" \n
  291. " if (_item != """") then {" \n
  292. " if (_val != _max) then {" \n
  293. " _magazineArray set [count _magazineArray,[_item,_val]];" \n
  294. " } else {" \n
  295. " _magazineArray set [count _magazineArray,_item];" \n
  296. " };" \n
  297. " };" \n
  298. "};" \n
  299. "" \n
  300. "//Secondary Mags" \n
  301. "for ""_i"" from 122 to 129 do " \n
  302. "{" \n
  303. " _control = _dialog displayCtrl _i;" \n
  304. " _item = gearSlotData _control;" \n
  305. " _val = gearSlotAmmoCount _control;" \n
  306. " _max = getNumber (configFile >> ""CfgMagazines"" >> _item >> ""count"");" \n
  307. " if (_item != """") then {" \n
  308. " if (_val != _max) then {" \n
  309. " _magazineArray set [count _magazineArray,[_item,_val]];" \n
  310. " } else {" \n
  311. " _magazineArray set [count _magazineArray,_item];" \n
  312. " };" \n
  313. " };" \n
  314. "};" \n
  315. "" \n
  316. "if (_gearSave) then {" \n
  317. " closeDialog 0;" \n
  318. "};" \n
  319. "" \n
  320. " _medical = player call player_sumMedical;" \n
  321. " " \n
  322. " /*" \n
  323. " Get character state details" \n
  324. " */" \n
  325. " _currentWpn = currentMuzzle player;" \n
  326. " _currentAnim = animationState player;" \n
  327. " _config = configFile >> ""CfgMovesMaleSdr"" >> ""States"" >> _currentAnim;" \n
  328. " _onLadder = (getNumber (_config >> ""onLadder"")) == 1;" \n
  329. " _isTerminal = (getNumber (_config >> ""terminal"")) == 1;" \n
  330. " _isInVehicle = vehicle player != player;" \n
  331. " //_wpnDisabled = (getNumber (_config >> ""disableWeapons"")) == 1;" \n
  332. " _currentModel = typeOf player;" \n
  333. " _charPos = getPosATL player;" \n
  334. " _playerPos = [round(direction player),_charPos];" \n
  335. " " \n
  336. " if (_onLadder or _isInVehicle or _isTerminal) then {" \n
  337. " _currentAnim = """";" \n
  338. " //If position to be updated, make sure it is at ground level!" \n
  339. " if ((count _playerPos > 0) and !_isTerminal) then {" \n
  340. " _charPos set [2,0];" \n
  341. " _playerPos set[1,_charPos];" \n
  342. " };" \n
  343. " };" \n
  344. " if (_isInVehicle) then {" \n
  345. " _currentWpn = """";" \n
  346. " } else {" \n
  347. " if ( typeName(_currentWpn) == ""STRING"" ) then {" \n
  348. " _muzzles = getArray(configFile >> ""cfgWeapons"" >> _currentWpn >> ""muzzles"");" \n
  349. " if (count _muzzles > 1) then {" \n
  350. " _currentWpn = currentMuzzle player;" \n
  351. " }; " \n
  352. " } else {" \n
  353. " //diag_log (""DW_DEBUG: _currentWpn: "" + str(_currentWpn));" \n
  354. " _currentWpn = """";" \n
  355. " };" \n
  356. " };" \n
  357. " _temp = round(player getVariable [""temperature"",100]);" \n
  358. " _currentState = [_currentWpn,_currentAnim,_temp];" \n
  359. " " \n
  360. " dayz_Magazines = _magazineArray;" \n
  361. " PVDZE_plr_Save = [player,dayz_Magazines,false,true];" \n
  362. " publicVariableServer ""PVDZE_plr_Save"";" \n
  363. " " \n
  364. " if (isServer) then {" \n
  365. " PVDZE_plr_Save call server_playerSync;" \n
  366. " };" \n
  367. " " \n
  368. " dayz_lastSave = diag_tickTime;" \n
  369. " dayz_Magazines = [];" \n
  370. "};"/*%FSM</ACTION""">*/;
  371. };
  372. /*%FSM</LINK>*/
  373. };
  374. };
  375. /*%FSM</STATE>*/
  376. /*%FSM<STATE "Prepare">*/
  377. class Prepare
  378. {
  379. name = "Prepare";
  380. init = /*%FSM<STATEINIT""">*/"if (_debug) then {" \n
  381. "diag_log (""PLOGIN: Player Model Exists"");" \n
  382. "};"/*%FSM</STATEINIT""">*/;
  383. precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
  384. class Links
  385. {
  386. /*%FSM<LINK "player___player">*/
  387. class player___player
  388. {
  389. priority = 0.000000;
  390. to="Collect";
  391. precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
  392. condition=/*%FSM<CONDITION""">*/"player == player"/*%FSM</CONDITION""">*/;
  393. action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
  394. };
  395. /*%FSM</LINK>*/
  396. };
  397. };
  398. /*%FSM</STATE>*/
  399. /*%FSM<STATE "Collect">*/
  400. class Collect
  401. {
  402. name = "Collect";
  403. init = /*%FSM<STATEINIT""">*/"if (_debug) then {" \n
  404. "diag_log (""PLOGIN: Player Ready"");" \n
  405. "};" \n
  406. "dayz_loadScreenMsg = (localize ""str_player_13""); " \n
  407. "" \n
  408. "progressLoadingScreen 0.3;" \n
  409. "" \n
  410. "_playerUID = getPlayerUID player;"/*%FSM</STATEINIT""">*/;
  411. precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
  412. class Links
  413. {
  414. /*%FSM<LINK "no_PlayerID">*/
  415. class no_PlayerID
  416. {
  417. priority = 2.000000;
  418. to="ERROR__No_Player";
  419. precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
  420. condition=/*%FSM<CONDITION""">*/"_playerUID == """""/*%FSM</CONDITION""">*/;
  421. action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
  422. };
  423. /*%FSM</LINK>*/
  424. /*%FSM<LINK "Has_PlayerID">*/
  425. class Has_PlayerID
  426. {
  427. priority = 1.000000;
  428. to="Server_Loading";
  429. precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
  430. condition=/*%FSM<CONDITION""">*/"!(isNil ""_playerUID"")"/*%FSM</CONDITION""">*/;
  431. action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
  432. };
  433. /*%FSM</LINK>*/
  434. };
  435. };
  436. /*%FSM</STATE>*/
  437. /*%FSM<STATE "ERROR__No_Player">*/
  438. class ERROR__No_Player
  439. {
  440. name = "ERROR__No_Player";
  441. init = /*%FSM<STATEINIT""">*/"endLoadingScreen;" \n
  442. "selectNoPlayer;" \n
  443. "_myTime = diag_tickTime;" \n
  444. "1 cutText [localize ""str_player_14"", ""PLAIN"",15];"/*%FSM</STATEINIT""">*/;
  445. precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
  446. class Links
  447. {
  448. /*%FSM<LINK "Too_Long">*/
  449. class Too_Long
  450. {
  451. priority = 0.000000;
  452. to="Disconnect";
  453. precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
  454. condition=/*%FSM<CONDITION""">*/"(diag_tickTime - _myTime) > 10"/*%FSM</CONDITION""">*/;
  455. action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
  456. };
  457. /*%FSM</LINK>*/
  458. };
  459. };
  460. /*%FSM</STATE>*/
  461. /*%FSM<STATE "Request">*/
  462. class Request
  463. {
  464. name = "Request";
  465. init = /*%FSM<STATEINIT""">*/"if (_debug) then {" \n
  466. "diag_log (""PLOGIN: Requesting Authentication... ("" + _playerUID + "")"");" \n
  467. "};" \n
  468. "dayz_loadScreenMsg = (localize ""str_player_15"");" \n
  469. "" \n
  470. "progressLoadingScreen 0.7;" \n
  471. "" \n
  472. "_msg = [];" \n
  473. "" \n
  474. "PVDZE_plr_Login = [_playerUID,player];" \n
  475. "publicVariableServer ""PVDZE_plr_Login"";" \n
  476. "" \n
  477. "if (isServer) then {" \n
  478. " PVDZE_plr_Login call server_playerLogin;" \n
  479. "};" \n
  480. "" \n
  481. "dayzPlayerLogin = [];" \n
  482. "" \n
  483. "_myTime = diag_tickTime;" \n
  484. ""/*%FSM</STATEINIT""">*/;
  485. precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
  486. class Links
  487. {
  488. /*%FSM<LINK "retry_">*/
  489. class retry_
  490. {
  491. priority = 0.000000;
  492. to="Retry";
  493. precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
  494. condition=/*%FSM<CONDITION""">*/"(diag_tickTime - _myTime) > 10"/*%FSM</CONDITION""">*/;
  495. action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
  496. };
  497. /*%FSM</LINK>*/
  498. /*%FSM<LINK "Response">*/
  499. class Response
  500. {
  501. priority = 0.000000;
  502. to="Parse_Login";
  503. precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
  504. condition=/*%FSM<CONDITION""">*/"count (dayzPlayerLogin) > 1"/*%FSM</CONDITION""">*/;
  505. action=/*%FSM<ACTION""">*/"_msg = dayzPlayerLogin;"/*%FSM</ACTION""">*/;
  506. };
  507. /*%FSM</LINK>*/
  508. };
  509. };
  510. /*%FSM</STATE>*/
  511. /*%FSM<STATE "Parse_Login">*/
  512. class Parse_Login
  513. {
  514. name = "Parse_Login";
  515. init = /*%FSM<STATEINIT""">*/"dayz_authed = true;" \n
  516. "" \n
  517. "progressLoadingScreen 0.6;" \n
  518. "_charID = _msg select 0;" \n
  519. "_inventory = _msg select 1;" \n
  520. "_backpack = _msg select 2;" \n
  521. "_survival = _msg select 3;" \n
  522. "_isNew = _msg select 4;" \n
  523. "//_state = _msg select 5;" \n
  524. "_version = _msg select 5;" \n
  525. "_model = _msg select 6;" \n
  526. "" \n
  527. "_isHiveOk = false;" \n
  528. "_newPlayer = false;" \n
  529. "_isInfected = false;" \n
  530. "" \n
  531. "if (count _msg > 7) then {" \n
  532. " _isHiveOk = _msg select 7;" \n
  533. " _newPlayer = _msg select 8;" \n
  534. " _isInfected = _msg select 9;" \n
  535. " diag_log (""PLAYER RESULT: "" + str(_isHiveOk));" \n
  536. "};" \n
  537. "" \n
  538. "dayz_loadScreenMsg = (localize ""str_player_17""); " \n
  539. "progressLoadingScreen 0.8;" \n
  540. "if (_debug) then {" \n
  541. "diag_log (""PLOGIN: authenticated with : "" + str(_msg));" \n
  542. "};" \n
  543. "//Not Equal Failure" \n
  544. "" \n
  545. "if (isNil ""_model"") then {" \n
  546. " _model = ""Survivor2_DZ"";" \n
  547. " diag_log (""PLOGIN: Model was nil, loading as survivor"");" \n
  548. "};" \n
  549. "" \n
  550. "if (_model == """") then {" \n
  551. " _model = ""Survivor2_DZ"";" \n
  552. " diag_log (""PLOGIN: Model was empty, loading as survivor"");" \n
  553. "};" \n
  554. "" \n
  555. "if (_model == ""Survivor1_DZ"") then {" \n
  556. " _model = ""Survivor2_DZ"";" \n
  557. "};" \n
  558. "" \n
  559. "_isHack = false;" \n
  560. "if (_model == ""hacker"") then {" \n
  561. " _isHack = true;" \n
  562. "};"/*%FSM</STATEINIT""">*/;
  563. precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
  564. class Links
  565. {
  566. /*%FSM<LINK "Hive_Bad">*/
  567. class Hive_Bad
  568. {
  569. priority = 10.000000;
  570. to="ERROR__Wrong_HIVE";
  571. precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
  572. condition=/*%FSM<CONDITION""">*/"!_isHiveOk"/*%FSM</CONDITION""">*/;
  573. action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
  574. };
  575. /*%FSM</LINK>*/
  576. /*%FSM<LINK "New_Infected_Cha">*/
  577. class New_Infected_Cha
  578. {
  579. priority = 5.000000;
  580. to="Player_Zombie__S";
  581. precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
  582. condition=/*%FSM<CONDITION""">*/"_isNew && _isInfected == 1"/*%FSM</CONDITION""">*/;
  583. action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
  584. };
  585. /*%FSM</LINK>*/
  586. /*%FSM<LINK "New_Character">*/
  587. class New_Character
  588. {
  589. priority = 5.000000;
  590. to="Gender_Selection";
  591. precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
  592. condition=/*%FSM<CONDITION""">*/"_isNew && _isInfected == 0"/*%FSM</CONDITION""">*/;
  593. action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
  594. };
  595. /*%FSM</LINK>*/
  596. /*%FSM<LINK "Hive_Ok">*/
  597. class Hive_Ok
  598. {
  599. priority = 0.000000;
  600. to="Phase_One";
  601. precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
  602. condition=/*%FSM<CONDITION""">*/"true"/*%FSM</CONDITION""">*/;
  603. action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
  604. };
  605. /*%FSM</LINK>*/
  606. };
  607. };
  608. /*%FSM</STATE>*/
  609. /*%FSM<STATE "ERROR__Wrong_HIVE">*/
  610. class ERROR__Wrong_HIVE
  611. {
  612. name = "ERROR__Wrong_HIVE";
  613. init = /*%FSM<STATEINIT""">*/"endLoadingScreen;" \n
  614. "selectNoPlayer;" \n
  615. "" \n
  616. "_myTime = diag_tickTime;" \n
  617. "1 cutText [(localize ""str_epoch_player_112""), ""PLAIN"",5];"/*%FSM</STATEINIT""">*/;
  618. precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
  619. class Links
  620. {
  621. /*%FSM<LINK "Too_Long">*/
  622. class Too_Long
  623. {
  624. priority = 0.000000;
  625. to="Disconnect";
  626. precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
  627. condition=/*%FSM<CONDITION""">*/"(diag_tickTime - _myTime) > 10"/*%FSM</CONDITION""">*/;
  628. action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
  629. };
  630. /*%FSM</LINK>*/
  631. };
  632. };
  633. /*%FSM</STATE>*/
  634. /*%FSM<STATE "Phase_One">*/
  635. class Phase_One
  636. {
  637. name = "Phase_One";
  638. init = /*%FSM<STATEINIT""">*/"dayz_playerName = name player;" \n
  639. "_model call player_switchModel;" \n
  640. "" \n
  641. "player allowDamage false;" \n
  642. "_lastAte = _survival select 1;" \n
  643. "_lastDrank = _survival select 2;" \n
  644. "" \n
  645. "_usedFood = 0;" \n
  646. "_usedWater = 0;" \n
  647. "" \n
  648. "//_inventory = [[""Mk_48_DZ"",""NVGoggles"",""Binocular_Vector"",""M9SD"",""ItemGPS"",""ItemToolbox"",""ItemEtool"",""ItemCompass"",""ItemMatchbox"",""FoodCanBakedBeans"",""ItemKnife"",""ItemMap"",""ItemWatch""],[[""100Rnd_762x51_M240"",47],""ItemPainkiller"",""ItemBandage"",""15Rnd_9x19_M9SD"",""100Rnd_762x51_M240"",""ItemBandage"",""ItemBandage"",""15Rnd_9x19_M9SD"",""15Rnd_9x19_M9SD"",""15Rnd_9x19_M9SD"",""ItemMorphine"",""PartWoodPile""]];" \n
  649. "" \n
  650. "player removeWeapon ""ItemRadio"";" \n
  651. "player removeWeapon ""ItemMap"";" \n
  652. "player removeWeapon ""ItemCompass"";" \n
  653. "player removeWeapon ""ItemWatch"";" \n
  654. "player removeWeapon ""ItemGPS"";" \n
  655. "player removeWeapon ""NVGoggles"";" \n
  656. "player removeWeapon ""APSI"";" \n
  657. "player removeWeapon ""mut_heart"";" \n
  658. "dayzGearSave = false;" \n
  659. "_inventory call player_gearSet;" \n
  660. "" \n
  661. "//player addMagazine ""7Rnd_45ACP_1911"";" \n
  662. "" \n
  663. "//Assess in backpack" \n
  664. "if (count _backpack > 0) then {" \n
  665. " //Populate" \n
  666. " _backpackType = _backpack select 0;" \n
  667. " _backpackWpn = _backpack select 1;" \n
  668. " _backpackMagTypes = [];" \n
  669. " _backpackMagQty = [];" \n
  670. " if (count _backpackWpn > 0) then {" \n
  671. " _backpackMagTypes = (_backpack select 2) select 0;" \n
  672. " _backpackMagQty = (_backpack select 2) select 1;" \n
  673. " };" \n
  674. " _countr = 0;" \n
  675. " _backpackWater = 0;" \n
  676. "" \n
  677. " //Add backpack" \n
  678. " if (_backpackType != """") then {" \n
  679. " _isOK = isClass(configFile >> ""CfgVehicles"" >>_backpackType);" \n
  680. " if (_isOK) then {" \n
  681. " player addBackpack _backpackType; " \n
  682. " dayz_myBackpack = unitBackpack player;" \n
  683. " " \n
  684. " //Fill backpack contents" \n
  685. " //Weapons" \n
  686. " _backpackWpnTypes = [];" \n
  687. " _backpackWpnQtys = [];" \n
  688. " if (count _backpackWpn > 0) then {" \n
  689. " _backpackWpnTypes = _backpackWpn select 0;" \n
  690. " _backpackWpnQtys = _backpackWpn select 1;" \n
  691. " };" \n
  692. " _countr = 0;" \n
  693. " {" \n
  694. " if(_x in (DZE_REPLACE_WEAPONS select 0)) then {" \n
  695. " _x = (DZE_REPLACE_WEAPONS select 1) select ((DZE_REPLACE_WEAPONS select 0) find _x);" \n
  696. " };" \n
  697. " dayz_myBackpack addWeaponCargoGlobal [_x,(_backpackWpnQtys select _countr)];" \n
  698. " _countr = _countr + 1;" \n
  699. " } forEach _backpackWpnTypes;" \n
  700. " " \n
  701. " //Magazines" \n
  702. " _countr = 0;" \n
  703. " {" \n
  704. " if (_x == ""BoltSteel"") then { _x = ""WoodenArrow"" }; // Convert BoltSteel to WoodenArrow" \n
  705. " if (_x == ""ItemTent"") then { _x = ""ItemTentOld"" };" \n
  706. " dayz_myBackpack addMagazineCargoGlobal [_x,(_backpackMagQty select _countr)];" \n
  707. " _countr = _countr + 1;" \n
  708. " } forEach _backpackMagTypes;" \n
  709. " " \n
  710. " dayz_myBackpackMags = getMagazineCargo dayz_myBackpack;" \n
  711. " dayz_myBackpackWpns = getWeaponCargo dayz_myBackpack;" \n
  712. " } else {" \n
  713. " dayz_myBackpack = objNull;" \n
  714. " dayz_myBackpackMags = [];" \n
  715. " dayz_myBackpackWpns = [];" \n
  716. " };" \n
  717. " } else {" \n
  718. " dayz_myBackpack = objNull;" \n
  719. " dayz_myBackpackMags = [];" \n
  720. " dayz_myBackpackWpns = [];" \n
  721. " };" \n
  722. "} else {" \n
  723. " dayz_myBackpack = objNull;" \n
  724. " dayz_myBackpackMags = [];" \n
  725. " dayz_myBackpackWpns = [];" \n
  726. "};" \n
  727. "" \n
  728. "dayzPlayerLogin2 = [];" \n
  729. "//[""PVDZE_plr_Login2"",[_charID,player,_playerUID]] call callRpcProcedure;" \n
  730. "" \n
  731. "PVDZE_plr_Login2 = [_charID,player,_playerUID];" \n
  732. "publicVariableServer ""PVDZE_plr_Login2"";" \n
  733. "" \n
  734. "dayz_loadScreenMsg = ""Requesting Character data from server"";" \n
  735. "progressLoadingScreen 0.9;" \n
  736. "if (_debug) then {" \n
  737. "diag_log ""Attempting Phase two..."";" \n
  738. "};"/*%FSM</STATEINIT""">*/;
  739. precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
  740. class Links
  741. {
  742. /*%FSM<LINK "Response">*/
  743. class Response
  744. {
  745. priority = 0.000000;
  746. to="Phase_Two";
  747. precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
  748. condition=/*%FSM<CONDITION""">*/"count (dayzPlayerLogin2) > 0"/*%FSM</CONDITION""">*/;
  749. action=/*%FSM<ACTION""">*/"_msg = player getVariable[""worldspace"",[]];"/*%FSM</ACTION""">*/;
  750. };
  751. /*%FSM</LINK>*/
  752. };
  753. };
  754. /*%FSM</STATE>*/
  755. /*%FSM<STATE "Phase_Two">*/
  756. class Phase_Two
  757. {
  758. name = "Phase_Two";
  759. init = /*%FSM<STATEINIT""">*/"dayz_loadScreenMsg = ""Character Data received from server""; " \n
  760. "if (_debug) then {" \n
  761. "diag_log ""Finished..."";" \n
  762. "};" \n
  763. "_worldspace = dayzPlayerLogin2 select 0;" \n
  764. "_state = dayzPlayerLogin2 select 1;" \n
  765. "" \n
  766. "_setDir = _worldspace select 0;" \n
  767. "_setPos = _worldspace select 1;" \n
  768. "" \n
  769. "if (isNil ""freshSpawn"") then {" \n
  770. " freshSpawn = 0;" \n
  771. "};" \n
  772. "" \n
  773. "if(dayz_paraSpawn and (freshSpawn == 2)) then {" \n
  774. " player setDir _setDir;" \n
  775. " player setPosATL [(_setPos select 0),(_setPos select 1),2000];" \n
  776. " [player,2000] spawn BIS_fnc_halo;" \n
  777. "} else {" \n
  778. "" \n
  779. " // make protective box" \n
  780. " DZE_PROTOBOX = createVehicle [""DebugBoxPlayer_DZ"", _setPos, [], 0, ""CAN_COLLIDE""];" \n
  781. " DZE_PROTOBOX setDir _setDir;" \n
  782. " DZE_PROTOBOX setPosATL _setPos;" \n
  783. "" \n
  784. " player setDir _setDir;" \n
  785. " player setPosATL _setPos;" \n
  786. "};" \n
  787. "" \n
  788. "{" \n
  789. " if (player getVariable[""hit_""+_x,false]) then { " \n
  790. " [player,_x,_x] spawn fnc_usec_damageBleed; " \n
  791. " usecBleed = [player,_x,_x];" \n
  792. " publicVariable ""usecBleed""; // draw blood stream on character, on all gameclients" \n
  793. " };" \n
  794. "} forEach USEC_typeOfWounds;" \n
  795. "//Legs and Arm fractures" \n
  796. "_legs = player getVariable [""hit_legs"",0];" \n
  797. "_arms = player getVariable [""hit_hands"",0];" \n
  798. "" \n
  799. "if (_legs > 1) then {" \n
  800. " player setHit[""legs"",1];" \n
  801. " r_fracture_legs = true;" \n
  802. "};" \n
  803. "if (_arms > 1) then {" \n
  804. " player setHit[""hands"",1];" \n
  805. " r_fracture_arms = true;" \n
  806. "};" \n
  807. "" \n
  808. "//Record current weapon state" \n
  809. "dayz_myWeapons = weapons player; //Array of last checked weapons" \n
  810. "dayz_myItems = items player; //Array of last checked items" \n
  811. "dayz_myMagazines = magazines player;" \n
  812. "" \n
  813. "dayz_playerUID = _playerUID;" \n
  814. "" \n
  815. "if ((_isNew) OR (count _inventory == 0)) then {" \n
  816. " //player is new, add initial loadout only if player is not pzombie" \n
  817. " if(!(player isKindOf ""PZombie_VB"")) then {" \n
  818. " _config = (configFile >> ""CfgSurvival"" >> ""Inventory"" >> ""Default"");" \n
  819. " _mags = getArray (_config >> ""magazines"");" \n
  820. " _wpns = getArray (_config >> ""weapons""); " \n
  821. " _bcpk = getText (_config >> ""backpack"");" \n
  822. " _bcpkWpn = getText (_config >> ""backpackWeapon"");" \n
  823. " if(!isNil ""DefaultMagazines"") then {" \n
  824. " _mags = DefaultMagazines;" \n
  825. " };" \n
  826. " if(!isNil ""DefaultWeapons"") then {" \n
  827. " _wpns = DefaultWeapons;" \n
  828. " };" \n
  829. " if(!isNil ""DefaultBackpack"") then {" \n
  830. " _bcpk = DefaultBackpack;" \n
  831. " };" \n
  832. " if(!isNil ""DefaultBackpackWeapon"") then {" \n
  833. " _bcpkWpn = DefaultBackpackWeapon;" \n
  834. " };" \n
  835. " //Add inventory" \n
  836. " {" \n
  837. " _isOK = isClass(configFile >> ""CfgMagazines"" >> _x);" \n
  838. " if (_isOK) then {" \n
  839. " player addMagazine _x;" \n
  840. " };" \n
  841. " } forEach _mags;" \n
  842. " {" \n
  843. " _isOK = isClass(configFile >> ""CfgWeapons"" >> _x);" \n
  844. " if (_isOK) then {" \n
  845. " player addWeapon _x;" \n
  846. " };" \n
  847. " } forEach _wpns;" \n
  848. " " \n
  849. " if (_bcpk != """") then {" \n
  850. " player addBackpack _bcpk; " \n
  851. " dayz_myBackpack = unitBackpack player;" \n
  852. " };" \n
  853. " if (_bcpkWpn != """") then {" \n
  854. " dayz_myBackpack addWeaponCargoGlobal [_bcpkWpn,1];" \n
  855. " };" \n
  856. " };" \n
  857. "};" \n
  858. "" \n
  859. "//Work out survival time" \n
  860. "_totalMins = _survival select 0;" \n
  861. "_days = floor (_totalMins / 1440);" \n
  862. "_totalMins = (_totalMins - (_days * 1440));" \n
  863. "_hours = floor (_totalMins / 60);" \n
  864. "_mins = (_totalMins - (_hours * 60));" \n
  865. "" \n
  866. "//player variables" \n
  867. "dayz_characterID = _charID;" \n
  868. "dayz_hasFire = objNull; //records players Fireplace object" \n
  869. "dayz_myCursorTarget = objNull;" \n
  870. "dayz_myPosition = getPosATL player; //Last recorded position" \n
  871. "dayz_lastMeal = (_lastAte * 60);" \n
  872. "dayz_lastDrink = (_lastDrank * 60);" \n
  873. "dayz_zombiesLocal = 0; //Used to record how many local zombies being tracked" \n
  874. "dayz_Survived = _days; //total alive dayz" \n
  875. "" \n
  876. "//load in medical details" \n
  877. "r_player_dead = player getVariable[""USEC_isDead"",false];" \n
  878. "r_player_unconscious = player getVariable[""NORRN_unconscious"", false];" \n
  879. "r_player_infected = player getVariable[""USEC_infected"",false];" \n
  880. "r_player_injured = player getVariable[""USEC_injured"",false];" \n
  881. "r_player_inpain = player getVariable[""USEC_inPain"",false];" \n
  882. "r_player_cardiac = player getVariable[""USEC_isCardiac"",false];" \n
  883. "r_player_lowblood = player getVariable[""USEC_lowBlood"",false];" \n
  884. "r_player_blood = player getVariable[""USEC_BloodQty"",r_player_bloodTotal];" \n
  885. "" \n
  886. "//Hunger/Thirst" \n
  887. "_messing = player getVariable[""messing"",[0,0]];" \n
  888. "dayz_hunger = _messing select 0;" \n
  889. "dayz_thirst = _messing select 1;" \n
  890. "" \n
  891. "//player setVariable [""humanity"",-3000, true];"/*%FSM</STATEINIT""">*/;
  892. precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
  893. class Links
  894. {
  895. /*%FSM<LINK "Alive">*/
  896. class Alive
  897. {
  898. priority = 0.000000;
  899. to="Position";
  900. precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
  901. condition=/*%FSM<CONDITION""">*/"!r_player_dead"/*%FSM</CONDITION""">*/;
  902. action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
  903. };
  904. /*%FSM</LINK>*/
  905. /*%FSM<LINK "Dead_Player">*/
  906. class Dead_Player
  907. {
  908. priority = 0.000000;
  909. to="ERROR__Player_Already";
  910. precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
  911. condition=/*%FSM<CONDITION""">*/"r_player_dead"/*%FSM</CONDITION""">*/;
  912. action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
  913. };
  914. /*%FSM</LINK>*/
  915. };
  916. };
  917. /*%FSM</STATE>*/
  918. /*%FSM<STATE "ERROR__Player_Already">*/
  919. class ERROR__Player_Already
  920. {
  921. name = "ERROR__Player_Already";
  922. init = /*%FSM<STATEINIT""">*/"endLoadingScreen;" \n
  923. "selectNoPlayer;" \n
  924. "_myTime = diag_tickTime;" \n
  925. ""/*%FSM</STATEINIT""">*/;
  926. precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
  927. class Links
  928. {
  929. /*%FSM<LINK "Too_Long">*/
  930. class Too_Long
  931. {
  932. priority = 0.000000;
  933. to="Disconnect";
  934. precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
  935. condition=/*%FSM<CONDITION""">*/"(diag_tickTime - _myTime) > 10"/*%FSM</CONDITION""">*/;
  936. action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
  937. };
  938. /*%FSM</LINK>*/
  939. };
  940. };
  941. /*%FSM</STATE>*/
  942. /*%FSM<STATE "Position">*/
  943. class Position
  944. {
  945. name = "Position";
  946. init = /*%FSM<STATEINIT""">*/"//Location" \n
  947. "_myLoc = getPosATL player;" \n
  948. "" \n
  949. "dayz_loadScreenMsg = ""Setup Completed, please wait..."";" \n
  950. "" \n
  951. "//GUI" \n
  952. "3 cutRsc [""playerStatusGUI"", ""PLAIN"",0];" \n
  953. "//5 cutRsc [""playerKillScore"", ""PLAIN"",2];" \n
  954. "" \n
  955. "//Update GUI" \n
  956. "call player_updateGui;" \n
  957. "_id = [] spawn {" \n
  958. " disableSerialization;" \n
  959. " _display = uiNamespace getVariable 'DAYZ_GUI_display';" \n
  960. " _control = _display displayCtrl 1204;" \n
  961. " _control ctrlShow false;" \n
  962. " if (!r_player_injured) then {" \n
  963. " _ctrlBleed = _display displayCtrl 1303;" \n
  964. " _ctrlBleed ctrlShow false;" \n
  965. " };" \n
  966. " if (!r_fracture_legs and !r_fracture_arms) then {" \n
  967. " _ctrlFracture = _display displayCtrl 1203;" \n
  968. " _ctrlFracture ctrlShow false;" \n
  969. " };" \n
  970. "};" \n
  971. "" \n
  972. "call ui_changeDisplay;"/*%FSM</STATEINIT""">*/;
  973. precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
  974. class Links
  975. {
  976. /*%FSM<LINK "Bad_Version">*/
  977. class Bad_Version
  978. {
  979. priority = 0.000000;
  980. to="ERROR__Bad_Versi";
  981. precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
  982. condition=/*%FSM<CONDITION""">*/"_version != dayz_versionNo"/*%FSM</CONDITION""">*/;
  983. action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
  984. };
  985. /*%FSM</LINK>*/
  986. /*%FSM<LINK "Version_Ok">*/
  987. class Version_Ok
  988. {
  989. priority = 0.000000;
  990. to="Stream";
  991. precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
  992. condition=/*%FSM<CONDITION""">*/"_version == dayz_versionNo"/*%FSM</CONDITION""">*/;
  993. action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
  994. };
  995. /*%FSM</LINK>*/
  996. };
  997. };
  998. /*%FSM</STATE>*/
  999. /*%FSM<STATE "Load_In">*/
  1000. class Load_In
  1001. {
  1002. name = "Load_In";
  1003. init = /*%FSM<STATEINIT""">*/"//Reveal action types" \n
  1004. "" \n
  1005. "{player reveal _x} forEach (nearestObjects [getPosATL player, dayz_reveal, 50]);" \n
  1006. "" \n
  1007. "dayz_clientPreload = true;" \n
  1008. "3 fadeSound 1;" \n
  1009. "1 cutText ["""", ""PLAIN""];" \n
  1010. "0 fadeMusic 0.5;" \n
  1011. "" \n
  1012. "//Check mission objects" \n
  1013. "{ " \n
  1014. " if (typeOf _x == ""RoadFlare"") then { " \n
  1015. " _id = [_x,0] spawn object_roadFlare " \n
  1016. " } else {" \n
  1017. " _id = [_x,1] spawn object_roadFlare " \n
  1018. " };" \n
  1019. " } forEach (allMissionObjects ""LitObject"");"/*%FSM</STATEINIT""">*/;
  1020. precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
  1021. class Links
  1022. {
  1023. /*%FSM<LINK "Display_Ready">*/
  1024. class Display_Ready
  1025. {
  1026. priority = 0.000000;
  1027. to="Preload_Display";
  1028. precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
  1029. condition=/*%FSM<CONDITION""">*/"!(isNull (findDisplay 46))"/*%FSM</CONDITION""">*/;
  1030. action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
  1031. };
  1032. /*%FSM</LINK>*/
  1033. };
  1034. };
  1035. /*%FSM</STATE>*/
  1036. /*%FSM<STATE "ERROR__Bad_Versi">*/
  1037. class ERROR__Bad_Versi
  1038. {
  1039. name = "ERROR__Bad_Versi";
  1040. init = /*%FSM<STATEINIT""">*/"endLoadingScreen;" \n
  1041. "selectNoPlayer;" \n
  1042. "_myTime = diag_tickTime;" \n
  1043. "" \n
  1044. "dayz_loadScreenMsg = ""You are running an incorrect version, please download update from dayzepoch.com."";" \n
  1045. "" \n
  1046. "1 cutText [format[localize ""str_player_18"",dayz_versionNo,_version], ""PLAIN""];" \n
  1047. "" \n
  1048. "progressLoadingScreen 0.5;"/*%FSM</STATEINIT""">*/;
  1049. precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
  1050. class Links
  1051. {
  1052. /*%FSM<LINK "Too_Long">*/
  1053. class Too_Long
  1054. {
  1055. priority = 0.000000;
  1056. to="get_ready_to_clo_1";
  1057. precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
  1058. condition=/*%FSM<CONDITION""">*/"(diag_tickTime - _myTime) > 5"/*%FSM</CONDITION""">*/;
  1059. action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
  1060. };
  1061. /*%FSM</LINK>*/
  1062. };
  1063. };
  1064. /*%FSM</STATE>*/
  1065. /*%FSM<STATE "Preload_Display">*/
  1066. class Preload_Display
  1067. {
  1068. name = "Preload_Display";
  1069. init = /*%FSM<STATEINIT""">*/"dayz_lastCheckBit = 0;" \n
  1070. "" \n
  1071. "(findDisplay 46) displayAddEventHandler [""KeyDown"",""_this call dayz_spaceInterrupt""];" \n
  1072. "player disableConversation true;" \n
  1073. "" \n
  1074. "eh_player_killed = player addeventhandler [""FiredNear"",{_this call player_weaponFiredNear;} ];" \n
  1075. "//_eh_combat_projectilenear = player addEventHandler [""IncomingFire"",{_this call player_projectileNear;}];" \n
  1076. "" \n
  1077. "//Select Weapon" \n
  1078. "// Desc: select default weapon & handle multiple muzzles" \n
  1079. "_playerObjName = format[""PVDZE_player%1"",_playerUID];" \n
  1080. "call compile format[""PVDZE_player%1 = player;"",_playerUID];" \n
  1081. "////diag_log (format[""player%1 = player"",_playerUID]);" \n
  1082. "publicVariableServer _playerObjName;" \n
  1083. "" \n
  1084. "//_state = player getVariable[""state"",[]];" \n
  1085. "_currentWpn = """";" \n
  1086. "_currentAnim = """";" \n
  1087. "if (count _state > 0) then {" \n
  1088. " //Reload players state" \n
  1089. " _currentWpn = _state select 0;" \n
  1090. " _currentAnim = _state select 1;" \n
  1091. " //Reload players state" \n
  1092. " if (count _state > 2) then {" \n
  1093. " dayz_temperatur = _state select 2;" \n
  1094. " }; " \n
  1095. " if ((count _state > 3) and DZE_FriendlySaving) then {" \n
  1096. " DZE_Friends = _state select 3;" \n
  1097. " }; " \n
  1098. "} else {" \n
  1099. " _currentWpn = ""Makarov"";" \n
  1100. " _currentAnim = ""aidlpercmstpsraswpstdnon_player_idlesteady02"";" \n
  1101. "};" \n
  1102. "" \n
  1103. "if (player hasWeapon ""MeleeCrowbar"") then {" \n
  1104. " player removeMagazine 'crowbar_swing'; " \n
  1105. " player addMagazine 'crowbar_swing';" \n
  1106. "};" \n
  1107. "if (player hasWeapon ""MeleeSledge"") then {" \n
  1108. " player removeMagazine 'sledge_swing'; " \n
  1109. " player addMagazine 'sledge_swing';" \n
  1110. "};" \n
  1111. "if (player hasWeapon ""MeleeHatchet_DZE"") then {" \n
  1112. " player removeMagazine 'Hatchet_Swing'; " \n
  1113. " player addMagazine 'Hatchet_Swing';" \n
  1114. "};" \n
  1115. "if (player hasWeapon ""MeleeMachete"") then {" \n
  1116. " player removeMagazine 'Machete_Swing'; " \n
  1117. " player addMagazine 'Machete_Swing';" \n
  1118. "};" \n
  1119. "if (player hasWeapon ""MeleeFishingPole"") then {" \n
  1120. " player removeMagazine 'Fishing_Swing'; " \n
  1121. " player addMagazine 'Fishing_Swing';" \n
  1122. "};" \n
  1123. "" \n
  1124. "reload player;" \n
  1125. "" \n
  1126. "if (_currentAnim != """" and !dayz_paraSpawn) then {" \n
  1127. " [objNull, player, rSwitchMove,_currentAnim] call RE;" \n
  1128. "};" \n
  1129. "" \n
  1130. "if (_currentWpn != """") then {" \n
  1131. " player selectWeapon _currentWpn;" \n
  1132. "} else {" \n
  1133. " //Establish default weapon" \n
  1134. " if (count weapons player > 0) then" \n
  1135. " {" \n
  1136. " private['_type', '_muzzles'];" \n
  1137. "" \n
  1138. " _type = ((weapons player) select 0);" \n
  1139. " // check for multiple muzzles (eg: GL)" \n
  1140. " _muzzles = getArray(configFile >> ""cfgWeapons"" >> _type >> ""muzzles"");" \n
  1141. "" \n
  1142. " if (count _muzzles > 1) then {" \n
  1143. " player selectWeapon (_muzzles select 0);" \n
  1144. " } else {" \n
  1145. " player selectWeapon _type;" \n
  1146. " };" \n
  1147. " };" \n
  1148. "};" \n
  1149. "" \n
  1150. "//Player control loop" \n
  1151. "dayz_monitor1 = [] spawn {" \n
  1152. " while {true} do {" \n
  1153. " call player_zombieCheck;" \n
  1154. " sleep 1;" \n
  1155. " };" \n
  1156. "};" \n
  1157. "" \n
  1158. ""/*%FSM</STATEINIT""">*/;
  1159. precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
  1160. class Links
  1161. {
  1162. /*%FSM<LINK "Preload_Done">*/
  1163. class Preload_Done
  1164. {
  1165. priority = 0.000000;
  1166. to="Initialize";
  1167. precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
  1168. condition=/*%FSM<CONDITION""">*/"dayz_preloadFinished"/*%FSM</CONDITION""">*/;
  1169. action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
  1170. };
  1171. /*%FSM</LINK>*/
  1172. };
  1173. };
  1174. /*%FSM</STATE>*/
  1175. /*%FSM<STATE "Initialize">*/
  1176. class Initialize
  1177. {
  1178. name = "Initialize";
  1179. init = /*%FSM<STATEINIT""">*/"//Medical" \n
  1180. "dayz_medicalH = [] execVM ""\z\addons\dayz_code\medical\init_medical.sqf""; //Medical Monitor Script (client only)" \n
  1181. "[player] call fnc_usec_damageHandle;" \n
  1182. "if (r_player_unconscious) then {" \n
  1183. " r_player_timeout = player getVariable[""unconsciousTime"",0];" \n
  1184. " player playActionNow ""Die"";" \n
  1185. "};" \n
  1186. "player allowDamage true;" \n
  1187. "player enableSimulation true;" \n
  1188. "0 cutText ["""", ""BLACK IN"",3];" \n
  1189. "" \n
  1190. "//Add core tools" \n
  1191. "player addWeapon ""Loot"";" \n
  1192. "player addWeapon ""Flare"";" \n
  1193. "if ((currentWeapon player == """")) then { player action [""SWITCHWEAPON"", player,player,1]; };" \n
  1194. "//load in medical details" \n
  1195. "r_player_dead = player getVariable[""USEC_isDead"",false];" \n
  1196. "r_player_unconscious = player getVariable[""NORRN_unconscious"", false];" \n
  1197. "r_player_infected = player getVariable[""USEC_infected"",false];" \n
  1198. "r_player_injured = player getVariable[""USEC_injured"",false];" \n
  1199. "r_player_inpain = player getVariable[""USEC_inPain"",false];" \n
  1200. "r_player_cardiac = player getVariable[""USEC_isCardiac"",false];" \n
  1201. "r_player_lowblood = player getVariable[""USEC_lowBlood"",false];" \n
  1202. "r_player_blood = player getVariable[""USEC_BloodQty"",r_player_bloodTotal];" \n
  1203. "" \n
  1204. """colorCorrections"" ppEffectEnable true;" \n
  1205. """colorCorrections"" ppEffectAdjust [1, 1, 0, [1, 1, 1, 0.0], [1, 1, 1, 1 min (4*r_player_blood/3/r_player_bloodTotal)], [1, 1, 1, 0.0]];" \n
  1206. """colorCorrections"" ppEffectCommit 0;" \n
  1207. "" \n
  1208. "dayz_gui = [] spawn {" \n
  1209. " private[""_distance""];" \n
  1210. " dayz_musicH = [] spawn player_music;" \n
  1211. " _wasInVehicle = false;" \n
  1212. " _thisVehicle = objNull;" \n
  1213. " while {true} do {" \n
  1214. " _array = player call world_surfaceNoise;" \n
  1215. " dayz_surfaceNoise = _array select 1;" \n
  1216. " dayz_surfaceType = _array select 0;" \n
  1217. "" \n
  1218. " call player_checkStealth;" \n
  1219. " dayz_statusArray = [] call player_updateGui;" \n
  1220. "" \n
  1221. " _vehicle = vehicle player;" \n
  1222. " if (_vehicle != player) then {" \n
  1223. " _wasInVehicle = true;" \n
  1224. " _thisVehicle = _vehicle;" \n
  1225. " } else {" \n
  1226. " if (_wasInVehicle) then {" \n
  1227. " _wasInVehicle = false;" \n
  1228. " _thisVehicle call player_antiWall;" \n
  1229. " };" \n
  1230. " };" \n
  1231. " sleep 0.2;" \n
  1232. " };" \n
  1233. "};" \n
  1234. "" \n
  1235. "dayzGearSave = true;" \n
  1236. "" \n
  1237. "dayz_slowCheck = [] spawn player_spawn_2;" \n
  1238. "" \n
  1239. "_world = toUpper(worldName); //toUpper(getText (configFile >> ""CfgWorlds"" >> (worldName) >> ""description""));" \n
  1240. "_nearestCity = nearestLocations [getPos player, [""NameCityCapital"",""NameCity"",""NameVillage"",""NameLocal""],1000];" \n
  1241. "Dayz_logonTown = ""Wilderness"";" \n
  1242. "" \n
  1243. "if (count _nearestCity > 0) then {Dayz_logonTown = text (_nearestCity select 0)};" \n
  1244. "" \n
  1245. "_first = [_world,Dayz_logonTown,localize (""str_player_06"") + "" "" + str(_days)] spawn BIS_fnc_infoText;" \n
  1246. "" \n
  1247. "Dayz_logonTime = daytime;" \n
  1248. "Dayz_logonDate = dayz_Survived;" \n
  1249. "" \n
  1250. "dayz_animalCheck = [] spawn player_spawn_1;" \n
  1251. "" \n
  1252. "dayz_spawnCheck = [] spawn {" \n
  1253. " while {true} do {" \n
  1254. " [""both""] call player_spawnCheck;" \n
  1255. " sleep 8;" \n
  1256. " };" \n
  1257. "};" \n
  1258. "" \n
  1259. "dayz_Totalzedscheck = [] spawn {" \n
  1260. " while {true} do {" \n
  1261. " dayz_maxCurrentZeds = {alive _x} count entities ""zZombie_Base"";" \n
  1262. " sleep 60;" \n
  1263. " };" \n
  1264. "};" \n
  1265. "" \n
  1266. "dayz_backpackcheck = [] spawn {" \n
  1267. " while {true} do {" \n
  1268. " call player_dumpBackpack;" \n
  1269. " sleep 1;" \n
  1270. " };" \n
  1271. "};" \n
  1272. "" \n
  1273. "// TODO: questionably" \n
  1274. "{ _x call fnc_veh_ResetEH; } forEach vehicles;" \n
  1275. "" \n
  1276. "private[""_fadeFire""];" \n
  1277. "{" \n
  1278. " _fadeFire = _x getVariable['fadeFire', true];" \n
  1279. " if (!_fadeFire) then {" \n
  1280. " _nul = [_x,2,0,false,false] spawn BIS_Effects_Burn;" \n
  1281. " };" \n
  1282. "} forEach entities ""SpawnableWreck"";" \n
  1283. "" \n
  1284. "// remove box " \n
  1285. "[] spawn {" \n
  1286. " private [""_counter""];" \n
  1287. " _counter = 0;" \n
  1288. " while {true} do {" \n
  1289. " if ((player getVariable[""combattimeout"", 0] >= time) or (_counter >= 60) or (player distance DZE_PROTOBOX > 2)) exitWith {" \n
  1290. " deleteVehicle DZE_PROTOBOX;" \n
  1291. " };" \n
  1292. " sleep 1;" \n
  1293. " _counter = _counter + 1;" \n
  1294. " };" \n
  1295. "};"/*%FSM</STATEINIT""">*/;
  1296. precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
  1297. class Links
  1298. {
  1299. /*%FSM<LINK "No_time_date">*/
  1300. class No_time_date
  1301. {
  1302. priority = 0.000000;
  1303. to="ERROR__No_Date_or";
  1304. precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
  1305. condition=/*%FSM<CONDITION""">*/"!isNil ""PVDZE_plr_SetDate"""/*%FSM</CONDITION""">*/;
  1306. action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
  1307. };
  1308. /*%FSM</LINK>*/
  1309. /*%FSM<LINK "True">*/
  1310. class True
  1311. {
  1312. priority = 0.000000;
  1313. to="Finish";
  1314. precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
  1315. condition=/*%FSM<CONDITION""">*/""/*%FSM</CONDITION""">*/;
  1316. action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
  1317. };
  1318. /*%FSM</LINK>*/
  1319. };
  1320. };
  1321. /*%FSM</STATE>*/
  1322. /*%FSM<STATE "Finish">*/
  1323. class Finish
  1324. {
  1325. name = "Finish";
  1326. init = /*%FSM<STATEINIT""">*/"dayzGearSave = true;" \n
  1327. "dayz_myPosition = getPosATL player;" \n
  1328. "" \n
  1329. "//[""PVDZE_plr_LoginRecord"",[_playerUID,_charID,0]] call callRpcProcedure;" \n
  1330. "" \n
  1331. "PVDZE_plr_LoginRecord = [_playerUID,_charID,0];" \n
  1332. "publicVariableServer ""PVDZE_plr_LoginRecord"";" \n
  1333. "" \n
  1334. "endLoadingScreen;" \n
  1335. ""/*%FSM</STATEINIT""">*/;
  1336. precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
  1337. class Links
  1338. {
  1339. };
  1340. };
  1341. /*%FSM</STATE>*/
  1342. /*%FSM<STATE "Enable_Sim">*/
  1343. class Enable_Sim
  1344. {
  1345. name = "Enable_Sim";
  1346. init = /*%FSM<STATEINIT""">*/"if (_debug) then {" \n
  1347. "diag_log (""PLOGIN: Enable Sim"");" \n
  1348. "};" \n
  1349. "" \n
  1350. "_myEpochAnim = getText(configFile >> ""CfgPatches"" >> ""dayz_anim"" >> ""dayzVersion"");" \n
  1351. "_myEpoch = getText(configFile >> ""CfgPatches"" >> ""dayz_epoch"" >> ""dayzVersion"");" \n
  1352. "_myEpochB = getText(configFile >> ""CfgPatches"" >> ""dayz_epoch_b"" >> ""dayzVersion"");" \n
  1353. "_myEpochSfx = getText(configFile >> ""CfgPatches"" >> ""dayz_sfx"" >> ""dayzVersion"");" \n
  1354. "" \n
  1355. "" \n
  1356. "player enableSimulation true;"/*%FSM</STATEINIT""">*/;
  1357. precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
  1358. class Links
  1359. {
  1360. /*%FSM<LINK "no_PlayerID">*/
  1361. class no_PlayerID
  1362. {
  1363. priority = 2.000000;
  1364. to="ERROR__No_Player_1";
  1365. precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
  1366. condition=/*%FSM<CONDITION""">*/"(_myEpochAnim != ""1.0.4"") || (_myEpoch != ""1.0.4"") || (_myEpochB != ""1.0.4"") || (_myEpochSfx != ""1.0.4"")"/*%FSM</CONDITION""">*/;
  1367. action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
  1368. };
  1369. /*%FSM</LINK>*/
  1370. /*%FSM<LINK "player_not_null">*/
  1371. class player_not_null
  1372. {
  1373. priority = 0.000000;
  1374. to="Prepare";
  1375. precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
  1376. condition=/*%FSM<CONDITION""">*/"!isNull player"/*%FSM</CONDITION""">*/;
  1377. action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
  1378. };
  1379. /*%FSM</LINK>*/
  1380. };
  1381. };
  1382. /*%FSM</STATE>*/
  1383. /*%FSM<STATE "Gender_Selection">*/
  1384. class Gender_Selection
  1385. {
  1386. name = "Gender_Selection";
  1387. init = /*%FSM<STATEINIT""">*/"dayz_selectGender = ""Survivor2_DZ"";" \n
  1388. "1 cutText ["""", ""BLACK"",0];" \n
  1389. "endLoadingScreen;" \n
  1390. "createDialog ""RscDisplayGenderSelect"";" \n
  1391. "freshSpawn = 2;"/*%FSM</STATEINIT""">*/;
  1392. precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
  1393. class Links
  1394. {
  1395. /*%FSM<LINK "Selected">*/
  1396. class Selected
  1397. {
  1398. priority = 0.000000;
  1399. to="Process";
  1400. precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
  1401. condition=/*%FSM<CONDITION""">*/"!dialog"/*%FSM</CONDITION""">*/;
  1402. action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
  1403. };
  1404. /*%FSM</LINK>*/
  1405. };
  1406. };
  1407. /*%FSM</STATE>*/
  1408. /*%FSM<STATE "Process">*/
  1409. class Process
  1410. {
  1411. name = "Process";
  1412. init = /*%FSM<STATEINIT""">*/"_model = dayz_selectGender;"/*%FSM</STATEINIT""">*/;
  1413. precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
  1414. class Links
  1415. {
  1416. /*%FSM<LINK "Hive_Ok">*/
  1417. class Hive_Ok
  1418. {
  1419. priority = 0.000000;
  1420. to="Phase_One";
  1421. precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
  1422. condition=/*%FSM<CONDITION""">*/"true"/*%FSM</CONDITION""">*/;
  1423. action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
  1424. };
  1425. /*%FSM</LINK>*/
  1426. };
  1427. };
  1428. /*%FSM</STATE>*/
  1429. /*%FSM<STATE "ERROR__No_Player_1">*/
  1430. class ERROR__No_Player_1
  1431. {
  1432. name = "ERROR__No_Player_1";
  1433. init = /*%FSM<STATEINIT""">*/"endLoadingScreen;" \n
  1434. "selectNoPlayer;" \n
  1435. "_myTime = diag_tickTime;" \n
  1436. "1 cutText [(localize ""str_epoch_player_113""), ""PLAIN"",15];"/*%FSM</STATEINIT""">*/;
  1437. precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
  1438. class Links
  1439. {
  1440. /*%FSM<LINK "Too_Long">*/
  1441. class Too_Long
  1442. {
  1443. priority = 0.000000;
  1444. to="Disconnect";
  1445. precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
  1446. condition=/*%FSM<CONDITION""">*/"(diag_tickTime - _myTime) > 10"/*%FSM</CONDITION""">*/;
  1447. action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
  1448. };
  1449. /*%FSM</LINK>*/
  1450. };
  1451. };
  1452. /*%FSM</STATE>*/
  1453. /*%FSM<STATE "Stream">*/
  1454. class Stream
  1455. {
  1456. name = "Stream";
  1457. init = /*%FSM<STATEINIT""">*/"//stream in location" \n
  1458. "//[false] call stream_locationCheck;" \n
  1459. "" \n
  1460. "_zombies = (getPosATL player) nearEntities [""zZombie_Base"",25];" \n
  1461. "{deleteVehicle _x} forEach _zombies;" \n
  1462. "" \n
  1463. "endLoadingScreen;"/*%FSM</STATEINIT""">*/;
  1464. precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
  1465. class Links
  1466. {
  1467. /*%FSM<LINK "Preloaded">*/
  1468. class Preloaded
  1469. {
  1470. priority = 0.000000;
  1471. to="Load_In";
  1472. precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
  1473. condition=/*%FSM<CONDITION""">*/"preloadCamera _setPos"/*%FSM</CONDITION""">*/;
  1474. action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
  1475. };
  1476. /*%FSM</LINK>*/
  1477. };
  1478. };
  1479. /*%FSM</STATE>*/
  1480. /*%FSM<STATE "Retry">*/
  1481. class Retry
  1482. {
  1483. name = "Retry";
  1484. init = /*%FSM<STATEINIT""">*/"diag_log (""PLOGIN: Retrying Authentication... ("" + _playerUID + "")"");" \n
  1485. "dayz_loadScreenMsg = (localize ""str_player_14"");" \n
  1486. "" \n
  1487. "_AuthAttempt = _AuthAttempt +1;" \n
  1488. "" \n
  1489. "_myTime = diag_tickTime;"/*%FSM</STATEINIT""">*/;
  1490. precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
  1491. class Links
  1492. {
  1493. /*%FSM<LINK "auth_failed">*/
  1494. class auth_failed
  1495. {
  1496. priority = 0.000000;
  1497. to="get_ready_to_clo";
  1498. precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
  1499. condition=/*%FSM<CONDITION""">*/"_AuthAttempt > 5"/*%FSM</CONDITION""">*/;
  1500. action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
  1501. };
  1502. /*%FSM</LINK>*/
  1503. /*%FSM<LINK "Retry">*/
  1504. class Retry
  1505. {
  1506. priority = 0.000000;
  1507. to="Request";
  1508. precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
  1509. condition=/*%FSM<CONDITION""">*/"(diag_tickTime - _myTime) > 5"/*%FSM</CONDITION""">*/;
  1510. action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
  1511. };
  1512. /*%FSM</LINK>*/
  1513. };
  1514. };
  1515. /*%FSM</STATE>*/
  1516. /*%FSM<STATE "get_ready_to_clo">*/
  1517. class get_ready_to_clo
  1518. {
  1519. name = "get_ready_to_clo";
  1520. init = /*%FSM<STATEINIT""">*/"diag_log (""PLOGIN: Authentication Failed ("" + _playerUID + "")"");" \n
  1521. "dayz_loadScreenMsg = (localize ""str_player_32"");" \n
  1522. "" \n
  1523. "progressLoadingScreen 1;" \n
  1524. "" \n
  1525. "_myTime = diag_tickTime;"/*%FSM</STATEINIT""">*/;
  1526. precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
  1527. class Links
  1528. {
  1529. /*%FSM<LINK "sleep_">*/
  1530. class sleep_
  1531. {
  1532. priority = 0.000000;
  1533. to="Disconnect";
  1534. precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
  1535. condition=/*%FSM<CONDITION""">*/"(diag_tickTime - _myTime) > 2"/*%FSM</CONDITION""">*/;
  1536. action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
  1537. };
  1538. /*%FSM</LINK>*/
  1539. };
  1540. };
  1541. /*%FSM</STATE>*/
  1542. /*%FSM<STATE "Disconnect">*/
  1543. class Disconnect
  1544. {
  1545. name = "Disconnect";
  1546. init = /*%FSM<STATEINIT""">*/"endLoadingScreen;" \n
  1547. "" \n
  1548. "// disable player interaction and move him off site" \n
  1549. "// player setPos [10,10,100000];" \n
  1550. " player enableSimulation false;" \n
  1551. "" \n
  1552. "diag_log (""End Mission"");" \n
  1553. "" \n
  1554. "//if (!isServer) then {" \n
  1555. " failMission ""LOSER"";" \n
  1556. " endMission ""END1""" \n
  1557. "//};"/*%FSM</STATEINIT""">*/;
  1558. precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
  1559. class Links
  1560. {
  1561. };
  1562. };
  1563. /*%FSM</STATE>*/
  1564. /*%FSM<STATE "ERROR__No_Date_or">*/
  1565. class ERROR__No_Date_or
  1566. {
  1567. name = "ERROR__No_Date_or";
  1568. init = /*%FSM<STATEINIT""">*/"endLoadingScreen;" \n
  1569. "selectNoPlayer;" \n
  1570. "_myTime = diag_tickTime;" \n
  1571. "1 cutText [(localize ""str_epoch_player_114""), ""PLAIN"",5];"/*%FSM</STATEINIT""">*/;
  1572. precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
  1573. class Links
  1574. {
  1575. /*%FSM<LINK "Too_Long">*/
  1576. class Too_Long
  1577. {
  1578. priority = 0.000000;
  1579. to="Disconnect";
  1580. precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
  1581. condition=/*%FSM<CONDITION""">*/"(diag_tickTime - _myTime) > 10"/*%FSM</CONDITION""">*/;
  1582. action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
  1583. };
  1584. /*%FSM</LINK>*/
  1585. };
  1586. };
  1587. /*%FSM</STATE>*/
  1588. /*%FSM<STATE "get_ready_to_clo_1">*/
  1589. class get_ready_to_clo_1
  1590. {
  1591. name = "get_ready_to_clo_1";
  1592. init = /*%FSM<STATEINIT""">*/"//diag_log (""PLOGIN:Wrong DayZ Version ("" + dayz_versionNo + "")"");" \n
  1593. "diag_log format[localize ""str_player_18"",dayz_versionNo,_version];" \n
  1594. "" \n
  1595. "dayz_loadScreenMsg = ""You are running an incorrect version of DAYZ_CODE, please download this file from dayzepoch.com."";" \n
  1596. "" \n
  1597. "progressLoadingScreen 1;"/*%FSM</STATEINIT""">*/;
  1598. precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
  1599. class Links
  1600. {
  1601. /*%FSM<LINK "sleep_">*/
  1602. class sleep_
  1603. {
  1604. priority = 0.000000;
  1605. to="Disconnect";
  1606. precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
  1607. condition=/*%FSM<CONDITION""">*/"(diag_tickTime - _myTime) > 5"/*%FSM</CONDITION""">*/;
  1608. action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
  1609. };
  1610. /*%FSM</LINK>*/
  1611. };
  1612. };
  1613. /*%FSM</STATE>*/
  1614. /*%FSM<STATE "Server_Loading">*/
  1615. class Server_Loading
  1616. {
  1617. name = "Server_Loading";
  1618. init = /*%FSM<STATEINIT""">*/"_myTime = diag_tickTime;" \n
  1619. "dayz_loadScreenMsg = (""Waiting for server to start authentication"");" \n
  1620. "if (_debug) then {" \n
  1621. "diag_log ""PLOGIN: Waiting for server to start authentication"";" \n
  1622. "};" \n
  1623. "progressLoadingScreen 0.5;"/*%FSM</STATEINIT""">*/;
  1624. precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
  1625. class Links
  1626. {
  1627. /*%FSM<LINK "Server_Ready">*/
  1628. class Server_Ready
  1629. {
  1630. priority = 0.000000;
  1631. to="Request";
  1632. precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
  1633. condition=/*%FSM<CONDITION""">*/"!isNil ""sm_done"""/*%FSM</CONDITION""">*/;
  1634. action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
  1635. };
  1636. /*%FSM</LINK>*/
  1637. /*%FSM<LINK "Too_Long">*/
  1638. class Too_Long
  1639. {
  1640. priority = 0.000000;
  1641. to="Disconnect";
  1642. precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
  1643. condition=/*%FSM<CONDITION""">*/"(diag_tickTime - _myTime) > 120"/*%FSM</CONDITION""">*/;
  1644. action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
  1645. };
  1646. /*%FSM</LINK>*/
  1647. };
  1648. };
  1649. /*%FSM</STATE>*/
  1650. /*%FSM<STATE "Player_Zombie__S">*/
  1651. class Player_Zombie__S
  1652. {
  1653. name = "Player_Zombie__S";
  1654. init = /*%FSM<STATEINIT""">*/"_zssupported = [""pz_policeman"",""pz_suit1"",""pz_suit2"",""pz_worker1"",""pz_worker2"",""pz_worker3"",""pz_doctor"",""pz_teacher"",""pz_hunter"",""pz_villager1"",""pz_villager2"",""pz_villager3"",""pz_priest""];" \n
  1655. "_model = (_zssupported select floor(random(count _zssupported)));" \n
  1656. "freshSpawn = 1;"/*%FSM</STATEINIT""">*/;
  1657. precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
  1658. class Links
  1659. {
  1660. /*%FSM<LINK "Hive_Ok">*/
  1661. class Hive_Ok
  1662. {
  1663. priority = 0.000000;
  1664. to="Phase_One";
  1665. precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
  1666. condition=/*%FSM<CONDITION""">*/"true"/*%FSM</CONDITION""">*/;
  1667. action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
  1668. };
  1669. /*%FSM</LINK>*/
  1670. };
  1671. };
  1672. /*%FSM</STATE>*/
  1673. };
  1674. initState="init";
  1675. finalStates[] =
  1676. {
  1677. "Finish",
  1678. };
  1679. };
  1680. /*%FSM</COMPILE>*/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement