Advertisement
Guest User

compiles.sqf

a guest
Apr 17th, 2014
215
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 32.35 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 "custom\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 "custom\fn_selfActions.sqf"; // fnc_usec_selfActions - adds custom actions to dayz code
  11. fnc_usec_unconscious = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_unconscious.sqf";
  12. player_temp_calculation = compile preprocessFileLineNumbers "custom\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 "custom\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 "custom\building_spawnLoot.sqf";
  19. //player_taskHint = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_taskHint.sqf";
  20. building_spawnZombies = compile preprocessFileLineNumbers "custom\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 "custom\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 == 0x57) then {
  273. if (debugMonitor) then {
  274. debugMonitor = false;
  275. hintSilent "";
  276. } else {[] spawn fnc_debug;};
  277. };
  278.  
  279. if (_dikCode == 0x43) then {
  280. if (debugMonitor) then {
  281. debugMonitor = false;
  282. hintSilent "";
  283. } else {[] spawn fnc_help;};
  284. };
  285.  
  286. switch (_dikCode) do {
  287. case 0x02: {
  288. ["rifle"] spawn player_switchWeapon;
  289. _handled = true;
  290. };
  291. case 0x03: {
  292. ["pistol"] spawn player_switchWeapon;
  293. _handled = true;
  294. };
  295. case 0x04: {
  296. ["melee"] spawn player_switchWeapon;
  297. _handled = true;
  298. };
  299. default {
  300. if (_dikCode in [0x58,0x57,0x44,0x43,0x42,0x41,0x40,0x3F,0x3E,0x3D,0x3C,0x3B,0x0B,0x0A,0x09,0x08,0x07,0x06,0x05]) then {
  301. _handled = true;
  302. };
  303. };
  304. };
  305.  
  306. if ((_dikCode in actionKeys "Gear") and (vehicle player != player) and !_shiftState and !_ctrlState and !_altState && !dialog) then {
  307. createGearDialog [player, "RscDisplayGear"];
  308. _handled = true;
  309. };
  310.  
  311. //if (_dikCode in actionKeys 'MoveForward' or _dikCode in actionKeys 'MoveBack') then {r_interrupt = true};
  312. //Prevent exploit of drag body
  313. if ((_dikCode in actionKeys "Prone") and r_drag_sqf) then { force_dropBody = true; };
  314. if ((_dikCode in actionKeys "Crouch") and r_drag_sqf) then { force_dropBody = true; };
  315.  
  316. if (_dikCode in actionKeys "MoveLeft") then {r_interrupt = true};
  317. if (_dikCode in actionKeys "MoveRight") then {r_interrupt = true};
  318. if (_dikCode in actionKeys "MoveForward") then {r_interrupt = true};
  319. if (_dikCode in actionKeys "MoveBack") then {r_interrupt = true};
  320. if (_dikCode in actionKeys "ForceCommandingMode") then {_handled = true};
  321. if (_dikCode in actionKeys "PushToTalk" and (time - dayz_lastCheckBit > 10)) then {
  322. dayz_lastCheckBit = time;
  323. [player,15,true,(getPosATL player)] call player_alertZombies;
  324. };
  325. if (_dikCode in actionKeys "VoiceOverNet" and (time - dayz_lastCheckBit > 10)) then {
  326. dayz_lastCheckBit = time;
  327. [player,15,true,(getPosATL player)] call player_alertZombies;
  328. };
  329. if (_dikCode in actionKeys "PushToTalkDirect" and (time - dayz_lastCheckBit > 10)) then {
  330. dayz_lastCheckBit = time;
  331. [player,5,false,(getPosATL player)] call player_alertZombies;
  332. };
  333. if (_dikCode in actionKeys "Chat" and (time - dayz_lastCheckBit > 10)) then {
  334. dayz_lastCheckBit = time;
  335. [player,15,false,(getPosATL player)] call player_alertZombies;
  336. };
  337. if (_dikCode in actionKeys "User20" or _dikCode in actionKeys "NetworkStats") then {
  338. if (!dayz_isSwimming and !dialog) then {
  339. [player,4,true,(getPosATL player)] call player_alertZombies;
  340. createDialog "horde_journal_front_cover";
  341. };
  342. _handled = true;
  343. };
  344. if ((_dikCode in [0x3E,0x0F,0xD3]) and (time - dayz_lastCheckBit > 10)) then {
  345. dayz_lastCheckBit = time;
  346. call player_forceSave;
  347. };
  348. if (_dikCode in [0xB8,0x38,0x3E,0x2A,0x36,0x01]) then {
  349. _displayg = findDisplay 106;
  350. if (!isNull _displayg) then {
  351. call player_forceSave;
  352. } else {
  353. if (dialog) then {
  354. call player_forceSave;
  355. };
  356. };
  357. };
  358. _object = player getVariable ["constructionObject", objNull];
  359. if (!isNull _object and _dikCode in actionKeys "LeanLeft") then {
  360. _dir = getDir _object - 3;
  361. _object setDir _dir;
  362. _handled = true;
  363. };
  364. if (!isNull _object and _dikCode in actionKeys "LeanRight") then {
  365. _dir = getDir _object + 3;
  366. _object setDir _dir;
  367. _handled = true;
  368. };
  369. _handled
  370. };
  371.  
  372. player_guiControlFlash = {
  373. //private["_control"];
  374. //_control = _this;
  375. if (ctrlShown _this) then {
  376. _this ctrlShow false;
  377. } else {
  378. _this ctrlShow true;
  379. };
  380. };
  381.  
  382. gear_ui_offMenu = {
  383. private["_control","_parent","_menu","_grpPos"];
  384. disableSerialization;
  385. _control = _this select 0;
  386. _parent = findDisplay 106;
  387. if (!(_this select 3)) then {
  388. for "_i" from 0 to 9 do {
  389. _menu = _parent displayCtrl (1600 + _i);
  390. _menu ctrlShow false;
  391. };
  392. _grpPos = ctrlPosition _control;
  393. _grpPos set [3,0];
  394. _control ctrlSetPosition _grpPos;
  395. _control ctrlShow false;
  396. _control ctrlCommit 0;
  397. };
  398. };
  399.  
  400.  
  401. gear_ui_init = {
  402. //private["_control","_parent","_menu","_grpPos"];
  403. disableSerialization;
  404. _parent = findDisplay 106;
  405. _control = _parent displayCtrl 6902;
  406. for "_i" from 0 to 9 do {
  407. _menu = _parent displayCtrl (1600 + _i);
  408. _menu ctrlShow false;
  409. };
  410. _grpPos = ctrlPosition _control;
  411. _grpPos set [3,0];
  412. _control ctrlSetPosition _grpPos;
  413. _control ctrlShow false;
  414. _control ctrlCommit 0;
  415. };
  416.  
  417. gear_ui_hide = {
  418. //private["_display","_BP"];
  419. disableSerialization;
  420. _display = findDisplay 106;
  421. _BP = unitBackpack player;
  422. if (ctrlShown (_display displayCtrl 159)) then {//prevent background images in backpack view
  423. for "_i" from 1006 to 1011 do {
  424. (_display displayCtrl _i) ctrlShow false;
  425. };
  426. } else {
  427. for "_i" from 1006 to 1011 do {
  428. if (!(ctrlShown (_display displayCtrl _i))) then {
  429. (_display displayCtrl _i) ctrlShow true;
  430. };
  431. };
  432. };
  433. //hide buttons if unnecessary
  434. if (isNull _BP || ((typeOf _BP) == "")) then {
  435. (_display displayCtrl 132) ctrlShow false;
  436. (_display displayCtrl 157) ctrlShow false;
  437. (_display displayCtrl 158) ctrlShow false;
  438. };
  439.  
  440. // Prevent carrying 2 rifles 'exploit'
  441. if (primaryWeapon player == "" && dayz_onBack != "" && !(dayz_onBack in MeleeWeapons)) then {
  442. ["gear"] call player_switchWeapon;
  443. };
  444.  
  445. if (primaryWeapon player != "" && (primaryWeapon player in MeleeWeapons || dayz_onBack in MeleeWeapons)) then {
  446. (_display displayCtrl 1204) ctrlShow true;
  447. } else {
  448. (_display displayCtrl 1204) ctrlShow false;
  449. };
  450.  
  451. if (DayZ_onBack != "") then {
  452. (_display displayCtrl 1208) ctrlShow true;
  453. } else {
  454. (_display displayCtrl 1208) ctrlShow false;
  455. };
  456.  
  457. for "_i" from 0 to (lbSize (_display displayCtrl 105)) - 1 do {
  458. (_display displayCtrl 105) lbSetColor [_i, [0.06, 0.05, 0.03, 1]];
  459. };
  460. };
  461.  
  462. dayz_lowHumanity = {
  463. //private["_unit","_humanity","_delay"];
  464. _unit = _this;
  465. if ((_unit distance player) < 15) then {
  466. private "_humanity";
  467. _humanity = _unit getVariable["humanity",0];
  468. dayz_heartBeat = true;
  469. if (_humanity < -3000) then {
  470. private "_delay";
  471. _delay = ((10000 + _humanity) / 5500) + 0.3;
  472. playSound "heartbeat_1";
  473. sleep _delay;
  474. };
  475. dayz_heartBeat = false;
  476. };
  477. };
  478.  
  479. dayz_meleeMagazineCheck = {
  480. //private["_meleeNum","_magType","_wpnType","_ismelee"];
  481. _wpnType = primaryWeapon player;
  482. _ismelee = (gettext (configFile >> "CfgWeapons" >> _wpnType >> "melee"));
  483. if (_ismelee == "true") then {
  484. private ["_meleeNum","_magType"];
  485. _magType = ([] + getArray (configFile >> "CfgWeapons" >> _wpnType >> "magazines")) select 0;
  486. _meleeNum = ({_x == _magType} count magazines player);
  487. if (_meleeNum < 1) then {
  488. player addMagazine _magType;
  489. };
  490. };
  491. };
  492.  
  493. /* //not actually used...
  494. dayz_futurePos = {
  495. private ["_vehicle","_velo","_speed","_nextPlayerPos"];
  496.  
  497. _vehicle = (vehicle _this);
  498. _velo = velocity _vehicle;
  499. _speed = ([0, 0, 0] distance (_velo)); // buggy: if player/veh is blocked by an object, speed is not zero
  500. _nextPlayerPos = getPosATL _this;
  501. if (_speed > 0) then {
  502. // try compute next player pos. This works both whether player is bare foot, or in a vehicle, whatever his place.
  503. _velo = [ (_velo select 0) / _speed, (_velo select 1) / _speed, (_velo select 2) / _speed]; // normalize speed vector
  504. _nextPlayerPos set [0, (_nextPlayerPos select 0) + (_velo select 0) * 1]; // 1 = a meter alongside the movement
  505. _nextPlayerPos set [1, (_nextPlayerPos select 1) + (_velo select 1) * 1];
  506. _nextPlayerPos set [2, (_nextPlayerPos select 2) + (_velo select 2) * 1];
  507. };
  508.  
  509. _nextPlayerPos
  510. }; */
  511.  
  512. dayz_originalPlayer = player;
  513.  
  514. fnc_debug = {
  515. debugMonitor = true;
  516. while {debugMonitor} do
  517. {
  518. _killsH = player getVariable["humanKills",0];
  519. _killsB = player getVariable["banditKills",0];
  520. _humanity = player getVariable["humanity",0];
  521. _clientfps =round diag_fps;
  522. _tL = ((14280 - time) / 60);
  523. _tL = round(_tL);
  524. hintSilent parseText format ["
  525. <t size='2'font='Bitstream'align='center'color='#660000'>W.I.C.K.E.D.</t><br/>
  526. <t size='1'font='Bitstream'align='left'color='#CC0000'>Blood:</t><t size='1' font='Bitstream'align='right'color='#CC0000'>%1</t><br/>
  527. <t size='1'font='Bitstream'align='left'color='#0066FF'>Humanity:</t><t size='1'font='Bitstream'align='right'color='#0066FF'>%2</t><br/>
  528. <t size='1'font='Bitstream'align='left'color='#FF9900'>Murders:</t><t size='1'font='Bitstream'align='right'color='#FF9900'>%3</t><br/>
  529. <t size='1'font='Bitstream'align='left'color='#666666'>Bandits Killed:</t><t size='1'font='Bitstream'align='right'color='#666666'>%4</t><br/>
  530. <t size='1'font='Bitstream'align='left'color='#00CC33'>Survived:</t><t size='1'font='Bitstream'align='right'color='#00CC33'>%5 Days</t><br/>
  531. <t size='1'font='Bitstream'align='left'color='#FFFFFF'>FPS:</t><t size='1'font='Bitstream'align='right'color='#FFCC00'>%6</t><br/>
  532. <t size='1'font='Bitstream'align='left'color='#FFFFFF'>Time until restart:</t><t size='0.75'font='Bitstream'align='right' color='#FFCC00'>%7mins</t><br/>
  533. <t size='1'font='Bitstream'align='left'color='#FFFFFF'>Vehicles:</t><t size='0.80'font='Bitstream'align='right'color='#FFCC00'>%8</t><br/>
  534. <t size='1.5'font='Bitstream'align='center'color='#006600'>%9</t><br/>
  535. <t size='1'font='Bitstream'align='center' color='#104E8B' >Press F11 to toggle! </t><br/>
  536. <t size='1'font='Bitstream'align='center' color='#FF9900' >Press F9 for help! </t><br/>
  537.  
  538. ",r_player_blood,round _humanity,_killsH,_killsB,dayz_Survived,(_clientfps),(_tL),(count([6800, 9200, 0] nearEntities [["Car","Motorcycle","Tank","Air","Ship"],25000])),dayz_playerName];
  539. sleep 1;
  540. };
  541. };
  542.  
  543. [] spawn fnc_debug;
  544.  
  545. };
  546.  
  547. fnc_help = {
  548. hintsilent parseText format ["
  549.  
  550. <t size='1'font='Bitstream'align='left' color='#CC0000'>Welcome to W.I.C.K.E.D. PVP</t><br/>
  551. <t size='1'font='Bitstream'align='right' color='#CC0000'>Kill or Be Killed</t><br/><br/>
  552. <t size='1'font='Bitstream'align='left'>The Forts around the map are loot spawns. The Bandit Camp and Stronghold are defended by AI. AI missions are heavily defended! Bandit AI are patrolling the map. They will hunt and pursue you to the death. Be vigilant!</t><br/><br/>
  553. <t size='1'font='Bitstream'align='left'>RULES! No voice over side chat! Repeat offenders will be banned! There is zero tolerance for cheating. Keeping silent about cheating is the same as cheating!</t><br/><br/>
  554. <t size='1'font='Bitstream'align='left'>List of Addons. HALO Respawns. Deploy Bicycle. Self-BloodBag. AI Bandit Missions & Patrols. Always Day & Clear Skies/Low Fog. Improved Colors. Vehicle Salvaging. Auto Refuel. Remove Clothing. Cannibalize Corpses. Improved Loot Tables.</t><br/><br/>
  555. <t size='1'font='Bitstream'align='left' color='#FF9900'>F9-Help</t><t size='1'font='Bitstream' align='right' color='#104E8B'>F11-Debug Monitor</t>
  556.  
  557. ",getPlayerUID player,side player];
  558. };
  559. // uncomment this if you want it to display when the player first joins
  560. [] spawn fnc_help;
  561.  
  562.  
  563. progressLoadingScreen 0.8;
  564.  
  565. //Both
  566. BIS_fnc_selectRandom = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_selectRandom.sqf"; //Checks which actions for nearby casualty
  567. fnc_buildWeightedArray = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_buildWeightedArray.sqf"; //Checks which actions for nearby casualty
  568. zombie_initialize = compile preprocessFileLineNumbers "\z\addons\dayz_code\init\zombie_init.sqf";
  569. //object_vehicleKilled = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_vehicleKilled.sqf"; //Event handler run on damage
  570. 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
  571. object_setHit = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_setHit.sqf"; //process the hit as a NORMAL damage (useful for persistent vehicles)
  572. object_processHit = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_processHit.sqf"; //process the hit in the REVO damage system (records and sets hit)
  573. //object_delLocal = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_delLocal.sqf";
  574. //object_cargoCheck = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_cargoCheck.sqf"; //Run by the player or server to monitor changes in cargo contents
  575. fnc_usec_damageHandler = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_damageHandler.sqf"; //Event handler run on damage
  576. // Vehicle damage fix
  577. fnc_veh_handleDam = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\veh_handleDam.sqf";
  578. fnc_veh_handleKilled = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\veh_handleKilled.sqf";
  579. fnc_veh_handleRepair = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\veh_handleRepair.sqf"; //process the hit as a NORMAL damage (useful for persistent vehicles)
  580. fnc_veh_ResetEH = compile preprocessFileLineNumbers "\z\addons\dayz_code\init\veh_ResetEH.sqf"; //Initialize vehicle
  581. fnc_veh_setFixServer = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\veh_setFixServer.sqf"; //process the hit as a NORMAL damage (useful for persistent vehicles)
  582. fnc_inString = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_inString.sqf";
  583. fnc_isInsideBuilding = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_isInsideBuilding.sqf"; //_isInside = [_unit,_building] call fnc_isInsideBuilding;
  584. dayz_zombieSpeak = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_speak.sqf"; //Used to generate random speech for a unit
  585. vehicle_getHitpoints = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\vehicle_getHitpoints.sqf";
  586. local_gutObject = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\local_gutObject.sqf"; //Generated on the server (or local to unit) when gutting an object
  587. local_zombieDamage = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_damageHandlerZ.sqf"; //Generated by the client who created a zombie to track damage
  588. local_setFuel = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\local_setFuel.sqf"; //Generated when someone refuels a vehicle
  589. local_eventKill = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\local_eventKill.sqf"; //Generated when something is killed
  590. //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
  591. //curTimeStr = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_curTimeStr.sqf";
  592. player_medBandage = compile preprocessFileLineNumbers "\z\addons\dayz_code\medical\publicEH\medBandaged.sqf";
  593. player_medInject = compile preprocessFileLineNumbers "\z\addons\dayz_code\medical\publicEH\medInject.sqf";
  594. player_medEpi = compile preprocessFileLineNumbers "\z\addons\dayz_code\medical\publicEH\medEpi.sqf";
  595. player_medTransfuse = compile preprocessFileLineNumbers "\z\addons\dayz_code\medical\publicEH\medTransfuse.sqf";
  596. player_medMorphine = compile preprocessFileLineNumbers "\z\addons\dayz_code\medical\publicEH\medMorphine.sqf";
  597. player_medPainkiller = compile preprocessFileLineNumbers "\z\addons\dayz_code\medical\publicEH\medPainkiller.sqf";
  598. player_medAntiBiotics = compile preprocessFileLineNumbers "\z\addons\dayz_code\medical\publicEH\medAntibiotics.sqf";
  599. player_humanityChange = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_humanityChange.sqf";
  600. spawn_loot = compile preprocessFileLineNumbers "custom\spawn_loot.sqf";
  601. player_projectileNear = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_projectileNear.sqf";
  602.  
  603. call compile preprocessFileLineNumbers "\z\addons\dayz_code\traps\init.sqf";
  604.  
  605. player_sumMedical = {
  606. private["_character","_wounds","_legs","_arms","_medical", "_status"];
  607. _character = _this;
  608. _wounds = [];
  609. if (_character getVariable["USEC_injured",false]) then {
  610. {
  611. _status = _character getVariable["hit_"+_x,false];
  612. if ((typeName _status == "BOOLEAN") AND {(_status)}) then {
  613. _wounds set [count _wounds,_x];
  614. };
  615. } forEach USEC_typeOfWounds;
  616. };
  617. _legs = _character getVariable ["hit_legs",0];
  618. _arms = _character getVariable ["hit_arms",0];
  619. _medical = [
  620. _character getVariable["USEC_isDead",false],
  621. _character getVariable["NORRN_unconscious", false],
  622. _character getVariable["USEC_infected",false],
  623. _character getVariable["USEC_injured",false],
  624. _character getVariable["USEC_inPain",false],
  625. _character getVariable["USEC_isCardiac",false],
  626. _character getVariable["USEC_lowBlood",false],
  627. _character getVariable["USEC_BloodQty",12000],
  628. _wounds,
  629. [_legs,_arms],
  630. _character getVariable["unconsciousTime",0],
  631. _character getVariable["messing",[0,0]]
  632. ];
  633. _medical
  634. };
  635.  
  636. fn_niceSpot = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_niceSpot.sqf";
  637.  
  638. //Server Only
  639. if (isServer) then {
  640. call compile preprocessFileLineNumbers "\z\addons\dayz_server\init\server_functions.sqf";
  641. } else {
  642. eh_localCleanup = {};
  643. };
  644.  
  645. //Dynamic Weather Overwrite
  646. execVM "custom\DynamicWeatherEffects.sqf";
  647. initialized = true;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement