[Tutorial] Editing Heli Crashes - 1.7.6.1 (Simplified)

Discussion in 'Tutorials' started by unkinhead, Apr 1, 2013.

  1. Jester J

    Jester J Member

    Joined:
    May 1, 2013
    Messages:
    30
    Likes Received:
    0
    When I edit this line of code in the system/server_monitor.sqf of the server pbo to change heli crash site spawn timer

    Code:
    // [_guaranteedLoot, _randomizedLoot, _frequency, _variance, _spawnChance, _spawnMarker, _spawnRadius, _spawnFire, _fadeFire]
     
    nul = [4, 4, (50 * 60), (15 * 60), 0.95, 'center', 4000, true, false] spawn server_spawnCrashSite;
    this is what I get in the RPT log...

    9:05:45 Warning Message: Script z\addons\dayz_server\init\server_functions.sqf not found
    9:05:45 Error in expression <ls\Eexcute.sqf","",5,false,true,"",""];
    };>
    9:05:45 Error position: <};>
    9:05:45 Error Missing {
    9:05:45 File mpmissions\__cur_mp.chernarus\admintools\Activate.sqf, line 4
    9:05:45 Warning Message: Script z\addons\dayz_server\system\server_monitor.sqf not found

    any ideas? I'm on dayz.st
     
  2. Wobble

    Wobble New Member

    Joined:
    Apr 21, 2013
    Messages:
    21
    Likes Received:
    0
    My question
    I have added M60 to the loot table here.
    And it removes backpack.
    Is there any code for the weapon that can be changed so i DONT remove backpack ?... in that case what ?
     
  3. VtotheJ

    VtotheJ New Member

    Joined:
    May 20, 2013
    Messages:
    1
    Likes Received:
    0
    @Wobble try adding _DZ to the m60. So in the end it should look like this M60_DZ . I read a post before and someone asked the difference between M107 and M107_DZ. Answer was the _DZ less name replaces the backpack! Which makes sense that gun and the as50 is HUGE on your character in dayz.

    Can anyone confirm that spawning any of these weapons or all weapons caused problems with their server? May it be error log pop ups when the crash and loot spawns, or players getting banned by battleeye for certain guns or something crazy? I want to add weapons to my server but I'm afraid of some unknown consequences.

    On a related side note does anyone know of a weapon list that contains the script variable weapon names? That could be a huge help on this forum thread.

    Thanks for any and all help!
     
  4. BOLBIES

    BOLBIES Member

    Joined:
    Feb 16, 2013
    Messages:
    71
    Likes Received:
    1
    Hi,

    Can this spawn banned weapons and since I'm using DayZ Control Center, which files do I edit and how?
     
  5. Absolution

    Absolution New Member

    Joined:
    Jun 4, 2013
    Messages:
    25
    Likes Received:
    0
    Hi, I dont seem to have any crash sites on my server? is there a way to increase the amount of crashes to say 30+ available at one time so I can see if this is working and loot spawning?

    Also this line...

    // [_guaranteedLoot, _randomizedLoot, _frequency, _variance, _spawnChance, _spawnMarker, _spawnRadius, _spawnFire, _fadeFire]

    nul = [4, 4, (50 * 60), (15 * 60), 0.95, 'center', 4000, true, false] spawn server_spawnCrashSite;

    I noticed before I started editing mine does not have the , 4000, bit included?

    I run dayz epoch from dayz.st
     
  6. GT500

    GT500 Member

    Joined:
    May 2, 2013
    Messages:
    74
    Likes Received:
    3
    I assume that we need to make changes to this for 1.7.7?
     
  7. GT500

    GT500 Member

    Joined:
    May 2, 2013
    Messages:
    74
    Likes Received:
    3
    I tried editing that new heli crash site script for 1.7.7, and it had some rather absurd effects. Right now there are hundreds of loot piles spread out in a 500m radius around each heli crash site on my server... I had decreased the number for how far away stuff spawns as well...
     
  8. flybowlofsaki

    flybowlofsaki New Member

    Joined:
    Mar 27, 2013
    Messages:
    27
    Likes Received:
    2
    im probably running into the same issue. my heli spawns have no gear around them
     
  9. flybowlofsaki

    flybowlofsaki New Member

    Joined:
    Mar 27, 2013
    Messages:
    27
    Likes Received:
    2
    all loot is spawning now. its just in one pile under the heli and no smoke to find it. using dayz.st running 1.7.7 atm
     
  10. lokko

    lokko New Member

    Joined:
    Jun 22, 2013
    Messages:
    1
    Likes Received:
    0
    hey ppl i was thinking can any 1 help me alittle? i cant seem to find the file that needs to be edidet :/ ( i am running dayzcc 1.7.6.1/102591)
     
  11. Fubar22

    Fubar22 New Member

    Joined:
    Jul 21, 2013
    Messages:
    11
    Likes Received:
    0
    Hello - I am new to this so forgive my lack of knowledge.
    Running - DayZ.st server
    Opened server pbo and I am in the server_monitor.
    Unable to find any line that has the following:
    // [_guaranteedLoot, _randomizedLoot, _frequency, _variance, _spawnChance, _spawnMarker, _spawnRadius, _spawnFire, _fadeFire]
    nul = [4, 4, (50 * 60), (15 * 60), 0.75, 'center', 4000, true, false] spawn server_spawnCrashSite;

    Is this something I need to add? If so, in what section/part of the server_monitor.sqf should it go?
     
  12. thespecops

    thespecops Member

    Joined:
    Jul 16, 2013
    Messages:
    40
    Likes Received:
    0
    no crash sites are spawning at all on namalsk what do i do? i have done all the steps you said but none have spawned
     
  13. thespecops

    thespecops Member

    Joined:
    Jul 16, 2013
    Messages:
    40
    Likes Received:
    0


    Follow this guide http://opendayz.net/threads/release-namalsk-random-helicrash-sites.12431/
     
  14. Hadlis

    Hadlis New Member

    Joined:
    Aug 6, 2013
    Messages:
    16
    Likes Received:
    0
    I'm having a tough time getting this to work on my server. Running an epoch server with dayz.st. I have changed my server.pbo/compiles/spawn_crashsite.sqf to reflect the changes all the tutorials say I should. I still get the regular vanilla loot to spawn.​

    Code:
    private ["_position","_num","_config","_itemType","_weights","_index","_crashModel","_lootTable","_guaranteedLoot","_randomizedLoot","_frequency","_variance","_spawnChance","_spawnMarker","_spawnRadius","_spawnFire","_crashName","_nearby","_itemTypes","_cntWeights","_fadeFire"];
     
    //_crashModel    = _this select 0;
    //_lootTable    = _this select 1;
    _guaranteedLoot = _this select 0;
    _randomizedLoot = _this select 1;
    _frequency    = _this select 2;
    _variance    = _this select 3;
    _spawnChance    = _this select 4;
    _spawnMarker    = _this select 5;
    _spawnRadius    = _this select 6;
    _spawnFire    = _this select 7;
    _fadeFire    = _this select 8;
     
     
    diag_log("CRASHSPAWNER: Starting spawn logic for Crash Spawner");
     
    while {true} do {
        private["_timeAdjust","_timeToSpawn","_spawnRoll","_crash","_hasAdjustment","_newHeight","_adjustedPos"];
        // Allows the variance to act as +/- from the spawn frequency timer
        _timeAdjust = round(random(_variance * 2) - _variance);
        _timeToSpawn = time + _frequency + _timeAdjust;
       
        //Adding some Random systems
        _crashModel = ["UH60Wreck_DZ","UH1Wreck_DZ","Mass_grave_DZ"] call BIS_fnc_selectRandom;
       
       
        if(_crashModel == "Mass_grave_DZ") then {
            _lootTable = "MassGrave";
        } else {
    //Crash loot - just uncomment the one you wish to use by default with 50cals is enabled.
        //Table including 50 cals
        _lootTable = ["Military"] call BIS_fnc_selectRandom;
        //Table without 50 cals
        //_lootTable = ["Military","HeliCrash_No50s","MilitarySpecial"] call BIS_fnc_selectRandom;
        };
       
        _crashName    = getText (configFile >> "CfgVehicles" >> _crashModel >> "displayName");
     
        diag_log(format["CRASHSPAWNER: %1%2 chance to spawn '%3' with loot table '%4' at %5", round(_spawnChance * 100), '%', _crashName, _lootTable, _timeToSpawn]);
     
        // Apprehensive about using one giant long sleep here given server time variances over the life of the server daemon
        while {time < _timeToSpawn} do {
            sleep 5;
        };
     
        _spawnRoll = random 1;
     
        // Percentage roll
        if (_spawnRoll <= _spawnChance) then {
     
            _position = [getMarkerPos _spawnMarker,0,_spawnRadius,10,0,2000,0] call BIS_fnc_findSafePos;
     
            diag_log(format["CRASHSPAWNER: Spawning '%1' with loot table '%2' NOW! (%3) at: %4", _crashName, _lootTable, time, str(_position)]);
     
            _crash = createVehicle [_crashModel,_position, [], 0, "CAN_COLLIDE"];
            // Randomize the direction the wreck is facing
            _crash setDir round(random 360);
     
            // Using "custom" wrecks (using the destruction model of a vehicle vs. a prepared wreck model) will result
            // in the model spawning halfway in the ground.  To combat this, an OPTIONAL configuration can be tied to
            // the CfgVehicles class you've created for the custom wreck to define how high above the ground it should
            // spawn.  This is optional.
            _config = configFile >> "CfgVehicles" >> _crashModel >> "heightAdjustment";
            _hasAdjustment =  isNumber(_config);
            _newHeight = 0;
            if (_hasAdjustment) then {
                _newHeight = getNumber(_config);
                //diag_log(format["DIAG: ADJUSTMENT FOUND FOR %1, IT IS: %2", _crashName, _newHeight]);
            };
     
            // Must setPos after a setDir otherwise the wreck won't level itself with the terrain
            _adjustedPos = [(_position select 0), (_position select 1), _newHeight];
            //diag_log(format["DIAG: Designated Position: %1", str(_adjustedPos)]);
            _crash setPos _adjustedPos;
     
            // I don't think this is needed (you can't get "in" a crash), but it was in the original DayZ Crash logic
            dayz_serverObjectMonitor set [count dayz_serverObjectMonitor,_crash];
     
            _crash setVariable ["ObjectID","1",true];
     
            // Disable simulation server side
            _crash enableSimulation false;
     
            _num = round(random _randomizedLoot) + _guaranteedLoot;
           
            if(_crashModel == "Mass_grave_DZ") then {
                _spawnFire = false;
                _num = _num * 2;
            };
     
            if (_spawnFire) then {
                //["dayzFire",[_crash,2,time,false,_fadeFire]] call broadcastRpcCallAll;
                dayzFire = [_crash,2,time,false,_fadeFire];
                publicVariable "dayzFire";
                _crash setvariable ["fadeFire",_fadeFire,true];
            };
     
           
    _num        = round(random 4) + 4;
           
            _config = configFile >> "CfgBuildingLoot" >> _lootTable;
            _itemTypes = [["SCAR_H_LNG_Sniper", "weapon"], ["M14_EP1","weapon"], ["FN_FAL_ANPVS4","weapon"], ["Mk_48_DZ","weapon"], ["M249_DZ","weapon"], ["BAF_L85A2_RIS_CWS","weapon"], ["DMR","weapon"], ["SCAR_H_CQC_CCO", "weapon"], ["G36_C_SD_camo","weapon"], ["", "military"], ["MedBox0", "object"], ["NVGoggles", "weapon"], ["AmmoBoxSmall_556", "object"], ["AmmoBoxSmall_762", "object"], ["Skin_Camo1_DZ", "magazine"], ["Skin_Soldier1_DZ", "magazine"], ["Skin_Sniper1_DZ", "magazine"], ["SVD_CAMO","weapon"], ["M24","weapon"], ["M4A1_AIM_SD_camo","weapon"], ["Sa58V_CCO_EP1","weapon"], ["Sa58V_RCO_EP1","weapon"], ["M4SPR","weapon"], ["SCAR_L_STD_EGLM_TWS","weapon"], ["M110_NVG_EP1","weapons"]];
            _itemChance = [0.06, 0.05, 0.06, 0.03, 0.05, 0.05, 0.04, 0.01, 0.04, 0.02, 0.02, 0.9, 0.09, 0.01, 0.5, 0.05, 0.05, 0.01, 0.05, 0.05, 0.04, 0.03, 0.05, 0.04, 0.05, 0.04, 0.05];
            _weights = [];
            _weights = [_itemType,_itemChance] call fnc_buildWeightedArray;
            _cntWeights = count _weights;
            _index = _weights call BIS_fnc_selectRandom;
     
            for "_x" from 1 to _num do {
                //create loot
                _index = floor(random _cntWeights);
                _index = _weights select _index;
                _itemType = _itemTypes select _index;
                [_itemType select 0, _itemType select 1, _position, 5] call spawn_loot;
     
                diag_log(format["CRASHSPAWNER: Loot spawn at '%1' with loot table '%2'", _crashName, _lootTable]);
     
                // ReammoBox is preferred parent class here, as WeaponHolder wouldn't match MedBox0 and other such items.
                _nearby = _position nearObjects ["ReammoBox", sizeOf(_crashModel)];
                {
                    _x setVariable ["permaLoot",true];
                } forEach _nearBy;
            };
     
        };
    };
    To change the frequency of chopper spawns I made changes to server.pbo/system/server_monitor.sqf. Again I made changes according to posts I have found but it doesn't seem to have made a difference.....Over a 3 hour period I get from 1-3 spawns...and sometimes none.

    Code:
        // [_guaranteedLoot, _randomizedLoot, _frequency, _variance, _spawnChance, _spawnMarker, _spawnRadius, _spawnFire, _fadeFire]
        if(OldHeliCrash) then {
            nul = [3, 4, (15 * 60), (5 * 60), 1, 'center', HeliCrashArea, true, false] spawn server_spawnCrashSite;
        };
     
        // Epoch Events
        nul = [] spawn server_spawnEvents;
     
        allowConnection = true;
        sm_done = true;
    };
    Thanks to anyone who can help me get this straight....I have been working on it for two weeks and have just run out of ideas on how to fix it.​
     
  15. Fentus

    Fentus Member

    Joined:
    Aug 31, 2013
    Messages:
    70
    Likes Received:
    7
    How can i edit the drops on a 1.7.7.1 server?
     
  16. borntobeamuffin

    borntobeamuffin New Member

    Joined:
    Sep 5, 2013
    Messages:
    21
    Likes Received:
    1
    i have a little problem, i add a gunner @ the heli and it works fine, but the gunner is only using the gunner position

    Code:
                        //Only a Woman could crash a Heli this way...
                        _aigroup = creategroup east;
                        _helipilot = _aigroup createUnit ["SurvivorW2_DZ",getPos _crashwreck,[],0,"FORM"];
                        _helipilot moveindriver _crashwreck;
                        _helipilot assignAsDriver _crashwreck;
       
                        _heligunner1 = _aigroup createUnit ["SurvivorW2_DZ",getPos _crashwreck,[],0,"FORM"];
                        _heligunner1 moveInGunner _crashwreck;
                        _heligunner1 assignAsGunner _crashwreck;
    by adding another gunner for the CrewChief seat i get no gunner or shooting AI

    i tryed moveinCommander, but it doesnt work - any ideas how to add the 2. gunner to heli??
     
  17. borntobeamuffin

    borntobeamuffin New Member

    Joined:
    Sep 5, 2013
    Messages:
    21
    Likes Received:
    1
    the following code will only have a working gunner, but not CrewChiefs Gunner seat ....

    Code:
                        //Only a Woman could crash a Heli this way...
                        _aigroup = creategroup east;
                        _helipilot = _aigroup createUnit ["SurvivorW2_DZ",getPos _crashwreck,[],0,"FORM"];
                        _helipilot moveindriver _crashwreck;
                        _helipilot assignAsDriver _crashwreck;
       
                        _heligunner1 = _aigroup createUnit ["SurvivorW2_DZ",getPos _crashwreck,[],0,"FORM"];
                        _heligunner1 moveInGunner _crashwreck;
                        _heligunner1 assignAsGunner _crashwreck;
                       
                        _heligunner2 = _aigroup createUnit ["SurvivorW2_DZ",getPos _crashwreck,[],0,"FORM"];
                        _heligunner2 moveInCommander _crashwreck;
                        _heligunner2 assignAsCommander _crashwreck;
    Any ideas why it doesnt work?
     
  18. NoZ

    NoZ New Member

    Joined:
    Dec 26, 2013
    Messages:
    17
    Likes Received:
    1
    How would this method work on overwatch 0.2.5? The coding looks totally different in the server_spawncrashsite.sqf

    This is what it looks like:
    Code:
    for "_x" from ((round(random _randomizedLoot)) + _guaranteedLoot) to 1 step -1  do {
    //create loot
    _itemTypes = [] + getArray (configFile >> "CfgBuildingLoot" >> _lootTable >> "lootType");
    _CBLBase = dayz_CBLBase find _lootTable;
    _weights = dayz_CBLChances select _CBLBase;
    _cntWeights = count _weights;
    _index1 = floor(random _cntWeights);
    _index2 = _weights select _index1;
    _itemType = _itemTypes select _index2;
     
  19. termy

    termy Member

    Joined:
    Aug 4, 2013
    Messages:
    78
    Likes Received:
    3
    I was just wondering if anyone could help me out here. Im running taviana 2.0 on a dayst server and I want to enlarge the radius of the heli crash site spawns. I have read the tuts in here how to do it but my files seem to be a lot more different to the ones posted.

    In my server monitor.sqf file I have these lines:
    Where [getMarkerPos "center",0,4000,10,0,2000,0] is what I am assuming is the heli crash site center location. But it does not mention heli crash spawns. Yet in my server functions.sqf I have these lines:
    Again, here I have this line : [getMarkerPos "center",0,4000,10,0,2000,0] So would I need to change the 4000 in this file, the other file or both files to make my crash site radius larger?

    I would like to also change the loot that spawns at the crash sites, so again I am assuming that some of these lines are for the loot tables.

    Any help would be greatly appreciated.
     
  20. Chris Atkins

    Chris Atkins Valued Member!

    Joined:
    Aug 28, 2013
    Messages:
    407
    Likes Received:
    52
    Anyone have a custom server_spawnCrachSite.sqf for Overwatch 0.2.5 which has custom heli crash loot?

    Or, does anyone have the solution to editing heli crash loot in the server_spawnCrashSite.sqf for Overwatch 0.2.5?
     
    Last edited: Apr 4, 2014

Share This Page