Advertisement
deejay1979

Untitled

Jun 4th, 2014
342
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 30.82 KB | None | 0 0
  1. /*
  2. FUNCTION COMPILES
  3. */
  4. //Player only
  5. if (!isDedicated) then {
  6.  
  7. "filmic" setToneMappingParams [0.07, 0.31, 0.23, 0.37, 0.011, 3.750, 6, 4]; setToneMapping "Filmic";
  8.  
  9. BIS_Effects_Burn = compile preprocessFile "\ca\Data\ParticleEffects\SCRIPTS\destruction\burn.sqf";
  10. player_zombieCheck = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_zombieCheck.sqf"; //Run on a players computer, checks if the player is near a zombie
  11. player_zombieAttack = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_zombieAttack.sqf"; //Run on a players computer, causes a nearby zombie to attack them
  12. fnc_usec_damageActions = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_damageActions.sqf"; //Checks which actions for nearby casualty
  13. fnc_inAngleSector = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_inAngleSector.sqf"; //Checks which actions for nearby casualty
  14. fnc_usec_selfActions = compile preprocessFileLineNumbers "custom\fn_selfActions.sqf"; //Checks which actions for self
  15. fnc_usec_unconscious = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_unconscious.sqf";
  16. player_temp_calculation = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_temperatur.sqf"; //Temperatur System //TeeChange
  17. player_weaponFiredNear = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_weaponFiredNear.sqf";
  18. player_animalCheck = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_animalCheck.sqf";
  19. player_spawnCheck = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_spawnCheck.sqf";
  20. player_dumpBackpack = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_dumpBackpack.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 "\z\addons\dayz_code\compile\building_spawnLoot.sqf";
  24. // player_taskHint = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_taskHint.sqf";
  25. building_spawnZombies = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\building_spawnZombies.sqf";
  26. dayz_spaceInterrupt = compile preprocessFileLineNumbers "fixes\dayz_code\actions\dayz_spaceInterrupt.sqf";
  27. //animal_monitor = compile preprocessFileLineNumbers "\z\addons\dayz_code\system\animal_monitor.sqf";
  28. // building_monitor = compile preprocessFileLineNumbers "\z\addons\dayz_code\system\building_monitor.sqf";
  29. 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
  30. player_harvest = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_harvest.sqf";
  31. player_packTent = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_packTent.sqf";
  32. player_packVault = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_packVault.sqf";
  33. player_unlockVault = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_unlockVault.sqf";
  34.  
  35. player_removeObject = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\remove.sqf";
  36. player_removeNet = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_removeNet.sqf";
  37. player_removeTankTrap = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_removeTankTrap.sqf";
  38.  
  39. player_unlockDoor = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_unlockDoor.sqf";
  40. player_changeCombo = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_changeCombo.sqf";
  41.  
  42. player_lockVault = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_lockVault.sqf";
  43. // control_zombieAgent = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\control_zombieAgent.sqf";
  44. player_updateGui = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_updateGui.sqf";
  45. player_crossbowBolt = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_crossbowBolt.sqf";
  46. //spawn_flies = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\spawn_flies.sqf";
  47. // stream_locationFill = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\stream_locationFill.sqf";
  48. // stream_locationDel = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\stream_locationDel.sqf";
  49. // stream_locationCheck = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\stream_locationCheck.sqf";
  50. player_music = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_music.sqf"; //Used to generate ambient music
  51. player_login = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_login.sqf"; //Used to generate ambient music
  52. player_death = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_death.sqf";
  53. player_switchModel = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_switchModel.sqf";
  54. player_checkStealth = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_checkStealth.sqf";
  55. world_sunRise = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_sunRise.sqf";
  56. world_surfaceNoise = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_surfaceNoise.sqf";
  57. player_humanityMorph = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_humanityMorph.sqf";
  58. player_throwObject = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_throwObject.sqf";
  59. player_alertZombies = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_alertZombies.sqf";
  60. player_fireMonitor = compile preprocessFileLineNumbers "\z\addons\dayz_code\system\fire_monitor.sqf";
  61. fn_gearMenuChecks = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_gearMenuChecks.sqf";
  62.  
  63. //Objects
  64. object_roadFlare = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_roadFlare.sqf";
  65. object_setpitchbank = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_setpitchbank.sqf";
  66. object_monitorGear = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_monitorGear.sqf";
  67.  
  68. local_roadDebris = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\local_roadDebris.sqf";
  69.  
  70. //Zombies
  71. zombie_findTargetAgent = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\zombie_findTargetAgent.sqf";
  72. zombie_loiter = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\zombie_loiter.sqf"; //Server compile, used for loiter behaviour
  73. zombie_generate = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\zombie_generate.sqf"; //Server compile, used for loiter behaviour
  74. wild_spawnZombies = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\wild_spawnZombies.sqf"; //Server compile, used for loiter behaviour
  75.  
  76. pz_attack = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\pzombie\pz_attack.sqf";
  77.  
  78. //
  79. dog_findTargetAgent = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\dog_findTargetAgent.sqf";
  80.  
  81. //actions
  82. player_countmagazines = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_countmagazines.sqf";
  83. player_addToolbelt = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_addToolbelt.sqf";
  84. player_copyKey = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_copyKey.sqf";
  85. player_reloadMag = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_reloadMags.sqf";
  86. player_loadCrate = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_loadCrate.sqf";
  87. player_craftItem = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_craftItem.sqf";
  88. player_tentPitch = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\tent_pitch.sqf";
  89. player_vaultPitch = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\vault_pitch.sqf";
  90. player_drink = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_drink.sqf";
  91. player_eat = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_eat.sqf";
  92. player_useMeds = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_useMeds.sqf";
  93. player_fillWater = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\water_fill.sqf";
  94. player_makeFire = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_makefire.sqf";
  95. //player_chopWood = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_chopWood.sqf";
  96. player_harvestPlant = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_harvestPlant.sqf";
  97. player_goFishing = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_goFishing.sqf";
  98. player_build = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_build.sqf";
  99. player_wearClothes = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_wearClothes.sqf";
  100. //player_dropWeapon = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_dropWeapon.sqf";
  101. //playerpip_setTrap = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_setTrap.sqf";
  102. object_pickup = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\object_pickup.sqf";
  103. player_flipvehicle = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_flipvehicle.sqf";
  104. player_sleep = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_sleep.sqf";
  105. //player_mineOre = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_mineOre.sqf";
  106. player_antiWall = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_antiWall.sqf";
  107. player_deathBoard = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\list_playerDeathsAlt.sqf";
  108.  
  109. player_plotPreview = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_showPlotRadius.sqf";
  110. player_upgradeVehicle = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_upgradeVehicle.sqf";
  111.  
  112. //ui
  113. player_selectSlot = compile preprocessFileLineNumbers "custom\ui_selectSlot.sqf";
  114. player_gearSync = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_gearSync.sqf";
  115. player_gearSet = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_gearSet.sqf";
  116. ui_changeDisplay = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\ui_changeDisplay.sqf";
  117. ui_gear_sound = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\ui_gear_sound.sqf";
  118.  
  119. //System
  120. player_monitor = compile preprocessFileLineNumbers "\z\addons\dayz_code\system\player_monitor.sqf";
  121. player_spawn_1 = compile preprocessFileLineNumbers "\z\addons\dayz_code\system\player_spawn_1.sqf";
  122. player_spawn_2 = compile preprocessFileLineNumbers "\z\addons\dayz_code\system\player_spawn_2.sqf";
  123. onPreloadStarted "dayz_preloadFinished = false;";
  124. onPreloadFinished "dayz_preloadFinished = true;";
  125.  
  126. // helper functions
  127. player_hasTools = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_hasTools.sqf";
  128. player_checkItems = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_checkItems.sqf";
  129. player_removeItems = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_removeItems.sqf";
  130. // combination of check and remove items
  131. player_checkAndRemoveItems = {
  132. private ["_items","_b"];
  133. _items = _this;
  134. _b = _items call player_checkItems;
  135. if (_b) then {
  136. _b = _items call player_removeItems;
  137. };
  138. _b
  139. };
  140.  
  141.  
  142. epoch_totalCurrency = {
  143. // total currency
  144. _total_currency = 0;
  145. {
  146. _part = (configFile >> "CfgMagazines" >> _x);
  147. _worth = (_part >> "worth");
  148. if isNumber (_worth) then {
  149. _total_currency = _total_currency + getNumber(_worth);
  150. };
  151. } forEach (magazines player);
  152. _total_currency
  153. };
  154.  
  155. epoch_itemCost = {
  156. _trade_total = 0;
  157. {
  158. _part_in_configClass = configFile >> "CfgMagazines" >> (_x select 0);
  159. if (isClass (_part_in_configClass)) then {
  160. _part_inWorth = (_part_in_configClass >> "worth");
  161. if isNumber (_part_inWorth) then {
  162. _trade_total = _trade_total + (getNumber(_part_inWorth) * (_x select 1));
  163. };
  164. };
  165. } forEach _this;
  166.  
  167. diag_log format["DEBUG TRADER ITEMCOST: %1", _this];
  168. _trade_total
  169. };
  170.  
  171. epoch_returnChange = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\epoch_returnChange.sqf";
  172. // usage [["partinclassname",4]] call epoch_returnChange;
  173.  
  174.  
  175.  
  176.  
  177. //
  178. RunTime = 0;
  179. TotalRuns = 0;
  180.  
  181. fnc_dump = {
  182. private["_code","_benchmark","_averageRunTime"];
  183. _code = _this select 0;
  184. _benchmark = _this select 1;
  185.  
  186. RunTime = RunTime + _benchmark;
  187. TotalRuns = TotalRuns + 1;
  188. _averageRunTime = RunTime/TotalRuns;
  189.  
  190. diag_log format["%1 - %2 (%3 / %4)",_code,_benchmark,_averageRunTime,TotalRuns];
  191. };
  192. dayz_losChance = {
  193. private["_agent","_maxDis","_dis","_val","_maxExp","_myExp"];
  194. _agent = _this select 0;
  195. _dis = _this select 1;
  196. _maxDis = _this select 2;
  197. // diag_log ("VAL: " + str(_this));
  198. _val = (_maxDis - _dis) max 0;
  199. _maxExp = ((exp 2) * _maxDis);
  200. _myExp = ((exp 2) * (_val)) / _maxExp;
  201. _myExp = _myExp * 0.7;
  202. _myExp
  203. };
  204.  
  205. ui_initDisplay = {
  206. private["_control","_ctrlBleed","_display","_ctrlFracture","_ctrlDogFood","_ctrlDogWater","_ctrlDogWaterBorder", "_ctrlDogFoodBorder"];
  207. disableSerialization;
  208. _display = uiNamespace getVariable 'DAYZ_GUI_display';
  209. _control = _display displayCtrl 1204;
  210. _control ctrlShow false;
  211. if (!r_player_injured) then {
  212. _ctrlBleed = _display displayCtrl 1303;
  213. _ctrlBleed ctrlShow false;
  214. };
  215. if (!r_fracture_legs and !r_fracture_arms) then {
  216. _ctrlFracture = _display displayCtrl 1203;
  217. _ctrlFracture ctrlShow false;
  218. };
  219. _ctrlDogFoodBorder = _display displayCtrl 1501;
  220. _ctrlDogFoodBorder ctrlShow false;
  221. _ctrlDogFood = _display displayCtrl 1701;
  222. _ctrlDogFood ctrlShow false;
  223.  
  224. _ctrlDogWaterBorder = _display displayCtrl 1502;
  225. _ctrlDogWaterBorder ctrlShow false;
  226. _ctrlDogWater = _display displayCtrl 1702;
  227. _ctrlDogWater ctrlShow false
  228. };
  229.  
  230. dayz_losCheck = {
  231. private["_target","_agent","_cantSee"];
  232. _target = _this select 0; // PUT THE PLAYER IN FIRST ARGUMENT!!!!
  233. _agent = _this select 1;
  234. _cantSee = true;
  235. if (!isNull _target) then {
  236.  
  237. _tPos = visiblePositionASL _target;
  238. _zPos = visiblePositionASL _agent;
  239.  
  240. _tPos set [2,(_tPos select 2)+1];
  241. _zPos set [2,(_zPos select 2)+1];
  242.  
  243. if ((count _tPos > 0) and (count _zPos > 0)) then {
  244. _cantSee = terrainIntersectASL [_tPos, _zPos];
  245. if (!_cantSee) then {
  246. _cantSee = lineIntersects [_tPos, _zPos, _agent, vehicle _target];
  247. };
  248. };
  249. };
  250. _cantSee
  251. };
  252.  
  253. eh_zombieInit = {
  254. private["_unit","_pos"];
  255. //_unit = _this select 0;
  256. //_pos = getPosATL _unit;
  257. //_id = [_pos,_unit] execFSM "\z\AddOns\dayz_code\system\zombie_agent.fsm";
  258. };
  259.  
  260. dayz_equipCheck = {
  261. private ["_empty", "_needed","_diff","_success"];
  262. _config = _this;
  263. _empty = [player] call BIS_fnc_invSlotsEmpty;
  264. _needed = [_config] call BIS_fnc_invSlotType;
  265. _diff = [_empty,_needed] call BIS_fnc_vectorDiff;
  266.  
  267. _success = true;
  268. {
  269. if (_x > 0) then {_success = false};
  270. } forEach _diff;
  271. hint format["Config: %5\nEmpty: %1\nNeeded: %2\nDiff: %3\nSuccess: %4",_empty,_needed,_diff,_success,_config];
  272. _success
  273. };
  274.  
  275. vehicle_gear_count = {
  276. private["_counter"];
  277. _counter = 0;
  278. {
  279. _counter = _counter + _x;
  280. } forEach _this;
  281. _counter
  282. };
  283.  
  284. player_tagFriendlyMsg = {
  285. if(player == (_this select 0)) then {
  286. cutText[(localize "str_epoch_player_2"),"PLAIN DOWN"];
  287. };
  288. };
  289.  
  290. player_serverModelChange = {
  291. private["_object","_model"];
  292. _object = _this select 0;
  293. _model = _this select 1;
  294. if (_object == player) then {
  295. _model call player_switchModel;
  296. };
  297. };
  298.  
  299. player_guiControlFlash = {
  300. private["_control"];
  301. _control = _this;
  302. if (ctrlShown _control) then {
  303. _control ctrlShow false;
  304. } else {
  305. _control ctrlShow true;
  306. };
  307. };
  308.  
  309. gear_ui_offMenu = {
  310. private["_control","_parent","_menu"];
  311. disableSerialization;
  312. _control = _this select 0;
  313. _parent = findDisplay 106;
  314. if (!(_this select 3)) then {
  315. for "_i" from 0 to 9 do {
  316. _menu = _parent displayCtrl (1600 + _i);
  317. _menu ctrlShow false;
  318. };
  319. _grpPos = ctrlPosition _control;
  320. _grpPos set [3,0];
  321. _control ctrlSetPosition _grpPos;
  322. _control ctrlShow false;
  323. _control ctrlCommit 0;
  324. };
  325. };
  326.  
  327. dze_surrender_off = {
  328. player setVariable ["DZE_Surrendered", false, true];
  329. DZE_Surrender = false;
  330. };
  331.  
  332. gear_ui_init = {
  333. private["_control","_parent","_menu","_dspl","_grpPos"];
  334. disableSerialization;
  335. _parent = findDisplay 106;
  336. _control = _parent displayCtrl 6902;
  337. for "_i" from 0 to 9 do {
  338. _menu = _parent displayCtrl (1600 + _i);
  339. _menu ctrlShow false;
  340. };
  341. _grpPos = ctrlPosition _control;
  342. _grpPos set [3,0];
  343. _control ctrlSetPosition _grpPos;
  344. _control ctrlShow false;
  345. _control ctrlCommit 0;
  346. };
  347.  
  348. dayz_eyeDir = {
  349. private["_vval","_vdir"];
  350. _vval = (eyeDirection _this);
  351. _vdir = (_vval select 0) atan2 (_vval select 1);
  352. if (_vdir < 0) then {_vdir = 360 + _vdir};
  353. _vdir
  354. };
  355.  
  356. DZE_getModelName = {
  357. _objInfo = toArray(str(_this));
  358. _lenInfo = count _objInfo - 1;
  359. _objName = [];
  360. _i = 0;
  361. // determine where the object name starts
  362. {
  363. if (58 == _objInfo select _i) exitWith {};
  364. _i = _i + 1;
  365. } forEach _objInfo;
  366. _i = _i + 2; // skip the ": " part
  367. for "_k" from _i to _lenInfo do {
  368. _objName = _objName + [_objInfo select _k];
  369. };
  370. _objName = toLower(toString(_objName));
  371. _objName
  372. };
  373.  
  374. dze_isnearest_player = {
  375. private ["_notClosest","_playerDistance","_nearPlayers","_obj","_playerNear"];
  376. if(!isNull _this) then {
  377. _nearPlayers = _this nearEntities ["CAManBase", 12];
  378. _playerNear = ({isPlayer _x} count _nearPlayers) > 1;
  379. _notClosest = false;
  380. if (_playerNear) then {
  381. // check if another player is closer
  382. _playerDistance = player distance _this;
  383. {
  384. if (_playerDistance > (_x distance _this)) exitWith { _notClosest = true; };
  385. } forEach _nearPlayers;
  386. };
  387. } else {
  388. _notClosest = false;
  389. };
  390. _notClosest
  391. };
  392.  
  393. // trader menu code
  394. if (DZE_ConfigTrader) then {
  395. call compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_traderMenuConfig.sqf";
  396. }else{
  397. call compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_traderMenuHive.sqf";
  398. };
  399. // recent murders menu code
  400. call compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_murderMenu.sqf";
  401.  
  402. //This is still needed but the fsm should terminate if any errors pop up.
  403. [] spawn {
  404. private["_timeOut","_display","_control1","_control2"];
  405. disableSerialization;
  406. _timeOut = 0;
  407. dayz_loadScreenMsg = "";
  408. diag_log "DEBUG: loadscreen guard started.";
  409. _display = uiNameSpace getVariable "BIS_loadingScreen";
  410. if (!isNil "_display") then {
  411. _control1 = _display displayctrl 8400;
  412. _control2 = _display displayctrl 102;
  413. };
  414. if (!isNil "dayz_DisplayGenderSelect") then {
  415. waitUntil {!dayz_DisplayGenderSelect};
  416. };
  417.  
  418. // 120 sec timeout (12000 * 0.01)
  419. while { _timeOut < 12000 } do {
  420. if (dayz_clientPreload && dayz_authed) exitWith { diag_log "PLOGIN: Login loop completed!"; };
  421. if (!isNil "_display") then {
  422. if ( isNull _display ) then {
  423. waitUntil { !dialog; };
  424. startLoadingScreen ["","RscDisplayLoadCustom"];
  425. _display = uiNameSpace getVariable "BIS_loadingScreen";
  426. _control1 = _display displayctrl 8400;
  427. _control2 = _display displayctrl 102;
  428. };
  429.  
  430. if ( dayz_loadScreenMsg != "" ) then {
  431. _control1 ctrlSetText dayz_loadScreenMsg;
  432. dayz_loadScreenMsg = "";
  433. };
  434.  
  435. _control2 ctrlSetText format["%1",round(_timeOut*0.01)];
  436. };
  437.  
  438. _timeOut = _timeOut + 1;
  439.  
  440. if (_timeOut >= 12000) then {
  441. 1 cutText [localize "str_player_login_timeout", "PLAIN DOWN"];
  442. sleep 10;
  443. endLoadingScreen;
  444. endMission "END1";
  445. };
  446.  
  447. sleep 0.01;
  448. };
  449. };
  450.  
  451. dayz_meleeMagazineCheck = {
  452. private["_meleeNum","_magType"];
  453. _magType = ([] + getArray (configFile >> "CfgWeapons" >> _wpnType >> "magazines")) select 0;
  454. _meleeNum = ({_x == _magType} count magazines player);
  455. if (_meleeNum < 1) then {
  456. player addMagazine _magType;
  457. };
  458. };
  459.  
  460. dayz_originalPlayer = player;
  461.  
  462. progressLoadingScreen 0.8;
  463. };
  464.  
  465. //Both
  466. BIS_fnc_selectRandom = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\BIS_fnc\fn_selectRandom.sqf";
  467. BIS_fnc_vectorAdd = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\BIS_fnc\fn_vectorAdd.sqf";
  468. BIS_fnc_halo = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\BIS_fnc\fn_halo.sqf";
  469. BIS_fnc_findNestedElement = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\BIS_fnc\fn_findNestedElement.sqf";
  470. BIS_fnc_param = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\BIS_fnc\fn_param.sqf";
  471.  
  472. fnc_buildWeightedArray = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_buildWeightedArray.sqf"; //Checks which actions for nearby casualty
  473. fnc_usec_damageVehicle = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_damageHandlerVehicle.sqf"; //Event handler run on damage
  474. zombie_initialize = compile preprocessFileLineNumbers "\z\addons\dayz_code\init\zombie_init.sqf";
  475. // object_vehicleKilled = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_vehicleKilled.sqf"; //Event handler run on damage
  476. object_setHitServer = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_setHitServer.sqf"; //process the hit as a NORMAL damage (useful for persistent vehicles)
  477. object_setFixServer = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_setFixServer.sqf"; //process the hit as a NORMAL damage (useful for persistent vehicles)
  478. 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
  479. object_setHit = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_setHit.sqf"; //process the hit as a NORMAL damage (useful for persistent vehicles)
  480. object_processHit = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_processHit.sqf"; //process the hit in the REVO damage system (records and sets hit)
  481. object_delLocal = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_delLocal.sqf";
  482. // object_cargoCheck = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_cargoCheck.sqf"; //Run by the player or server to monitor changes in cargo contents
  483. fnc_usec_damageHandler = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_damageHandler.sqf"; //Event handler run on damage
  484. fnc_veh_ResetEH = compile preprocessFileLineNumbers "\z\addons\dayz_code\init\veh_ResetEH.sqf"; //Initialize vehicle
  485. // Vehicle damage fix
  486. vehicle_handleDamage = compile preprocessFileLineNumbers "custom\vehicle_handleDamage.sqf";
  487. vehicle_handleKilled = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\vehicle_handleKilled.sqf";
  488. //fnc_vehicleEventHandler = compile preprocessFileLineNumbers "\z\addons\dayz_code\init\vehicle_init.sqf"; //Initialize vehicle
  489. fnc_inString = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_inString.sqf";
  490. fnc_isInsideBuilding = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_isInsideBuilding.sqf"; //_isInside = [_unit,_building] call fnc_isInsideBuilding;
  491. fnc_isInsideBuilding2 = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_isInsideBuilding2.sqf"; //_isInside = [_unit,_building] call fnc_isInsideBuilding;
  492. fnc_isInsideBuilding3 = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_isInsideBuilding3.sqf"; //_isInside = [_unit,_building] call fnc_isInsideBuilding;
  493. dayz_zombieSpeak = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_speak.sqf"; //Used to generate random speech for a unit
  494. vehicle_getHitpoints = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\vehicle_getHitpoints.sqf";
  495. local_gutObject = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\local_gutObject.sqf"; //Generated on the server (or local to unit) when gutting an object
  496. local_lockUnlock = compile preprocessFileLineNumbers "Custom\local_lockUnlock.sqf"; //When vehicle is local to unit perform locking vehicle
  497. local_gutObjectZ = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\local_gutObjectZ.sqf"; //Generated on the server (or local to unit) when gutting an object
  498. local_zombieDamage = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_damageHandlerZ.sqf"; //Generated by the client who created a zombie to track damage
  499. local_setFuel = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\local_setFuel.sqf"; //Generated when someone refuels a vehicle
  500. local_eventKill = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\local_eventKill.sqf"; //Generated when something is killed
  501. //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
  502. curTimeStr = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_curTimeStr.sqf";
  503. player_medBandage = compile preprocessFileLineNumbers "\z\addons\dayz_code\medical\publicEH\medBandaged.sqf";
  504. player_medInject = compile preprocessFileLineNumbers "\z\addons\dayz_code\medical\publicEH\medInject.sqf";
  505. player_medEpi = compile preprocessFileLineNumbers "\z\addons\dayz_code\medical\publicEH\medEpi.sqf";
  506. player_medTransfuse = compile preprocessFileLineNumbers "\z\addons\dayz_code\medical\publicEH\medTransfuse.sqf";
  507. player_medMorphine = compile preprocessFileLineNumbers "\z\addons\dayz_code\medical\publicEH\medMorphine.sqf";
  508. player_breaklegs = compile preprocessFileLineNumbers "\z\addons\dayz_code\medical\publicEH\medBreakLegs.sqf";
  509. player_medPainkiller = compile preprocessFileLineNumbers "\z\addons\dayz_code\medical\publicEH\medPainkiller.sqf";
  510. world_isDay = {if ((daytime < (24 - dayz_sunRise)) and (daytime > dayz_sunRise)) then {true} else {false}};
  511. player_humanityChange = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_humanityChange.sqf";
  512. spawn_loot = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\spawn_loot.sqf";
  513. spawn_loot_small = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\spawn_loot_small.sqf";
  514. // player_projectileNear = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_projectileNear.sqf";
  515.  
  516. dayz_HungerThirst = {
  517. dayz_hunger = dayz_hunger + (_this select 0);
  518. dayz_thirst = dayz_thirst + (_this select 1);
  519. };
  520.  
  521. // better item counting by maca134 - https://github.com/vbawol/DayZ-Epoch/issues/916
  522. MC_item_spaces = {
  523. private ["_unit", "_item", "_slotsEmpty", "_slotsItem", "_slotsAfterAdd", "_c", "_space"];
  524. _unit = _this select 0;
  525. _item = _this select 1;
  526.  
  527. _slotsEmpty = [_unit] call BIS_fnc_invSlotsEmpty;
  528. _slotsItem = [_item] call BIS_fnc_invSlotType;
  529. if ((typeName _unit) != "OBJECT") exitWith {textLogFormat ["INV_ Error: BIS_FNC_invAdd - 1st parameter must be unit! %1", _this];false};
  530. if (((typeName _item) != "CONFIG") && ((typeName _item) != "STRING")) exitWith {textLogFormat ["INV_ Error: BIS_FNC_invAdd - 2nd parameter must be config|string|array of (config|string)! %1", _this];false};
  531. if (isNil {_item}) exitWith {textLogFormat ["INV_ Error: BIS_FNC_invAdd - 2nd parameter - _item is undefined! %1", _this];false};
  532. _c = 0;
  533. _space = 0;
  534. {
  535. if (_x > 0) exitWith {
  536. _space = floor((_slotsEmpty select _c) / _x);
  537. };
  538. _c = _c + 1;
  539. } forEach _slotsItem;
  540. _space
  541. };
  542.  
  543. dayz_EjectPlayer = {
  544. // check if player in vehicle
  545. private ["_noDriver","_vehicle","_inVehicle"];
  546. _vehicle = vehicle player;
  547. _inVehicle = (_vehicle != player);
  548. if(_inVehicle) then {
  549. _noDriver = ((_vehicle emptyPositions "driver") > 0);
  550. if (_noDriver and (speed _vehicle) != 0) then {
  551. player action [ "eject", _vehicle];
  552. };
  553. };
  554. };
  555.  
  556. player_sumMedical = {
  557. private["_character","_wounds","_legs","_arms","_medical"];
  558. _character = _this;
  559. _wounds = [];
  560. if (_character getVariable["USEC_injured",false]) then {
  561. {
  562. if (_character getVariable[_x,false]) then {
  563. _wounds set [count _wounds,_x];
  564. };
  565. } forEach USEC_typeOfWounds;
  566. };
  567. _legs = _character getVariable ["hit_legs",0];
  568. _arms = _character getVariable ["hit_arms",0];
  569. _medical = [
  570. _character getVariable["USEC_isDead",false],
  571. _character getVariable["NORRN_unconscious", false],
  572. _character getVariable["USEC_infected",false],
  573. _character getVariable["USEC_injured",false],
  574. _character getVariable["USEC_inPain",false],
  575. _character getVariable["USEC_isCardiac",false],
  576. _character getVariable["USEC_lowBlood",false],
  577. _character getVariable["USEC_BloodQty",12000],
  578. _wounds,
  579. [_legs,_arms],
  580. _character getVariable["unconsciousTime",0],
  581. _character getVariable["messing",[0,0]]
  582. ];
  583. _medical
  584. };
  585.  
  586. //Server Only
  587. if (isServer) then {
  588. call compile preprocessFileLineNumbers "\z\addons\dayz_server\init\server_functions.sqf";
  589. } else {
  590. eh_localCleanup = {};
  591. };
  592.  
  593. initialized = true;
  594.  
  595. if (!isDedicated) then {
  596. player_build = compile preprocessFileLineNumbers "custom\snap_build\player_build.sqf";
  597. player_buildControls = compile preprocessFileLineNumbers "custom\snap_build\player_buildControls.sqf";
  598. snap_object = compile preprocessFileLineNumbers "custom\snap_build\snap_object.sqf";
  599. };
  600.  
  601. vehicle_handleDamage = compile preprocessFileLineNumbers "custom\vehicle_handleDamage.sqf";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement