Advertisement
meanbeandk

compile.sqf

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