[Tutorial] Editing Heli Crashes - 1.7.6.1 (Simplified)

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
 
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 ?
 
@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!
 
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
 
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...
 
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)
 
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?
 
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?



Follow this guide http://opendayz.net/threads/release-namalsk-random-helicrash-sites.12431/
 
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.​
 
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??
 
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?
 
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;
 
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:
if (!_wsDone) then {
if (count _worldspace >= 1) then { _dir = _worldspace select 0; };
_pos = [getMarkerPos "center",0,4000,10,0,2000,0] call BIS_fnc_findSafePos;
if (count _pos < 3) then { _pos = [_pos select 0,_pos select 1,0]; };
diag_log ("MOVED OBJ: " + str(_idKey) + " of class " + _type + " to pos: " + str(_pos));
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:
spawn_heliCrash = {
private["_position","_veh","_num","_config","_itemType","_itemChance","_weights","_index","_iArray"];
waitUntil{!isNil "BIS_fnc_selectRandom"};
if (isDedicated) then {
_position = [getMarkerPos "center",0,4000,10,0,2000,0] call BIS_fnc_findSafePos;
diag_log("DEBUG: Spawning a crashed helicopter at " + str(_position));
_veh = createVehicle ["UH1Wreck_DZ",_position, [], 0, "CAN_COLLIDE"];
dayz_serverObjectMonitor set [count dayz_serverObjectMonitor,_veh];
_veh setVariable ["ObjectID",1,true];
dayzFire = [_veh,2,time,false,false];
publicVariable "dayzFire";
if (isServer) then {
nul=dayzFire spawn BIS_Effects_Burn;
};
_num = round(random 4) + 3;
_config = configFile >> "CfgBuildingLoot" >> "HeliCrash";
_itemType = [] + getArray (_config >> "itemType");
//diag_log ("DW_DEBUG: _itemType: " + str(_itemType));
_itemChance = [] + getArray (_config >> "itemChance");
//diag_log ("DW_DEBUG: _itemChance: " + str(_itemChance));
//diag_log ("DW_DEBUG: (isnil fnc_buildWeightedArray): " + str(isnil "fnc_buildWeightedArray"));
waituntil {!isnil "fnc_buildWeightedArray"};
_weights = [];
_weights = [_itemType,_itemChance] call fnc_buildWeightedArray;
//diag_log ("DW_DEBUG: _weights: " + str(_weights));
for "_x" from 1 to _num do {
//create loot
_index = _weights call BIS_fnc_selectRandom;
sleep 1;
if (count _itemType > _index) then {
//diag_log ("DW_DEBUG: " + str(count (_itemType)) + " select " + str(_index));
_iArray = _itemType select _index;
_iArray set [2,_position];
_iArray set [3,5];
_iArray call spawn_loot;
_nearby = _position nearObjects ["WeaponHolder",20];
{
_x setVariable ["permaLoot",true];
} forEach _nearby;

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.
 
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:
Back
Top