Advertisement
Guest User

Untitled

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