SHARE
TWEET

Compiles.sqf

a guest Dec 16th, 2013 1,500 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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 "\z\addons\dayz_code\compile\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 "\z\addons\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.         // Vehicle damage fix
  82.         vehicle_handleDamage    =               compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\vehicle_handleDamage.sqf";
  83.         vehicle_handleKilled    =               compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\vehicle_handleKilled.sqf";
  84.  
  85.         //actions
  86.         player_countmagazines =                 compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_countmagazines.sqf";
  87.         player_addToolbelt =                    compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_addToolbelt.sqf";
  88.         player_copyKey =                        compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_copyKey.sqf";
  89.         player_reloadMag =                      compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_reloadMags.sqf";
  90.         player_loadCrate =                      compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_loadCrate.sqf";
  91.         player_craftItem =                      compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_craftItem.sqf";
  92.         player_tentPitch =                      compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\tent_pitch.sqf";
  93.         player_vaultPitch =                     compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\vault_pitch.sqf";
  94.         player_drink =                          compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_drink.sqf";
  95.         player_eat =                            compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_eat.sqf";
  96.         player_useMeds =                        compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_useMeds.sqf";
  97.         player_fillWater =                      compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\water_fill.sqf";
  98.         player_makeFire =                       compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_makefire.sqf";
  99.         //player_chopWood =                     compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_chopWood.sqf";
  100.         player_harvestPlant =                   compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_harvestPlant.sqf";
  101.         player_goFishing =                      compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_goFishing.sqf";
  102.         player_build =                          compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_build.sqf";
  103.         player_wearClothes =                    compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_wearClothes.sqf";
  104.         //player_dropWeapon =                   compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_dropWeapon.sqf";
  105.         //playerpip_setTrap =                   compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_setTrap.sqf";
  106.         object_pickup =                         compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\object_pickup.sqf";
  107.         player_flipvehicle =                    compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_flipvehicle.sqf";
  108.         player_sleep =                          compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_sleep.sqf";
  109.         //player_mineOre =                      compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_mineOre.sqf";
  110.         player_antiWall =                       compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_antiWall.sqf";
  111.         player_deathBoard =                     compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\list_playerDeathsAlt.sqf";
  112.        
  113.         player_upgradeVehicle =                 compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_upgradeVehicle.sqf";
  114.        
  115.         //ui
  116.         player_selectSlot =                     compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\ui_selectSlot.sqf";
  117.         player_gearSync =                       compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_gearSync.sqf";
  118.         player_gearSet  =                       compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_gearSet.sqf";
  119.         ui_changeDisplay =                      compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\ui_changeDisplay.sqf";
  120.         ui_gear_sound =                         compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\ui_gear_sound.sqf";
  121.        
  122.         //System
  123.         player_monitor =                        compile preprocessFileLineNumbers "\z\addons\dayz_code\system\player_monitor.sqf";
  124.         player_spawn_1 =                        compile preprocessFileLineNumbers "\z\addons\dayz_code\system\player_spawn_1.sqf";
  125.         player_spawn_2 =                        compile preprocessFileLineNumbers "\z\addons\dayz_code\system\player_spawn_2.sqf";
  126.         onPreloadStarted                        "dayz_preloadFinished = false;";
  127.         onPreloadFinished                       "dayz_preloadFinished = true;";
  128.        
  129.  
  130.          
  131.  
  132.         //
  133.         RunTime = 0;
  134.         TotalRuns = 0;
  135.        
  136.         fnc_dump = {
  137.                 private["_code","_benchmark","_averageRunTime"];
  138.                 _code = _this select 0;
  139.                 _benchmark = _this select 1;
  140.                
  141.                 RunTime = RunTime + _benchmark;
  142.                 TotalRuns = TotalRuns + 1;
  143.                 _averageRunTime = RunTime/TotalRuns;
  144.  
  145.                 diag_log format["%1 - %2 (%3 / %4)",_code,_benchmark,_averageRunTime,TotalRuns];
  146.         };
  147.         dayz_losChance = {
  148.                 private["_agent","_maxDis","_dis","_val","_maxExp","_myExp"];
  149.                 _agent =        _this select 0;
  150.                 _dis =          _this select 1;
  151.                 _maxDis =       _this select 2;
  152.                 // diag_log ("VAL:  " + str(_this));
  153.                 _val =          (_maxDis - _dis) max 0;
  154.                 _maxExp =       ((exp 2) * _maxDis);
  155.                 _myExp =        ((exp 2) * (_val)) / _maxExp;
  156.                 _myExp = _myExp * 0.7;
  157.                 _myExp
  158.         };
  159.        
  160.         ui_initDisplay = {
  161.                 private["_control","_ctrlBleed","_display","_ctrlFracture","_ctrlDogFood","_ctrlDogWater","_ctrlDogWaterBorder", "_ctrlDogFoodBorder"];
  162.                 disableSerialization;
  163.                 _display = uiNamespace getVariable 'DAYZ_GUI_display';
  164.                 _control =      _display displayCtrl 1204;
  165.                 _control ctrlShow false;
  166.                 if (!r_player_injured) then {
  167.                         _ctrlBleed =    _display displayCtrl 1303;
  168.                         _ctrlBleed ctrlShow false;
  169.                 };
  170.                 if (!r_fracture_legs and !r_fracture_arms) then {
  171.                         _ctrlFracture =         _display displayCtrl 1203;
  172.                         _ctrlFracture ctrlShow false;
  173.                 };
  174.                 _ctrlDogFoodBorder = _display displayCtrl 1501;
  175.                 _ctrlDogFoodBorder ctrlShow false;
  176.                 _ctrlDogFood = _display displayCtrl 1701;
  177.                 _ctrlDogFood ctrlShow false;
  178.                
  179.                 _ctrlDogWaterBorder = _display displayCtrl 1502;
  180.                 _ctrlDogWaterBorder ctrlShow false;
  181.                 _ctrlDogWater = _display displayCtrl 1702;
  182.                 _ctrlDogWater ctrlShow false
  183.         };
  184.        
  185.         dayz_losCheck = {
  186.                 private["_target","_agent","_cantSee"];
  187.                 _target = _this select 0; // PUT THE PLAYER IN FIRST ARGUMENT!!!!
  188.                 _agent = _this select 1;
  189.                 _cantSee = true;
  190.                 if (!isNull _target) then {
  191.                        
  192.                         _tPos = visiblePositionASL _target;
  193.                         _zPos = visiblePositionASL _agent;
  194.                        
  195.                         _tPos set [2,(_tPos select 2)+1];
  196.                         _zPos set [2,(_zPos select 2)+1];
  197.  
  198.                         if ((count _tPos > 0) and (count _zPos > 0)) then {
  199.                                 _cantSee = terrainIntersectASL [_tPos, _zPos];
  200.                                 if (!_cantSee) then {
  201.                                         _cantSee = lineIntersects [_tPos, _zPos, _agent, vehicle _target];
  202.                                 };
  203.                         };
  204.                 };
  205.                 _cantSee
  206.         };
  207.        
  208.         eh_zombieInit =         {
  209.                 private["_unit","_pos"];
  210.                 //_unit =       _this select 0;
  211.                 //_pos =                getPosATL _unit;
  212.                 //_id = [_pos,_unit] execFSM "\z\AddOns\dayz_code\system\zombie_agent.fsm";
  213.         };
  214.        
  215.         dayz_equipCheck = {
  216.                 private ["_empty", "_needed","_diff","_success"];
  217.                 _config = _this;
  218.                 _empty = [player] call BIS_fnc_invSlotsEmpty;
  219.                 _needed = [_config] call BIS_fnc_invSlotType;
  220.                 _diff = [_empty,_needed] call BIS_fnc_vectorDiff;
  221.                
  222.                 _success = true;
  223.                 {
  224.                         if (_x > 0) then {_success = false};
  225.                 } forEach _diff;
  226.                 hint format["Config: %5\nEmpty: %1\nNeeded: %2\nDiff: %3\nSuccess: %4",_empty,_needed,_diff,_success,_config];
  227.                 _success
  228.         };
  229.  
  230.         vehicle_gear_count = {
  231.                 private["_counter"];
  232.                 _counter = 0;
  233.                 {
  234.                         _counter = _counter + _x;
  235.                 } forEach _this;
  236.                 _counter
  237.         };
  238.  
  239.         player_tagFriendlyMsg = {
  240.                 if(player == _this) then {
  241.                         cutText[(localize "str_epoch_player_2"),"PLAIN DOWN"];
  242.                 };
  243.         };
  244.  
  245.         player_serverModelChange = {
  246.                 private["_object","_model"];
  247.                 _object = _this select 0;
  248.                 _model = _this select 1;
  249.                 if (_object == player) then {
  250.                         _model call player_switchModel;
  251.                 };
  252.         };
  253.        
  254.         player_guiControlFlash =        {
  255.                 private["_control"];
  256.                 _control = _this;
  257.                 if (ctrlShown _control) then {
  258.                         _control ctrlShow false;
  259.                 } else {
  260.                         _control ctrlShow true;
  261.                 };
  262.         };
  263.        
  264.         gear_ui_offMenu = {
  265.                 private["_control","_parent","_menu"];
  266.                 disableSerialization;
  267.                 _control =      _this select 0;
  268.                 _parent =       findDisplay 106;
  269.                 if (!(_this select 3)) then {
  270.                         for "_i" from 0 to 9 do {
  271.                                 _menu = _parent displayCtrl (1600 + _i);
  272.                                 _menu ctrlShow false;
  273.                         };
  274.                         _grpPos = ctrlPosition _control;
  275.                         _grpPos set [3,0];
  276.                         _control ctrlSetPosition _grpPos;
  277.                         _control ctrlShow false;
  278.                         _control ctrlCommit 0;
  279.                 };
  280.         };
  281.        
  282.         dze_surrender_off = {
  283.                 player setVariable ["DZE_Surrendered", false, true];
  284.                 DZE_Surrender = false; 
  285.         };
  286.  
  287.         gear_ui_init = {
  288.                 private["_control","_parent","_menu","_dspl","_grpPos"];
  289.                 disableSerialization;
  290.                 _parent = findDisplay 106;
  291.                 _control =      _parent displayCtrl 6902;
  292.                 for "_i" from 0 to 9 do {
  293.                         _menu = _parent displayCtrl (1600 + _i);
  294.                         _menu ctrlShow false;
  295.                 };
  296.                 _grpPos = ctrlPosition _control;
  297.                 _grpPos set [3,0];
  298.                 _control ctrlSetPosition _grpPos;
  299.                 _control ctrlShow false;
  300.                 _control ctrlCommit 0;
  301.         };
  302.        
  303.         dayz_eyeDir = {
  304.                 private["_vval","_vdir"];
  305.                 _vval = (eyeDirection _this);
  306.                 _vdir = (_vval select 0) atan2 (_vval select 1);
  307.                 if (_vdir < 0) then {_vdir = 360 + _vdir};
  308.                 _vdir
  309.         };
  310.  
  311.         DZE_getModelName = {
  312.                 _objInfo = toArray(str(_this));
  313.                 _lenInfo = count _objInfo - 1;
  314.                 _objName = [];
  315.                 _i = 0;
  316.                 // determine where the object name starts
  317.                 {
  318.                         if (58 == _objInfo select _i) exitWith {};
  319.                         _i = _i + 1;
  320.                 } forEach _objInfo;
  321.                 _i = _i + 2; // skip the ": " part
  322.                 for "_k" from _i to _lenInfo do {
  323.                         _objName = _objName + [_objInfo select _k];
  324.                 };
  325.                 _objName = toLower(toString(_objName));
  326.                 _objName
  327.         };
  328.  
  329.         dze_isnearest_player = {
  330.                 private ["_notClosest","_playerDistance","_nearPlayers","_obj","_playerNear"];
  331.                 if(!isNull _this) then {
  332.                         _nearPlayers = _this nearEntities ["CAManBase", 12];
  333.                         _playerNear = ({isPlayer _x} count _nearPlayers) > 1;
  334.                         _notClosest = false;
  335.                         if (_playerNear) then {
  336.                                 // check if another player is closer
  337.                                 _playerDistance = player distance _this;
  338.                                 {
  339.                                         if (_playerDistance > (_x distance _this)) exitWith { _notClosest = true; };
  340.                                 } forEach _nearPlayers;
  341.                         };
  342.                 } else {
  343.                         _notClosest = false;
  344.                 };
  345.                 _notClosest
  346.         };
  347.                
  348.         // trader menu code
  349.         call compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_traderMenu.sqf";
  350.        
  351.         // recent murders menu code
  352.         call compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_murderMenu.sqf";
  353.  
  354.         //This is still needed but the fsm should terminate if any errors pop up.
  355.         [] spawn {
  356.         private["_timeOut","_display","_control1","_control2"];
  357.         disableSerialization;
  358.         _timeOut = 0;
  359.         dayz_loadScreenMsg = "";
  360.         diag_log "DEBUG: loadscreen guard started.";
  361.         _display = uiNameSpace getVariable "BIS_loadingScreen";
  362.         if (!isNil "_display") then {
  363.                 _control1 = _display displayctrl 8400;
  364.                 _control2 = _display displayctrl 102;
  365.         };
  366.                
  367.         waitUntil {!dayz_DisplayGenderSelect};
  368.                
  369.         // 120 sec timeout (12000 * 0.01)
  370.         while { _timeOut < 12000 } do {
  371.             if (dayz_clientPreload && dayz_authed) exitWith { diag_log "PLOGIN: Login loop completed!"; };
  372.             if (!isNil "_display") then {
  373.                 if ( isNull _display ) then {                        
  374.                         waitUntil { !dialog; };                                
  375.                         startLoadingScreen ["","RscDisplayLoadCustom"];
  376.                         _display = uiNameSpace getVariable "BIS_loadingScreen";
  377.                         _control1 = _display displayctrl 8400;
  378.                         _control2 = _display displayctrl 102;
  379.                 };
  380.  
  381.                 if ( dayz_loadScreenMsg != "" ) then {
  382.                         _control1 ctrlSetText dayz_loadScreenMsg;
  383.                         dayz_loadScreenMsg = "";
  384.                 };
  385.  
  386.                 _control2 ctrlSetText format["%1",round(_timeOut*0.01)];
  387.             };
  388.  
  389.             _timeOut = _timeOut + 1;
  390.  
  391.             if (_timeOut >= 12000) then {
  392.                 1 cutText [localize "str_player_login_timeout", "PLAIN DOWN"];
  393.                 sleep 10;
  394.                 endLoadingScreen;
  395.                 endMission "END1";
  396.             };
  397.  
  398.             sleep 0.01;
  399.         };
  400.         };
  401.  
  402.         // TODO: need move it in player_monitor.fsm
  403.         // allow player disconnect from server, if loading hang, kicked by BE etc.
  404.         [] spawn {
  405.                 private["_timeOut","_display","_control1","_control2"];
  406.                 disableSerialization;
  407.                 _timeOut = 0;
  408.                 dayz_loadScreenMsg = "";
  409.                 diag_log "DEBUG: loadscreen guard started.";
  410.                 _display = uiNameSpace getVariable "BIS_loadingScreen";
  411.                 _control1 = _display displayctrl 8400;
  412.                 _control2 = _display displayctrl 102;
  413.                 // 120 sec timeout
  414.                 while { _timeOut < 3000 && !dayz_clientPreload && !dayz_authed } do {
  415.  
  416.                         if ( isNull _display ) then {
  417.                                 waitUntil { !dialog; };
  418.                                 startLoadingScreen ["","RscDisplayLoadCustom"];
  419.                                 _display = uiNameSpace getVariable "BIS_loadingScreen";
  420.                                 _control1 = _display displayctrl 8400;
  421.                                 _control2 = _display displayctrl 102;
  422.                         };
  423.  
  424.                         if ( dayz_loadScreenMsg != "" ) then {
  425.                                 _control1 ctrlSetText dayz_loadScreenMsg;
  426.                                 dayz_loadScreenMsg = "";
  427.                         };
  428.                         _control2 ctrlSetText format["%1",round(_timeOut*0.01)];
  429.                         _timeOut = _timeOut + 1;
  430.                         sleep 0.01;
  431.                 };
  432.                 endLoadingScreen;
  433.         };
  434.  
  435.         dayz_meleeMagazineCheck = {
  436.                 private["_meleeNum","_magType"];
  437.                 _magType =         ([] + getArray (configFile >> "CfgWeapons" >> _wpnType >> "magazines")) select 0;
  438.                 _meleeNum = ({_x == _magType} count magazines player);
  439.                 if (_meleeNum < 1) then {
  440.                         player addMagazine _magType;
  441.                 };
  442.         };
  443.  
  444.         dayz_originalPlayer = player;
  445.        
  446.         progressLoadingScreen 0.8;
  447. };
  448.  
  449.         //Both
  450.         BIS_fnc_selectRandom =          compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\BIS_fnc\fn_selectRandom.sqf";
  451.         BIS_fnc_vectorAdd =         compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\BIS_fnc\fn_vectorAdd.sqf";  
  452.         BIS_fnc_halo =              compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\BIS_fnc\fn_halo.sqf";
  453.         BIS_fnc_findNestedElement =     compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\BIS_fnc\fn_findNestedElement.sqf";
  454.         BIS_fnc_param =                         compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\BIS_fnc\fn_param.sqf";
  455.  
  456.         fnc_buildWeightedArray =                compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_buildWeightedArray.sqf";              //Checks which actions for nearby casualty
  457.         fnc_usec_damageVehicle =                compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_damageHandlerVehicle.sqf";            //Event handler run on damage
  458.         zombie_initialize =                     compile preprocessFileLineNumbers "\z\addons\dayz_code\init\zombie_init.sqf";
  459.         // object_vehicleKilled =               compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_vehicleKilled.sqf";               //Event handler run on damage
  460.         object_setHitServer =                   compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_setHitServer.sqf";        //process the hit as a NORMAL damage (useful for persistent vehicles)
  461.         object_setFixServer =                   compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_setFixServer.sqf";        //process the hit as a NORMAL damage (useful for persistent vehicles)
  462.         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
  463.         object_setHit =                         compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_setHit.sqf";                      //process the hit as a NORMAL damage (useful for persistent vehicles)
  464.         object_processHit =                     compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_processHit.sqf";          //process the hit in the REVO damage system (records and sets hit)
  465.         object_delLocal =                       compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_delLocal.sqf";
  466.         // object_cargoCheck =                  compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_cargoCheck.sqf";          //Run by the player or server to monitor changes in cargo contents
  467.         fnc_usec_damageHandler =                compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_damageHandler.sqf";           //Event handler run on damage
  468.         fnc_veh_ResetEH =                       compile preprocessFileLineNumbers "\z\addons\dayz_code\init\veh_ResetEH.sqf";                   //Initialize vehicle
  469.         // Vehicle damage fix
  470.         vehicle_handleDamage    =               compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\vehicle_handleDamage.sqf";
  471.         vehicle_handleKilled    =               compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\vehicle_handleKilled.sqf";
  472.         //fnc_vehicleEventHandler =             compile preprocessFileLineNumbers "\z\addons\dayz_code\init\vehicle_init.sqf";                  //Initialize vehicle
  473.         fnc_inString =                          compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_inString.sqf";       
  474.         fnc_isInsideBuilding =                  compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_isInsideBuilding.sqf";        //_isInside = [_unit,_building] call fnc_isInsideBuilding;
  475.         fnc_isInsideBuilding2 =                 compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_isInsideBuilding2.sqf";       //_isInside = [_unit,_building] call fnc_isInsideBuilding;
  476.         fnc_isInsideBuilding3 =                 compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_isInsideBuilding3.sqf";       //_isInside = [_unit,_building] call fnc_isInsideBuilding;
  477.         dayz_zombieSpeak =                      compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_speak.sqf";                       //Used to generate random speech for a unit
  478.         vehicle_getHitpoints =                  compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\vehicle_getHitpoints.sqf";
  479.         local_gutObject =                       compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\local_gutObject.sqf";            //Generated on the server (or local to unit) when gutting an object
  480.         local_lockUnlock =                      compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\local_lockUnlock.sqf";           //When vehicle is local to unit perform locking vehicle
  481.         local_gutObjectZ =                      compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\local_gutObjectZ.sqf";           //Generated on the server (or local to unit) when gutting an object
  482.         local_zombieDamage =                    compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_damageHandlerZ.sqf";          //Generated by the client who created a zombie to track damage
  483.         local_setFuel =                         compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\local_setFuel.sqf";                      //Generated when someone refuels a vehicle
  484.         local_eventKill =                       compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\local_eventKill.sqf";            //Generated when something is killed
  485.         //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
  486.         curTimeStr =                            compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_curTimeStr.sqf";
  487.         player_medBandage =                     compile preprocessFileLineNumbers "\z\addons\dayz_code\medical\publicEH\medBandaged.sqf";
  488.         player_medInject =                      compile preprocessFileLineNumbers "\z\addons\dayz_code\medical\publicEH\medInject.sqf";
  489.         player_medEpi =                         compile preprocessFileLineNumbers "\z\addons\dayz_code\medical\publicEH\medEpi.sqf";
  490.         player_medTransfuse =                   compile preprocessFileLineNumbers "\z\addons\dayz_code\medical\publicEH\medTransfuse.sqf";
  491.         player_medMorphine =                    compile preprocessFileLineNumbers "\z\addons\dayz_code\medical\publicEH\medMorphine.sqf";
  492.         player_breaklegs =                      compile preprocessFileLineNumbers "\z\addons\dayz_code\medical\publicEH\medBreakLegs.sqf";
  493.         player_medPainkiller =                  compile preprocessFileLineNumbers "\z\addons\dayz_code\medical\publicEH\medPainkiller.sqf";
  494.         world_isDay =                           {if ((daytime < (24 - dayz_sunRise)) and (daytime > dayz_sunRise)) then {true} else {false}};
  495.         player_humanityChange =                 compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_humanityChange.sqf";
  496.         spawn_loot =                            compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\spawn_loot.sqf";
  497.         spawn_loot_small =                      compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\spawn_loot_small.sqf";
  498.         // player_projectileNear =              compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_projectileNear.sqf";
  499.        
  500.         dayz_HungerThirst = {
  501.                 dayz_hunger = dayz_hunger + (_this select 0);
  502.                 dayz_thirst = dayz_thirst + (_this select 1);
  503.         };
  504.  
  505.         dayz_EjectPlayer = {
  506.                 // check if player in vehicle
  507.         private ["_noDriver","_vehicle","_inVehicle"];
  508.         _vehicle = vehicle player;
  509.                 _inVehicle = (_vehicle != player);
  510.                 if(_inVehicle) then {
  511.                         _noDriver = ((_vehicle emptyPositions "driver") > 0);
  512.                         if (_noDriver and (speed _vehicle) != 0) then {
  513.                                 player action [ "eject", _vehicle];
  514.                         };
  515.                 };
  516.         };
  517.  
  518.         player_sumMedical = {
  519.                 private["_character","_wounds","_legs","_arms","_medical"];
  520.                 _character =    _this;
  521.                 _wounds =               [];
  522.                 if (_character getVariable["USEC_injured",false]) then {
  523.                         {
  524.                                 if (_character getVariable[_x,false]) then {
  525.                                         _wounds set [count _wounds,_x];
  526.                                 };
  527.                         } forEach USEC_typeOfWounds;
  528.                 };
  529.                 _legs = _character getVariable ["hit_legs",0];
  530.                 _arms = _character getVariable ["hit_arms",0];
  531.                 _medical = [
  532.                         _character getVariable["USEC_isDead",false],
  533.                         _character getVariable["NORRN_unconscious", false],
  534.                         _character getVariable["USEC_infected",false],
  535.                         _character getVariable["USEC_injured",false],
  536.                         _character getVariable["USEC_inPain",false],
  537.                         _character getVariable["USEC_isCardiac",false],
  538.                         _character getVariable["USEC_lowBlood",false],
  539.                         _character getVariable["USEC_BloodQty",12000],
  540.                         _wounds,
  541.                         [_legs,_arms],
  542.                         _character getVariable["unconsciousTime",0],
  543.                         _character getVariable["messing",[0,0]]
  544.                 ];
  545.                 _medical
  546.         };
  547.        
  548.         //Server Only
  549.         if (isServer) then {
  550.                 call compile preprocessFileLineNumbers "\z\addons\dayz_server\init\server_functions.sqf";
  551.         } else {
  552.                 eh_localCleanup = {};
  553.         };
  554.        
  555.         //Start Dynamic Weather
  556.         execVM "DynamicWeatherEffects.sqf";
  557.         initialized = true;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top