Advertisement
Guest User

custom compiles

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