Advertisement
Guest User

compiles.sqf

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