Advertisement
iaretechnician

compiles.sqf

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