Advertisement
Guest User

compiles.sqf

a guest
Jul 3rd, 2013
318
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 27.65 KB | None | 0 0
  1. /*
  2. FUNCTION COMPILES
  3. */
  4. //Player only
  5.  
  6. if (!isDedicated) then {
  7. "filmic" setToneMappingParams [0.07, 0.31, 0.23, 0.37, 0.011, 3.750, 6, 4]; setToneMapping "Filmic";
  8.  
  9. BIS_Effects_Burn = compile preprocessFile "\ca\Data\ParticleEffects\SCRIPTS\destruction\burn.sqf";
  10. player_zombieCheck = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_zombieCheck.sqf"; //Run on a players computer, checks if the player is near a zombie
  11. player_zombieAttack = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_zombieAttack.sqf"; //Run on a players computer, causes a nearby zombie to attack them
  12. fnc_usec_damageActions = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_damageActions.sqf"; //Checks which actions for nearby casualty
  13. fnc_inAngleSector = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_inAngleSector.sqf"; //Checks which actions for nearby casualty
  14. fnc_usec_selfActions = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_selfActions.sqf"; //Checks which actions for self
  15. fnc_usec_unconscious = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_unconscious.sqf";
  16. player_temp_calculation = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_temperatur.sqf"; //Temperatur System //TeeChange
  17. player_weaponFiredNear = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_weaponFiredNear.sqf";
  18. player_animalCheck = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_animalCheck.sqf";
  19. player_spawnCheck = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_spawnCheck.sqf";
  20. player_spawnLootCheck = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_spawnlootCheck.sqf";
  21. player_spawnZedCheck = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_spawnzedCheck.sqf";
  22. building_spawnLoot = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\building_spawnLoot.sqf";
  23. player_taskHint = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_taskHint.sqf";
  24. building_spawnZombies = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\building_spawnZombies.sqf";
  25. //animal_monitor = compile preprocessFileLineNumbers "\z\addons\dayz_code\system\animal_monitor.sqf";
  26. building_monitor = compile preprocessFileLineNumbers "\z\addons\dayz_code\system\building_monitor.sqf";
  27. player_fired = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_fired.sqf"; //Runs when player fires. Alerts nearby Zeds depending on calibre and audial rating
  28. player_packTent = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_packTent.sqf";
  29. control_zombieAgent = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\control_zombieAgent.sqf";
  30. player_updateGui = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_updateGui.sqf";
  31. player_crossbowBolt = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_crossbowBolt.sqf";
  32. spawn_flies = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\spawn_flies.sqf";
  33. stream_locationFill = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\stream_locationFill.sqf";
  34. stream_locationDel = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\stream_locationDel.sqf";
  35. stream_locationCheck = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\stream_locationCheck.sqf";
  36. player_music = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_music.sqf"; //Used to generate ambient music
  37. player_login = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_login.sqf"; //Used to generate ambient music
  38. player_death = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_death.sqf";
  39. player_switchModel = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_switchModel.sqf";
  40. player_checkStealth = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_checkStealth.sqf";
  41. world_sunRise = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_sunRise.sqf";
  42. world_surfaceNoise = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_surfaceNoise.sqf";
  43. player_humanityMorph = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_humanityMorph.sqf";
  44. player_throwObject = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_throwObject.sqf";
  45. player_alertZombies = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_alertZombies.sqf";
  46. player_fireMonitor = compile preprocessFileLineNumbers "\z\addons\dayz_code\system\fire_monitor.sqf";
  47.  
  48. //Objects
  49. object_roadFlare = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_roadFlare.sqf";
  50. object_setpitchbank = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_setpitchbank.sqf";
  51. object_monitorGear = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_monitorGear.sqf";
  52.  
  53. //Zombies
  54. zombie_findTargetAgent = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\zombie_findTargetAgent.sqf";
  55. zombie_loiter = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\zombie_loiter.sqf"; //Server compile, used for loiter behaviour
  56. zombie_generate = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\zombie_generate.sqf"; //Server compile, used for loiter behaviour
  57. //swarm_generate = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\swarm_generate.sqf"; //Server compile, used for Swarms behaviour
  58.  
  59. //
  60. dog_findTargetAgent = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\dog_findTargetAgent.sqf";
  61.  
  62.  
  63. //actions
  64. player_countmagazines = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_countmagazines.sqf";
  65. player_addToolbelt = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_addToolbelt.sqf";
  66. player_reloadMag = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_reloadMags.sqf";
  67. player_tentPitch = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\tent_pitch.sqf";
  68. player_createstash = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_createstash.sqf";
  69. player_drink = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_drink.sqf";
  70. player_eat = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_eat.sqf";
  71. player_useMeds = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_useMeds.sqf";
  72. player_fillWater = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\water_fill.sqf";
  73. player_makeFire = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_makefire.sqf";
  74. player_chopWood = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_chopWood.sqf";
  75. player_build = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_build.sqf";
  76. player_wearClothes = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_wearClothes.sqf";
  77. player_dropWeapon = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_dropWeapon.sqf";
  78. player_setTrap = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_setTrap.sqf";
  79. object_pickup = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\object_pickup.sqf";
  80. player_flipvehicle = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_flipvehicle.sqf";
  81. player_sleep = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_sleep.sqf";
  82. player_combineMag = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_combineMags.sqf";
  83. player_createquiver = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_createQuiver.sqf";
  84. player_fillquiver = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_fillQuiver.sqf";
  85. player_takearrow = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_takeArrow.sqf";
  86.  
  87. //ui
  88. player_selectSlot = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\ui_selectSlot.sqf";
  89. player_gearSync = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_gearSync.sqf";
  90. player_gearSet = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_gearSet.sqf";
  91. ui_changeDisplay = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\ui_changeDisplay.sqf";
  92.  
  93. //playerstats
  94. horde_epeen_fnc_fill_page = compile preProcessFile "\z\addons\dayz_code\actions\playerstats\fill_page_fnc.sqf";
  95. horde_epeen_determine_humanity_fnc = compile preProcessFile "\z\addons\dayz_code\actions\playerstats\determine_humanity_fnc.sqf";
  96. horde_epeen_setText_journal_fnc = compile preProcessFile "\z\addons\dayz_code\actions\playerstats\epeen_setText_journal.sqf";
  97. horde_epeen_setText_humanity_fnc = compile preProcessFile "\z\addons\dayz_code\actions\playerstats\epeen_setText_humanity.sqf";
  98. horde_epeen_setText_stats_fnc = compile preProcessFile "\z\addons\dayz_code\actions\playerstats\epeen_setText_stats.sqf";
  99. horde_epeen_show_humanity_fnc = compile preProcessFile "\z\addons\dayz_code\actions\playerstats\show_humanity_fnc.sqf";
  100.  
  101. //System
  102. player_monitor = compile preprocessFileLineNumbers "\z\addons\dayz_code\system\player_monitor.sqf";
  103. player_spawn_1 = compile preprocessFileLineNumbers "\z\addons\dayz_code\system\player_spawn_1.sqf";
  104. player_spawn_2 = compile preprocessFileLineNumbers "\z\addons\dayz_code\system\player_spawn_2.sqf";
  105. onPreloadStarted "dayz_preloadFinished = false;";
  106. onPreloadFinished "dayz_preloadFinished = true;";
  107. infectedcamps = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_infectedcamps.sqf";
  108. camp_spawnZombies = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\camp_spawnZombies.sqf"; //Server compile, used for loiter behaviour
  109.  
  110. //Crafting
  111. //player_craftItem = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_craftItem.sqf";
  112.  
  113. // TODO: need move it in player_monitor.fsm
  114. // allow player disconnect from server, if loading hang, kicked by BE etc.
  115.  
  116. //This is still needed but the fsm should terminate if any errors pop up.
  117.  
  118. [] spawn {
  119. private["_timeOut","_display","_control1","_control2"];
  120. disableSerialization;
  121. _timeOut = 0;
  122. dayz_loadScreenMsg = "";
  123. diag_log "DEBUG: loadscreen guard started.";
  124. _display = uiNameSpace getVariable "BIS_loadingScreen";
  125. _control1 = _display displayctrl 8400;
  126. _control2 = _display displayctrl 102;
  127. // 120 sec timeout
  128. while { _timeOut < 3000 && !dayz_clientPreload && !dayz_authed } do {
  129.  
  130. if ( isNull _display ) then {
  131. waitUntil { !dialog; };
  132. startLoadingScreen ["","RscDisplayLoadCustom"];
  133. _display = uiNameSpace getVariable "BIS_loadingScreen";
  134. _control1 = _display displayctrl 8400;
  135. _control2 = _display displayctrl 102;
  136. };
  137.  
  138. if ( dayz_loadScreenMsg != "" ) then {
  139. _control1 ctrlSetText dayz_loadScreenMsg;
  140. dayz_loadScreenMsg = "";
  141. };
  142. _control2 ctrlSetText format["%1",round(_timeOut*0.01)];
  143. _timeOut = _timeOut + 1;
  144. sleep 0.01;
  145. };
  146. endLoadingScreen;
  147. /*
  148. if ( !dayz_clientPreload && !dayz_authed ) then {
  149. diag_log "DEBUG: loadscreen guard ended with timeout.";
  150. disableUserInput false;
  151. 1 cutText ["Disconnected!", "PLAIN"];
  152. player enableSimulation false;
  153. } else { diag_log "DEBUG: loadscreen guard ended."; };
  154. */
  155. };
  156.  
  157. dayz_losChance = {
  158. private["_agent","_maxDis","_dis","_val","_maxExp","_myExp"];
  159. _agent = _this select 0;
  160. _dis = _this select 1;
  161. _maxDis = _this select 2;
  162. //diag_log ("VAL: " + str(_this));
  163. _val = (_maxDis - _dis) max 0;
  164. _maxExp = ((exp 2) * _maxDis);
  165. _myExp = ((exp 2) * (_val)) / _maxExp;
  166. _myExp = _myExp * 0.7;
  167. _myExp
  168. };
  169.  
  170. ui_initDisplay = {
  171. private["_control","_ctrlBleed","_display","_ctrlFracture","_ctrlDogFood","_ctrlDogWater","_ctrlDogWaterBorder", "_ctrlDogFoodBorder"];
  172. disableSerialization;
  173. _display = uiNamespace getVariable 'DAYZ_GUI_display';
  174. _control = _display displayCtrl 1204;
  175. _control ctrlShow false;
  176. if (!r_player_injured) then {
  177. _ctrlBleed = _display displayCtrl 1303;
  178. _ctrlBleed ctrlShow false;
  179. };
  180. if (!r_fracture_legs and !r_fracture_arms) then {
  181. _ctrlFracture = _display displayCtrl 1203;
  182. _ctrlFracture ctrlShow false;
  183. };
  184. _ctrlDogFoodBorder = _display displayCtrl 1501;
  185. _ctrlDogFoodBorder ctrlShow false;
  186. _ctrlDogFood = _display displayCtrl 1701;
  187. _ctrlDogFood ctrlShow false;
  188.  
  189. _ctrlDogWaterBorder = _display displayCtrl 1502;
  190. _ctrlDogWaterBorder ctrlShow false;
  191. _ctrlDogWater = _display displayCtrl 1702;
  192. _ctrlDogWater ctrlShow false
  193. };
  194.  
  195. dayz_losCheck = {
  196. private["_target","_agent","_cantSee"];
  197. _target = _this select 0; // PUT THE PLAYER IN FIRST ARGUMENT!!!!
  198. _agent = _this select 1;
  199. _cantSee = true;
  200. if (!isNull _target) then {
  201. _tPos = eyePos _target;
  202. _zPos = eyePos _agent;
  203. if ((count _tPos > 0) and (count _zPos > 0)) then {
  204. _cantSee = terrainIntersectASL [_tPos, _zPos];
  205. if (!_cantSee) then {
  206. _cantSee = lineIntersects [_tPos, _zPos, _agent, vehicle _target];
  207. };
  208. };
  209. };
  210. _cantSee
  211. };
  212.  
  213. dayz_losCheck_attack = {
  214. private["_target","_agent","_cantSee"];
  215. _target = _this select 0;
  216. _agent = _this select 1;
  217. _cantSee = true;
  218. if (!isNull _target) then {
  219. _tPos = eyePos _target;
  220. _zPos = eyePos _agent;
  221. if ((count _tPos > 0) and (count _zPos > 0)) then {
  222. _cantSee = terrainIntersectASL [_tPos, _zPos];
  223. if (!_cantSee) then {
  224. _ob_arr = lineIntersectsWith [_zPos, _tPos, _agent, _target];
  225. _cantSee = ((count _ob_arr) != 0 and {((_ob_arr select 0) isKindOf "All")});
  226. };
  227. };
  228. };
  229. _cantSee
  230. };
  231.  
  232. // eh_zombieInit = {
  233. // private["_unit","_pos"];
  234. // //_unit = _this select 0;
  235. // //_pos = getPosATL _unit;
  236. // //_id = [_pos,_unit] execFSM "\z\AddOns\dayz_code\system\zombie_agent.fsm";
  237. // };
  238.  
  239. // dayz_equipCheck = {
  240. // private ["_empty", "_needed","_diff","_success"];
  241. // _config = _this;
  242. // _empty = [player] call BIS_fnc_invSlotsEmpty;
  243. // _needed = [_config] call BIS_fnc_invSlotType;
  244. // _diff = [_empty,_needed] call BIS_fnc_vectorDiff;
  245. //
  246. // _success = true;
  247. // {
  248. // if (_x > 0) then {_success = false};
  249. // } forEach _diff;
  250. // hint format["Config: %5\nEmpty: %1\nNeeded: %2\nDiff: %3\nSuccess: %4",_empty,_needed,_diff,_success,_config];
  251. // _success
  252. // };
  253.  
  254. dayz_spaceInterrupt = {
  255. private ["_dikCode", "_handled","_displayg"];
  256. _dikCode = _this select 1;
  257. _handled = false;
  258. if (_dikCode in (actionKeys "GetOver")) then {
  259. if (!r_fracture_legs and (time - dayz_lastCheckBit > 4)) then {
  260. _inBuilding = [player] call fnc_isInsideBuilding;
  261. _nearbyObjects = nearestObjects[getPosATL player, ["TentStorage", "Hedgehog_DZ", "Sandbag1_DZ","TrapBear","Wire_cat1"], 8];
  262. if (!_inBuilding and (count _nearbyObjects == 0)) then {
  263. dayz_lastCheckBit = time;
  264. call player_CombatRoll;
  265. };
  266. };
  267. };
  268. //if (_dikCode == 57) then {_handled = true}; // space
  269. //if (_dikCode in actionKeys 'MoveForward' or _dikCode in actionKeys 'MoveBack') then {r_interrupt = true};
  270. /*
  271. if (_dikCode == 210) then //insert Key
  272. {
  273. _nill = execvm "\z\addons\dayz_code\actions\playerstats.sqf";
  274. };
  275. */
  276. //Prevent exploit of drag body
  277. if ((_dikCode in actionKeys "Prone") and r_drag_sqf) then { force_dropBody = true; };
  278. if ((_dikCode in actionKeys "Crouch") and r_drag_sqf) then { force_dropBody = true; };
  279.  
  280. if (_dikCode in actionKeys "MoveLeft") then {r_interrupt = true};
  281. if (_dikCode in actionKeys "MoveRight") then {r_interrupt = true};
  282. if (_dikCode in actionKeys "MoveForward") then {r_interrupt = true};
  283. if (_dikCode in actionKeys "MoveBack") then {r_interrupt = true};
  284. if (_dikCode in actionKeys "ForceCommandingMode") then {_handled = true};
  285. if (_dikCode in actionKeys "PushToTalk" and (time - dayz_lastCheckBit > 10)) then {
  286. dayz_lastCheckBit = time;
  287. [player,15,true,(getPosATL player)] spawn player_alertZombies;
  288. };
  289. if (_dikCode in actionKeys "VoiceOverNet" and (time - dayz_lastCheckBit > 10)) then {
  290. dayz_lastCheckBit = time;
  291. [player,15,true,(getPosATL player)] spawn player_alertZombies;
  292. };
  293. if (_dikCode in actionKeys "PushToTalkDirect" and (time - dayz_lastCheckBit > 10)) then {
  294. dayz_lastCheckBit = time;
  295. [player,5,false,(getPosATL player)] spawn player_alertZombies;
  296. };
  297. if (_dikCode in actionKeys "Chat" and (time - dayz_lastCheckBit > 10)) then {
  298. dayz_lastCheckBit = time;
  299. [player,15,false,(getPosATL player)] spawn player_alertZombies;
  300. };
  301. if (_dikCode in actionKeys "User20" and (time - dayz_lastCheckBit > 5)) then {
  302. dayz_lastCheckBit = time;
  303. _nill = execvm "\z\addons\dayz_code\actions\playerstats.sqf";
  304. };
  305. if (_dikCode in actionKeys "User19" and (time - dayz_lastCheckBit > 5)) then {
  306. dayz_lastCheckBit = time;
  307. _nill = execvm "fixes\custom_monitor.sqf";
  308. };
  309. if ((_dikCode == 0x3E or _dikCode == 0x0F or _dikCode == 0xD3) and (time - dayz_lastCheckBit > 10)) then {
  310. dayz_lastCheckBit = time;
  311. call dayz_forceSave;
  312. };
  313. if (_dikCode == 0xB8 or _dikCode == 0x38 or _dikCode == 0x3E or _dikCode == 0x2A or _dikCode == 0x36 or _dikCode == 0x01) then {
  314. _displayg = findDisplay 106;
  315. if (!isNull _displayg) then {
  316. call player_gearSync;
  317. call dayz_forceSave;
  318. } else {
  319. if (dialog) then {
  320. call player_gearSync;
  321. call dayz_forceSave;
  322. };
  323. };
  324. };
  325. /*
  326. if (_dikCode in actionKeys "IngamePause") then {
  327. waitUntil {
  328. _display = findDisplay 49;
  329. !isNull _display;
  330. };
  331. _btnRespawn = _display displayCtrl 1010;
  332. _btnAbort = _display displayCtrl 104;
  333. _btnRespawn ctrlEnable false;
  334. _btnAbort ctrlEnable false;
  335. };
  336. */
  337. _handled
  338. };
  339.  
  340. player_CombatRoll = {
  341. DoRE = ({isPlayer _x} count (player nearEntities ["AllVehicles",100]) > 1);
  342. if (canRoll && animationState player in ["amovpercmrunslowwrfldf","amovpercmrunsraswrfldf","amovpercmevaslowwrfldf","amovpercmevasraswrfldf"]) then {
  343. canRoll = false;
  344. null = [] spawn {
  345. if (DoRE) then {
  346. [nil, player, rSWITCHMOVE, "ActsPercMrunSlowWrflDf_FlipFlopPara"] call RE;
  347. } else {
  348. player switchMove "ActsPercMrunSlowWrflDf_FlipFlopPara";
  349. };
  350. sleep 0.3;
  351. player setVelocity [(velocity player select 0) + 1.5 * sin direction player, (velocity player select 1) + 1.5 * cos direction player, (velocity player select 2) + 4];
  352. sleep 1;
  353. canRoll = true;
  354. };
  355. _handled = true;
  356. };
  357. };
  358.  
  359. // player_serverModelChange = {
  360. // private["_object","_model"];
  361. // _object = _this select 0;
  362. // _model = _this select 1;
  363. // if (_object == player) then {
  364. // _model call player_switchModel;
  365. // };
  366. // };
  367.  
  368. player_guiControlFlash = {
  369. private["_control"];
  370. _control = _this;
  371. if (ctrlShown _control) then {
  372. _control ctrlShow false;
  373. } else {
  374. _control ctrlShow true;
  375. };
  376. };
  377.  
  378. gear_ui_offMenu = {
  379. private["_control","_parent","_menu"];
  380. disableSerialization;
  381. _control = _this select 0;
  382. _parent = findDisplay 106;
  383. if (!(_this select 3)) then {
  384. for "_i" from 0 to 9 do {
  385. _menu = _parent displayCtrl (1600 + _i);
  386. _menu ctrlShow false;
  387. };
  388. _grpPos = ctrlPosition _control;
  389. _grpPos set [3,0];
  390. _control ctrlSetPosition _grpPos;
  391. _control ctrlShow false;
  392. _control ctrlCommit 0;
  393. };
  394. };
  395.  
  396.  
  397. gear_ui_init = {
  398. private["_control","_parent","_menu","_dspl","_grpPos"];
  399. disableSerialization;
  400. _parent = findDisplay 106;
  401. _control = _parent displayCtrl 6902;
  402. for "_i" from 0 to 9 do {
  403. _menu = _parent displayCtrl (1600 + _i);
  404. _menu ctrlShow false;
  405. };
  406. _grpPos = ctrlPosition _control;
  407. _grpPos set [3,0];
  408. _control ctrlSetPosition _grpPos;
  409. _control ctrlShow false;
  410. _control ctrlCommit 0;
  411. };
  412.  
  413. // dayz_eyeDir = {
  414. // private["_vval","_vdir"];
  415. // _vval = (eyeDirection _this);
  416. // _vdir = (_vval select 0) atan2 (_vval select 1);
  417. // if (_vdir < 0) then {_vdir = 360 + _vdir};
  418. // _vdir
  419. // };
  420.  
  421. dayz_lowHumanity = {
  422. private["_unit","_humanity","_delay"];
  423. _unit = _this;
  424. if ((_unit distance player) < 15) then {
  425. _humanity = _unit getVariable["humanity",0];
  426. dayz_heartBeat = true;
  427. if (_humanity < -3000) then {
  428. _delay = ((10000 + _humanity) / 5500) + 0.3;
  429. playSound "heartbeat_1";
  430. sleep _delay;
  431. };
  432. dayz_heartBeat = false;
  433. };
  434. };
  435.  
  436. dayz_meleeMagazineCheck = {
  437. private["_meleeNum","_magType","_wpnType","_ismelee"];
  438. _wpnType = primaryWeapon player;
  439. _ismelee = (gettext (configFile >> "CfgWeapons" >> _wpnType >> "melee"));
  440. if (_ismelee == "true") then {
  441. _magType = ([] + getArray (configFile >> "CfgWeapons" >> _wpnType >> "magazines")) select 0;
  442. _meleeNum = ({_x == _magType} count magazines player);
  443. if (_meleeNum < 1) then {
  444. player addMagazine _magType;
  445. };
  446. };
  447. };
  448.  
  449. dayz_futurePos = {
  450. private ["_vehicle","_velo","_speed","_nextPlayerPos"];
  451.  
  452. _vehicle = (vehicle _this);
  453. _velo = velocity _vehicle;
  454. _speed = ([0, 0, 0] distance (_velo)); // buggy: if player/veh is blocked by an object, speed is not zero
  455. _nextPlayerPos = getPosATL _this;
  456. if (_speed > 0) then {
  457. // try compute next player pos. This works both whether player is bare foot, or in a vehicle, whatever his place.
  458. _velo = [ (_velo select 0) / _speed, (_velo select 1) / _speed, (_velo select 2) / _speed]; // normalize speed vector
  459. _nextPlayerPos set [0, (_nextPlayerPos select 0) + (_velo select 0) * 1]; // 1 = a meter alongside the movement
  460. _nextPlayerPos set [1, (_nextPlayerPos select 1) + (_velo select 1) * 1];
  461. _nextPlayerPos set [2, (_nextPlayerPos select 2) + (_velo select 2) * 1];
  462. };
  463.  
  464. _nextPlayerPos
  465. };
  466.  
  467. dayz_originalPlayer = player;
  468. };
  469.  
  470. progressLoadingScreen 0.8;
  471.  
  472. //Both
  473. BIS_fnc_selectRandom = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_selectRandom.sqf"; //Checks which actions for nearby casualty
  474. fnc_buildWeightedArray = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_buildWeightedArray.sqf"; //Checks which actions for nearby casualty
  475. zombie_initialize = compile preprocessFileLineNumbers "\z\addons\dayz_code\init\zombie_init.sqf";
  476. object_vehicleKilled = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_vehicleKilled.sqf"; //Event handler run on damage
  477. object_getHit = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_getHit.sqf"; //gets the hit value for a HitPoint (i.e. HitLegs) against the selection (i.e. "legs"), returns the value
  478. object_setHit = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_setHit.sqf"; //process the hit as a NORMAL damage (useful for persistent vehicles)
  479. object_processHit = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_processHit.sqf"; //process the hit in the REVO damage system (records and sets hit)
  480. object_delLocal = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_delLocal.sqf";
  481. object_cargoCheck = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_cargoCheck.sqf"; //Run by the player or server to monitor changes in cargo contents
  482. fnc_usec_damageHandler = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_damageHandler.sqf"; //Event handler run on damage
  483. // Vehicle damage fix
  484. fnc_veh_handleDam = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\veh_handleDam.sqf";
  485. fnc_veh_handleKilled = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\veh_handleKilled.sqf";
  486. fnc_veh_handleRepair = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\veh_handleRepair.sqf"; //process the hit as a NORMAL damage (useful for persistent vehicles)
  487. fnc_veh_ResetEH = compile preprocessFileLineNumbers "\z\addons\dayz_code\init\veh_ResetEH.sqf"; //Initialize vehicle
  488. fnc_inString = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_inString.sqf";
  489. fnc_isInsideBuilding = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_isInsideBuilding.sqf"; //_isInside = [_unit,_building] call fnc_isInsideBuilding;
  490. dayz_zombieSpeak = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_speak.sqf"; //Used to generate random speech for a unit
  491. vehicle_getHitpoints = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\vehicle_getHitpoints.sqf";
  492. local_gutObject = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\local_gutObject.sqf"; //Generated on the server (or local to unit) when gutting an object
  493. local_zombieDamage = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_damageHandlerZ.sqf"; //Generated by the client who created a zombie to track damage
  494. local_setFuel = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\local_setFuel.sqf"; //Generated when someone refuels a vehicle
  495. local_eventKill = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\local_eventKill.sqf"; //Generated when something is killed
  496. //player_weaponCheck = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_weaponCheck.sqf"; //Run by the player or server to monitor whether they have picked up a new weapon
  497. curTimeStr = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_curTimeStr.sqf";
  498. player_medBandage = compile preprocessFileLineNumbers "\z\addons\dayz_code\medical\publicEH\medBandaged.sqf";
  499. player_medInject = compile preprocessFileLineNumbers "\z\addons\dayz_code\medical\publicEH\medInject.sqf";
  500. player_medEpi = compile preprocessFileLineNumbers "\z\addons\dayz_code\medical\publicEH\medEpi.sqf";
  501. player_medTransfuse = compile preprocessFileLineNumbers "\z\addons\dayz_code\medical\publicEH\medTransfuse.sqf";
  502. player_medMorphine = compile preprocessFileLineNumbers "\z\addons\dayz_code\medical\publicEH\medMorphine.sqf";
  503. player_medPainkiller = compile preprocessFileLineNumbers "\z\addons\dayz_code\medical\publicEH\medPainkiller.sqf";
  504. world_isDay = {if ((daytime < (24 - dayz_sunRise)) and (daytime > dayz_sunRise)) then {true} else {false}};
  505. player_humanityChange = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_humanityChange.sqf";
  506. spawn_loot = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\spawn_loot.sqf";
  507. player_projectileNear = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_projectileNear.sqf";
  508.  
  509.  
  510. player_sumMedical = {
  511. private["_character","_wounds","_legs","_arms","_medical", "_status"];
  512. _character = _this;
  513. _wounds = [];
  514. if (_character getVariable["USEC_injured",false]) then {
  515. {
  516. _status = _character getVariable["hit_"+_x,false];
  517. if ((typeName _status == "BOOLEAN") AND {(_status)}) then {
  518. _wounds set [count _wounds,_x];
  519. };
  520. } forEach USEC_typeOfWounds;
  521. };
  522. _legs = _character getVariable ["hit_legs",0];
  523. _arms = _character getVariable ["hit_arms",0];
  524. _medical = [
  525. _character getVariable["USEC_isDead",false],
  526. _character getVariable["NORRN_unconscious", false],
  527. _character getVariable["USEC_infected",false],
  528. _character getVariable["USEC_injured",false],
  529. _character getVariable["USEC_inPain",false],
  530. _character getVariable["USEC_isCardiac",false],
  531. _character getVariable["USEC_lowBlood",false],
  532. _character getVariable["USEC_BloodQty",12000],
  533. _wounds,
  534. [_legs,_arms],
  535. _character getVariable["unconsciousTime",0],
  536. _character getVariable["messing",[0,0]]
  537. ];
  538. _medical
  539. };
  540.  
  541. fn_niceSpot = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_niceSpot.sqf";
  542.  
  543. //Server Only
  544. if (isServer) then {
  545. call compile preprocessFileLineNumbers "\z\addons\dayz_server\init\server_functions.sqf";
  546. } else {
  547. eh_localCleanup = {};
  548. };
  549.  
  550. //Start Dynamic Weather
  551. execVM "\z\addons\dayz_code\system\DynamicWeatherEffects.sqf";
  552. initialized = true;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement