Guest User

compiles.sqf

a guest
Oct 4th, 2013
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 29.28 KB | None | 0 0
  1. //Player only
  2. if (!isDedicated) then {
  3. "filmic" setToneMappingParams [0.07, 0.31, 0.23, 0.37, 0.011, 3.750, 6, 4]; setToneMapping "Filmic";
  4.  
  5. BIS_Effects_Burn = compile preprocessFile "\ca\Data\ParticleEffects\SCRIPTS\destruction\burn.sqf";
  6. 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
  7. player_zombieAttack = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_zombieAttack.sqf"; //Run on a players computer, causes a nearby zombie to attack them
  8. fnc_usec_damageActions = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_damageActions.sqf"; //Checks which actions for nearby casualty
  9. player_build = compile preprocessFileLineNumbers "dayz_code\compile\player_build.sqf"; // This overwrites default dayz building mechanic
  10. antiWall = compile preprocessFileLineNumbers "dayz_code\compile\antiWall.sqf"; // This prevents players from exiting vehicles to get into bases
  11. anti_discWall = compile preprocessFileLineNumbers "dayz_code\compile\anti_discWall.sqf"; // This prevents players from driving into a wall and disconnecting to get into bases
  12. refresh_build_recipe_dialog = compile preprocessFileLineNumbers "buildRecipeBook\refresh_build_recipe_dialog.sqf"; // Builder menu dialog functionality
  13. refresh_build_recipe_list_dialog = compile preprocessFileLineNumbers "buildRecipeBook\refresh_build_recipe_list_dialog.sqf"; // Builder Menu dialog list
  14. fnc_inAngleSector = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_inAngleSector.sqf"; //Checks which actions for nearby casualty
  15. fnc_usec_selfActions = compile preprocessFileLineNumbers "dayz_code\compile\fn_selfActions.sqf"; //Checks which actions for self
  16. fnc_usec_unconscious = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_unconscious.sqf";
  17. player_temp_calculation = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_temperatur.sqf"; //Temperatur System //TeeChange
  18. player_weaponFiredNear = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_weaponFiredNear.sqf";
  19. player_animalCheck = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_animalCheck.sqf";
  20. player_spawnCheck = compile preprocessFileLineNumbers "dayz_code\compile\player_spawnCheck.sqf";
  21. //player_spawnLootCheck = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_spawnlootCheck.sqf";
  22. //player_spawnZedCheck = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_spawnzedCheck.sqf";
  23. building_spawnLoot = compile preprocessFileLineNumbers "dayz_code\compile\building_spawnLoot.sqf";
  24. //player_taskHint = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_taskHint.sqf";
  25. building_spawnZombies = compile preprocessFileLineNumbers "dayz_code\compile\building_spawnZombies.sqf";
  26. //animal_monitor = compile preprocessFileLineNumbers "\z\addons\dayz_code\system\animal_monitor.sqf";
  27. //building_monitor = compile preprocessFileLineNumbers "\z\addons\dayz_code\system\building_monitor.sqf";
  28. 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
  29. player_packTent = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_packTent.sqf";
  30. //control_zombieAgent = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\control_zombieAgent.sqf";
  31. player_updateGui = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_updateGui.sqf";
  32. player_crossbowBolt = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_crossbowBolt.sqf";
  33. spawn_flies = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\spawn_flies.sqf";
  34. stream_locationFill = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\stream_locationFill.sqf";
  35. stream_locationDel = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\stream_locationDel.sqf";
  36. stream_locationCheck = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\stream_locationCheck.sqf";
  37. player_music = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_music.sqf"; //Used to generate ambient music
  38. //player_login = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_login.sqf"; //Used to generate ambient music
  39. player_death = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_death.sqf";
  40. player_switchModel = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_switchModel.sqf";
  41. player_checkStealth = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_checkStealth.sqf";
  42. world_sunRise = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_sunRise.sqf";
  43. world_surfaceNoise = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_surfaceNoise.sqf";
  44. player_humanityMorph = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_humanityMorph.sqf";
  45. player_throwObject = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_throwObject.sqf";
  46. player_alertZombies = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_alertZombies.sqf";
  47. player_fireMonitor = compile preprocessFileLineNumbers "\z\addons\dayz_code\system\fire_monitor.sqf";
  48. player_countMagazines = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_countMagazines.sqf";
  49. player_forceSave = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_forceSave.sqf";
  50. player_Bubble = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_Bubble.sqf";
  51.  
  52. //Objects
  53. object_roadFlare = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_roadFlare.sqf";
  54. object_setpitchbank = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_setpitchbank.sqf";
  55. object_monitorGear = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_monitorGear.sqf";
  56.  
  57. //Zombies
  58. zombie_findTargetAgent = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\zombie_findTargetAgent.sqf";
  59. zombie_loiter = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\zombie_loiter.sqf"; //Server compile, used for loiter behaviour
  60. zombie_generate = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\zombie_generate.sqf"; //Server compile, used for loiter behaviours
  61.  
  62. //actions
  63. player_addToolbelt = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_addToolbelt.sqf";
  64. player_addtoBack = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_addtoBack.sqf";
  65. player_reloadMag = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_reloadMags.sqf";
  66. player_tentPitch = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\tent_pitch.sqf";
  67. player_createstash = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_createstash.sqf";
  68. player_drink = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_drink.sqf";
  69. player_eat = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_eat.sqf";
  70. player_useMeds = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_useMeds.sqf";
  71. player_fillWater = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\water_fill.sqf";
  72. player_makeFire = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_makefire.sqf";
  73. player_chopWood = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_chopWood.sqf";
  74. player_build = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_build.sqf";
  75. object_build = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\object_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. player_switchWeapon = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_switchWeapon.sqf";
  87. player_goFishing = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_goFishing.sqf";
  88. player_gather = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_gather.sqf";
  89.  
  90. //ui
  91. player_selectSlot = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\ui_selectSlot.sqf";
  92. player_gearSet = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_gearSet.sqf";
  93. ui_changeDisplay = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\ui_changeDisplay.sqf";
  94. ui_gear_sound = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\ui_gear_sound.sqf";
  95.  
  96. //playerstats
  97. horde_epeen_fnc_fill_page = compile preProcessFile "\z\addons\dayz_code\actions\playerstats\fill_page_fnc.sqf";
  98. horde_epeen_determine_humanity_fnc = compile preProcessFile "\z\addons\dayz_code\actions\playerstats\determine_humanity_fnc.sqf";
  99. horde_epeen_setText_journal_fnc = compile preProcessFile "\z\addons\dayz_code\actions\playerstats\epeen_setText_journal.sqf";
  100. horde_epeen_setText_humanity_fnc = compile preProcessFile "\z\addons\dayz_code\actions\playerstats\epeen_setText_humanity.sqf";
  101. horde_epeen_setText_stats_fnc = compile preProcessFile "\z\addons\dayz_code\actions\playerstats\epeen_setText_stats.sqf";
  102. horde_epeen_show_humanity_fnc = compile preProcessFile "\z\addons\dayz_code\actions\playerstats\show_humanity_fnc.sqf";
  103.  
  104. //System
  105. player_monitor = compile preprocessFileLineNumbers "\z\addons\dayz_code\system\player_monitor.sqf";
  106. player_spawn_1 = compile preprocessFileLineNumbers "\z\addons\dayz_code\system\player_spawn_1.sqf";
  107. player_spawn_2 = compile preprocessFileLineNumbers "\z\addons\dayz_code\system\player_spawn_2.sqf";
  108. onPreloadStarted "dayz_preloadFinished = false;";
  109. onPreloadFinished "dayz_preloadFinished = true;";
  110. infectedcamps = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_infectedcamps.sqf";
  111. camp_spawnZombies = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\camp_spawnZombies.sqf"; //Server compile, used for loiter behaviour
  112.  
  113. //Crafting
  114. fn_updateCraftUI = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_updateCraftUI.sqf";
  115. player_craftItem = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_craftItem.sqf";
  116. player_checkRecipe = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_checkRecipe.sqf";
  117.  
  118.  
  119. // TODO: need move it in player_monitor.fsm
  120. // allow player disconnect from server, if loading hang, kicked by BE etc.
  121.  
  122. //This is still needed but the fsm should terminate if any errors pop up.
  123.  
  124. [] spawn {
  125. private["_timeOut","_display","_control1","_control2"];
  126. disableSerialization;
  127. _timeOut = 0;
  128. dayz_loadScreenMsg = "";
  129. diag_log "DEBUG: loadscreen guard started.";
  130. _display = uiNameSpace getVariable "BIS_loadingScreen";
  131. if (!isNil "_display") then {
  132. _control1 = _display displayctrl 8400;
  133. _control2 = _display displayctrl 102;
  134. };
  135.  
  136. // 120 sec timeout (12000 * 0.01)
  137. while { _timeOut < 12000 } do {
  138. if (dayz_clientPreload && dayz_authed) exitWith { diag_log "PLOGIN: Login loop completed!"; };
  139.  
  140. if (!isNil "_display") then {
  141. if ( isNull _display ) then {
  142. waitUntil { !dialog; };
  143. startLoadingScreen ["","RscDisplayLoadCustom"];
  144. _display = uiNameSpace getVariable "BIS_loadingScreen";
  145. _control1 = _display displayctrl 8400;
  146. _control2 = _display displayctrl 102;
  147. };
  148.  
  149. if ( dayz_loadScreenMsg != "" ) then {
  150. _control1 ctrlSetText dayz_loadScreenMsg;
  151. dayz_loadScreenMsg = "";
  152. };
  153.  
  154. _control2 ctrlSetText format["%1",round(_timeOut*0.01)];
  155. };
  156.  
  157. _timeOut = _timeOut + 1;
  158.  
  159. if (_timeOut >= 12000) then {
  160. 1 cutText [localize "str_player_login_timeout", "PLAIN DOWN"];
  161. sleep 5;
  162. endLoadingScreen;
  163. endMission "END1";
  164. };
  165.  
  166. sleep 0.01;
  167. };
  168. };
  169.  
  170. dayz_losChance = {
  171. private["_agent","_maxDis","_dis","_val","_maxExp","_myExp"];
  172. _agent = _this select 0;
  173. _dis = _this select 1;
  174. _maxDis = _this select 2;
  175. //diag_log ("VAL: " + str(_this));
  176. _val = (_maxDis - _dis) max 0;
  177. _maxExp = ((exp 2) * _maxDis);
  178. _myExp = ((exp 2) * (_val)) / _maxExp;
  179. _myExp = _myExp * 0.7;
  180. _myExp
  181. };
  182.  
  183. ui_initDisplay = {
  184. private["_control","_ctrlBleed","_display","_ctrlFracture"];
  185. disableSerialization;
  186. _display = uiNamespace getVariable 'DAYZ_GUI_display';
  187. _control = _display displayCtrl 1204;
  188. _control ctrlShow false;
  189. if (!r_player_injured) then {
  190. _ctrlBleed = _display displayCtrl 1303;
  191. _ctrlBleed ctrlShow false;
  192. };
  193. if (!r_fracture_legs and !r_fracture_arms) then {
  194. _ctrlFracture = _display displayCtrl 1203;
  195. _ctrlFracture ctrlShow false;
  196. };
  197. };
  198.  
  199. dayz_angleCheck = {
  200. private ["_target","_agent","_degree","_tPos","_zPos","_inAngle","_degree"];
  201. _target = _this select 0;
  202. _agent = _this select 1;
  203. _degree = _this select 2;
  204. _inAngle = false;
  205. _tPos = (getPosASL _target);
  206. _zPos = (getPosASL _agent);
  207. _eyeDir = direction _agent;
  208. _inAngle = [_zPos,_eyeDir,_degree,_tPos] call fnc_inAngleSector;
  209. _inAngle
  210. };
  211.  
  212. dayz_AttackCheck = {
  213. private ["_target","_agent","_degree","_tPos","_zPos","_inAngle","_degree","_cantSee","_attackCheck"];
  214. _target = _this select 0;
  215. _agent = _this select 1;
  216. _degree = _this select 2;
  217. _attackCheck = false;
  218. _inAngle = [_target,_agent,_degree] call dayz_angleCheck;
  219. if (_inAngle) then {
  220. _cantSee = [_target,_agent] call dayz_losCheck;
  221. if (!_cantSee) then {
  222. _attackCheck = true;
  223. };
  224. };
  225. _attackCheck
  226. };
  227.  
  228. dayz_losCheck = {
  229. private["_target","_agent","_cantSee"];
  230. _target = _this select 0; // PUT THE PLAYER IN FIRST ARGUMENT!!!!
  231. _agent = _this select 1;
  232. _cantSee = true;
  233. if (!isNull _target) then {
  234. _tPos = eyePos _target;
  235. _zPos = eyePos _agent;
  236. if ((count _tPos > 0) and (count _zPos > 0)) then {
  237. _cantSee = terrainIntersectASL [_tPos, _zPos];
  238. if (!_cantSee) then {
  239. _cantSee = lineIntersects [_tPos, _zPos, _agent, vehicle _target];
  240. };
  241. };
  242. };
  243. _cantSee
  244. };
  245.  
  246. /* //not actually used
  247. dayz_losCheck_attack = {
  248. private["_target","_agent","_cantSee"];
  249. _target = _this select 0;
  250. _agent = _this select 1;
  251. _cantSee = true;
  252. if (!isNull _target) then {
  253. _tPos = [_target select 0, _target select 1, eyePos _target select 2];
  254. _zPos = [_agent select 0, _agent select 1, eyePos _agent select 2];
  255. if ((count _tPos > 0) and (count _zPos > 0)) then {
  256. _cantSee = terrainIntersectASL [_tPos, _zPos];
  257. if (!_cantSee) then {
  258. _cantSee = lineIntersects [_tPos, _zPos, _agent, _target];
  259. };
  260. };
  261. };
  262. _cantSee
  263. }; */
  264.  
  265. dayz_spaceInterrupt = {
  266. private ["_dikCode", "_handled","_displayg","_shiftState","_ctrlState","_altState","_nill"];
  267. _dikCode = _this select 1;
  268. _shiftState = _this select 2;
  269. _ctrlState = _this select 3;
  270. _altState = _this select 4;
  271. _handled = false;
  272.  
  273. // Disable ESC after death (not sure if needed but it's here to make sure)
  274. if (_dikCode == 0x01 && r_player_dead) then {
  275. _handled = true;
  276. };
  277.  
  278. switch (_dikCode) do {
  279. case 0x02: {
  280. ["rifle"] spawn player_switchWeapon;
  281. _handled = true;
  282. };
  283. case 0x03: {
  284. ["pistol"] spawn player_switchWeapon;
  285. _handled = true;
  286. };
  287. case 0x04: {
  288. ["melee"] spawn player_switchWeapon;
  289. _handled = true;
  290. };
  291. default {
  292. if (_dikCode in [0x58,0x57,0x44,0x43,0x42,0x41,0x40,0x3F,0x3E,0x3D,0x3C,0x3B,0x0B,0x0A,0x09,0x08,0x07,0x06,0x05]) then {
  293. _handled = true;
  294. };
  295. };
  296. };
  297.  
  298. if ((_dikCode in actionKeys "Gear") and (vehicle player != player) and !_shiftState and !_ctrlState and !_altState && !dialog) then {
  299. createGearDialog [player, "RscDisplayGear"];
  300. _handled = true;
  301. };
  302.  
  303. //if (_dikCode in actionKeys 'MoveForward' or _dikCode in actionKeys 'MoveBack') then {r_interrupt = true};
  304. //Prevent exploit of drag body
  305. if ((_dikCode in actionKeys "Prone") and r_drag_sqf) then { force_dropBody = true; };
  306. if ((_dikCode in actionKeys "Crouch") and r_drag_sqf) then { force_dropBody = true; };
  307.  
  308. if (_dikCode in actionKeys "MoveLeft") then {r_interrupt = true};
  309. if (_dikCode in actionKeys "MoveRight") then {r_interrupt = true};
  310. if (_dikCode in actionKeys "MoveForward") then {r_interrupt = true};
  311. if (_dikCode in actionKeys "MoveBack") then {r_interrupt = true};
  312. if (_dikCode in actionKeys "ForceCommandingMode") then {_handled = true};
  313. if (_dikCode in actionKeys "PushToTalk" and (time - dayz_lastCheckBit > 10)) then {
  314. dayz_lastCheckBit = time;
  315. [player,15,true,(getPosATL player)] call player_alertZombies;
  316. };
  317. if (_dikCode in actionKeys "VoiceOverNet" and (time - dayz_lastCheckBit > 10)) then {
  318. dayz_lastCheckBit = time;
  319. [player,15,true,(getPosATL player)] call player_alertZombies;
  320. };
  321. if (_dikCode in actionKeys "PushToTalkDirect" and (time - dayz_lastCheckBit > 10)) then {
  322. dayz_lastCheckBit = time;
  323. [player,5,false,(getPosATL player)] call player_alertZombies;
  324. };
  325. if (_dikCode in actionKeys "Chat" and (time - dayz_lastCheckBit > 10)) then {
  326. dayz_lastCheckBit = time;
  327. [player,15,false,(getPosATL player)] call player_alertZombies;
  328. };
  329. if (_dikCode in actionKeys "User20" and (time - dayz_lastCheckBit > 5)) then {
  330. dayz_lastCheckBit = time;
  331. _nill = execvm "\z\addons\dayz_code\actions\playerstats.sqf";
  332. };
  333. if ((_dikCode in [0x3E,0x0F,0xD3]) and (time - dayz_lastCheckBit > 10)) then {
  334. dayz_lastCheckBit = time;
  335. call player_forceSave;
  336. };
  337. if (_dikCode in [0xB8,0x38,0x3E,0x2A,0x36,0x01]) then {
  338. _displayg = findDisplay 106;
  339. if (!isNull _displayg) then {
  340. call player_forceSave;
  341. } else {
  342. if (dialog) then {
  343. call player_forceSave;
  344. };
  345. };
  346. };
  347. _object = player getVariable ["constructionObject", objNull];
  348. if (!isNull _object and _dikCode in actionKeys "LeanLeft") then {
  349. _dir = getDir _object - 3;
  350. _object setDir _dir;
  351. _handled = true;
  352. };
  353. if (!isNull _object and _dikCode in actionKeys "LeanRight") then {
  354. _dir = getDir _object + 3;
  355. _object setDir _dir;
  356. _handled = true;
  357. };
  358. _handled
  359. };
  360.  
  361. player_guiControlFlash = {
  362. private["_control"];
  363. _control = _this;
  364. if (ctrlShown _control) then {
  365. _control ctrlShow false;
  366. } else {
  367. _control ctrlShow true;
  368. };
  369. };
  370.  
  371. gear_ui_offMenu = {
  372. private["_control","_parent","_menu","_grpPos"];
  373. disableSerialization;
  374. _control = _this select 0;
  375. _parent = findDisplay 106;
  376. if (!(_this select 3)) then {
  377. for "_i" from 0 to 9 do {
  378. _menu = _parent displayCtrl (1600 + _i);
  379. _menu ctrlShow false;
  380. };
  381. _grpPos = ctrlPosition _control;
  382. _grpPos set [3,0];
  383. _control ctrlSetPosition _grpPos;
  384. _control ctrlShow false;
  385. _control ctrlCommit 0;
  386. };
  387. };
  388.  
  389.  
  390. gear_ui_init = {
  391. private["_control","_parent","_menu","_grpPos"];
  392. disableSerialization;
  393. _parent = findDisplay 106;
  394. _control = _parent displayCtrl 6902;
  395. for "_i" from 0 to 9 do {
  396. _menu = _parent displayCtrl (1600 + _i);
  397. _menu ctrlShow false;
  398. };
  399. _grpPos = ctrlPosition _control;
  400. _grpPos set [3,0];
  401. _control ctrlSetPosition _grpPos;
  402. _control ctrlShow false;
  403. _control ctrlCommit 0;
  404. };
  405.  
  406. gear_ui_hide = {
  407. private["_display","_BP"];
  408. disableSerialization;
  409. _display = findDisplay 106;
  410. _BP = unitBackpack player;
  411. if (ctrlShown (_display displayCtrl 159)) then {//prevent background images in backpack view
  412. for "_i" from 1006 to 1011 do {
  413. (_display displayCtrl _i) ctrlShow false;
  414. };
  415. } else {
  416. for "_i" from 1006 to 1011 do {
  417. if (!(ctrlShown (_display displayCtrl _i))) then {
  418. (_display displayCtrl _i) ctrlShow true;
  419. };
  420. };
  421. };
  422. //hide buttons if unnecessary
  423. if (isNull _BP || ((typeOf _BP) == "")) then {
  424. (_display displayCtrl 132) ctrlShow false;
  425. (_display displayCtrl 157) ctrlShow false;
  426. (_display displayCtrl 158) ctrlShow false;
  427. };
  428.  
  429. // Prevent carrying 2 rifles 'exploit'
  430. if (primaryWeapon player == "" && dayz_onBack != "" && !(dayz_onBack in MeleeWeapons)) then {
  431. ["gear"] call player_switchWeapon;
  432. };
  433.  
  434. if (primaryWeapon player != "" && (primaryWeapon player in MeleeWeapons || dayz_onBack in MeleeWeapons)) then {
  435. (_display displayCtrl 1204) ctrlShow true;
  436. } else {
  437. (_display displayCtrl 1204) ctrlShow false;
  438. };
  439.  
  440. if (DayZ_onBack != "") then {
  441. (_display displayCtrl 1208) ctrlShow true;
  442. } else {
  443. (_display displayCtrl 1208) ctrlShow false;
  444. };
  445.  
  446. for "_i" from 0 to (lbSize (_display displayCtrl 105)) - 1 do {
  447. (_display displayCtrl 105) lbSetColor [_i, [0.06, 0.05, 0.03, 1]];
  448. };
  449. };
  450.  
  451. dayz_lowHumanity = {
  452. private["_unit","_humanity","_delay"];
  453. _unit = _this;
  454. if ((_unit distance player) < 15) then {
  455. _humanity = _unit getVariable["humanity",0];
  456. dayz_heartBeat = true;
  457. if (_humanity < -3000) then {
  458. _delay = ((10000 + _humanity) / 5500) + 0.3;
  459. playSound "heartbeat_1";
  460. sleep _delay;
  461. };
  462. dayz_heartBeat = false;
  463. };
  464. };
  465.  
  466. dayz_meleeMagazineCheck = {
  467. private["_meleeNum","_magType","_wpnType","_ismelee"];
  468. _wpnType = primaryWeapon player;
  469. _ismelee = (gettext (configFile >> "CfgWeapons" >> _wpnType >> "melee"));
  470. if (_ismelee == "true") then {
  471. _magType = ([] + getArray (configFile >> "CfgWeapons" >> _wpnType >> "magazines")) select 0;
  472. _meleeNum = ({_x == _magType} count magazines player);
  473. if (_meleeNum < 1) then {
  474. player addMagazine _magType;
  475. };
  476. };
  477. };
  478.  
  479. /* //not actually used...
  480. dayz_futurePos = {
  481. private ["_vehicle","_velo","_speed","_nextPlayerPos"];
  482.  
  483. _vehicle = (vehicle _this);
  484. _velo = velocity _vehicle;
  485. _speed = ([0, 0, 0] distance (_velo)); // buggy: if player/veh is blocked by an object, speed is not zero
  486. _nextPlayerPos = getPosATL _this;
  487. if (_speed > 0) then {
  488. // try compute next player pos. This works both whether player is bare foot, or in a vehicle, whatever his place.
  489. _velo = [ (_velo select 0) / _speed, (_velo select 1) / _speed, (_velo select 2) / _speed]; // normalize speed vector
  490. _nextPlayerPos set [0, (_nextPlayerPos select 0) + (_velo select 0) * 1]; // 1 = a meter alongside the movement
  491. _nextPlayerPos set [1, (_nextPlayerPos select 1) + (_velo select 1) * 1];
  492. _nextPlayerPos set [2, (_nextPlayerPos select 2) + (_velo select 2) * 1];
  493. };
  494.  
  495. _nextPlayerPos
  496. }; */
  497.  
  498. dayz_originalPlayer = player;
  499. };
  500.  
  501. progressLoadingScreen 0.8;
  502.  
  503. //Both
  504. BIS_fnc_selectRandom = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_selectRandom.sqf"; //Checks which actions for nearby casualty
  505. fnc_buildWeightedArray = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_buildWeightedArray.sqf"; //Checks which actions for nearby casualty
  506. zombie_initialize = compile preprocessFileLineNumbers "\z\addons\dayz_code\init\zombie_init.sqf";
  507. //object_vehicleKilled = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_vehicleKilled.sqf"; //Event handler run on damage
  508. 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
  509. object_setHit = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_setHit.sqf"; //process the hit as a NORMAL damage (useful for persistent vehicles)
  510. object_processHit = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_processHit.sqf"; //process the hit in the REVO damage system (records and sets hit)
  511. //object_delLocal = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_delLocal.sqf";
  512. //object_cargoCheck = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_cargoCheck.sqf"; //Run by the player or server to monitor changes in cargo contents
  513. fnc_usec_damageHandler = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_damageHandler.sqf"; //Event handler run on damage
  514. // Vehicle damage fix
  515. fnc_veh_handleDam = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\veh_handleDam.sqf";
  516. fnc_veh_handleKilled = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\veh_handleKilled.sqf";
  517. fnc_veh_handleRepair = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\veh_handleRepair.sqf"; //process the hit as a NORMAL damage (useful for persistent vehicles)
  518. fnc_veh_ResetEH = compile preprocessFileLineNumbers "\z\addons\dayz_code\init\veh_ResetEH.sqf"; //Initialize vehicle
  519. fnc_inString = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_inString.sqf";
  520. fnc_isInsideBuilding = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_isInsideBuilding.sqf"; //_isInside = [_unit,_building] call fnc_isInsideBuilding;
  521. dayz_zombieSpeak = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_speak.sqf"; //Used to generate random speech for a unit
  522. vehicle_getHitpoints = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\vehicle_getHitpoints.sqf";
  523. local_gutObject = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\local_gutObject.sqf"; //Generated on the server (or local to unit) when gutting an object
  524. local_zombieDamage = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_damageHandlerZ.sqf"; //Generated by the client who created a zombie to track damage
  525. local_setFuel = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\local_setFuel.sqf"; //Generated when someone refuels a vehicle
  526. local_eventKill = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\local_eventKill.sqf"; //Generated when something is killed
  527. //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
  528. //curTimeStr = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_curTimeStr.sqf";
  529. player_medBandage = compile preprocessFileLineNumbers "\z\addons\dayz_code\medical\publicEH\medBandaged.sqf";
  530. player_medInject = compile preprocessFileLineNumbers "\z\addons\dayz_code\medical\publicEH\medInject.sqf";
  531. player_medEpi = compile preprocessFileLineNumbers "\z\addons\dayz_code\medical\publicEH\medEpi.sqf";
  532. player_medTransfuse = compile preprocessFileLineNumbers "\z\addons\dayz_code\medical\publicEH\medTransfuse.sqf";
  533. player_medMorphine = compile preprocessFileLineNumbers "\z\addons\dayz_code\medical\publicEH\medMorphine.sqf";
  534. player_medPainkiller = compile preprocessFileLineNumbers "\z\addons\dayz_code\medical\publicEH\medPainkiller.sqf";
  535. player_medAntiBiotics = compile preprocessFileLineNumbers "\z\addons\dayz_code\medical\publicEH\medAntibiotics.sqf";
  536. player_humanityChange = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_humanityChange.sqf";
  537. spawn_loot = compile preprocessFileLineNumbers "dayz_code\compile\spawn_loot.sqf";
  538. player_projectileNear = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_projectileNear.sqf";
  539.  
  540. call compile preprocessFileLineNumbers "\z\addons\dayz_code\traps\init.sqf";
  541.  
  542. player_sumMedical = {
  543. private["_character","_wounds","_legs","_arms","_medical", "_status"];
  544. _character = _this;
  545. _wounds = [];
  546. if (_character getVariable["USEC_injured",false]) then {
  547. {
  548. _status = _character getVariable["hit_"+_x,false];
  549. if ((typeName _status == "BOOLEAN") AND {(_status)}) then {
  550. _wounds set [count _wounds,_x];
  551. };
  552. } forEach USEC_typeOfWounds;
  553. };
  554. _legs = _character getVariable ["hit_legs",0];
  555. _arms = _character getVariable ["hit_arms",0];
  556. _medical = [
  557. _character getVariable["USEC_isDead",false],
  558. _character getVariable["NORRN_unconscious", false],
  559. _character getVariable["USEC_infected",false],
  560. _character getVariable["USEC_injured",false],
  561. _character getVariable["USEC_inPain",false],
  562. _character getVariable["USEC_isCardiac",false],
  563. _character getVariable["USEC_lowBlood",false],
  564. _character getVariable["USEC_BloodQty",12000],
  565. _wounds,
  566. [_legs,_arms],
  567. _character getVariable["unconsciousTime",0],
  568. _character getVariable["messing",[0,0]]
  569. ];
  570. _medical
  571. };
  572.  
  573. fn_niceSpot = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_niceSpot.sqf";
  574.  
  575. //Server Only
  576. if (isServer) then {
  577. call compile preprocessFileLineNumbers "\z\addons\dayz_server\init\server_functions.sqf";
  578. } else {
  579. eh_localCleanup = {};
  580. };
  581.  
  582. //Start Dynamic Weather
  583. execVM "\z\addons\dayz_code\system\DynamicWeatherEffects.sqf";
  584. initialized = true;
Advertisement
Add Comment
Please, Sign In to add comment