Advertisement
Guest User

player_monitor.fsm

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