Animated Helicrashs 0.1 - Release

yea delete the first and put in the second

Then look in and change the numbers as you like i have mine fly to 5 waypoints not one and things like that
 
30949734.jpg




14:15:27 "CRASHSPAWNER: Current Loot Pile: [["FN_FAL","weapon",0.04],["FN_FAL_ANPVS4","weapon",0.01],["Mk_48_DZ","weapon",0.03],["M249_DZ","weapon",0.04],["BAF_L85A2_RIS_Holo","weapon",0.03],["MedBox0","object",0.05],["NVGoggles","weapon",0.01],["AmmoBoxSmall_556","object",0.05],["Skin_Camo1_DZ","magazine",0.08],["Skin_Sniper1_DZ","magazine",0.05],["G36C","weapon",0.03],["G36C_camo","weapon",0.03],["G36A_camo","weapon",0.03],["G36K_camo","weapon",0.03],["","military",1],["","medical",0.5]]"
14:15:27 "CRASHSPAWNER: Current Loot Weights: [0,0,0,0,1,2,2,2,3,3,3,3,4,4,4,5,5,5,5,5,6,7,7,7,7,7,8,8,8,8,8,8,8,8,9,9,9,9,9,10,10,10,11,11,11,12,12,12,13,13,13,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15]"
14:15:27 "CRASHSPAWNER: Loot spawn at '[8539.17,6443.47,0]' with loot table '15.3165'"
14:15:27 "CRASHSPAWNER: Loot spawn at '[8542.19,6431.64,0]' with loot table '15.3165'"
14:15:27 "CRASHSPAWNER: Loot spawn at '[8545.58,6432.47,0]' with loot table '15.3165'"
14:15:28 "CRASHSPAWNER: Loot spawn at '[8544.03,6444.03,0]' with loot table '15.3165'"
14:15:28 "CRASHSPAWNER: Loot spawn at '[8535.05,6437.34,0]' with loot table '15.3165'"
14:15:28 "CRASHSPAWNER: Loot spawn at '[8541.14,6444.18,0]' with loot table '15.3165'"
14:15:28 "CRASHSPAWNER: Loot spawn at '[8549.07,6438.48,0]' with loot table '15.3165'"
14:15:28 "CRASHSPAWNER: Crash completed! Wreck at: [8542.55,6437.34,-0.0845337] - Runtime: 270 Seconds || Distance from calculated POC: 158 meters"
14:15:28 "CRASHSPAWNER: 100% chance to start a crashing UH-1H with loot table 'HeliCrashWEST' at 1359.65"
 
15:39:04 Warning Message: Script z\addons\dayz_server\init\server_functions.sqf not found
15:39:04 "\z\addons\dayz_code\system\REsec.sqf:Monitoring Remote Exe..."
15:39:04 "Running "kh_actions"."
15:39:04 Warning Message: Script z\addons\dayz_server\system\server_monitor.sqf not found
15:39:31 "RE rJIPrequestcode args:[B 1-1-A:1 (PP) REMOTE,any]"
15:44:25 Client: Remote object 2:4 not found
15:44:25 Client: Remote object 2:5 not found
15:44:25 Client: Remote object 2:6 not found
15:44:36 "RE rJIPrequestcode args:[B 1-1-A:1 (PP) REMOTE,any]"
 
If you look closely at the 1.7.7.1 server_monitor.sqf code, between _randomizedLoot, and _frequency, is now spawnOnStart.
So it should look something like this...

// [_guaranteedLoot, _randomizedLoot, spawnOnStart, _frequency, _variance, _spawnChance, _spawnMarker, _spawnRadius, _spawnFire, _fadeFire, _useStatic, _preWaypoint, _crashDamage]
nul = [3, 4, 3, (50 * 60), (15 * 60), 0.75, 'center', 4000, true, false, false, 1, 1] spawn server_spawnCrashSite;

That explains the new number added before (50*60). If you were using the old code, it would be attempting to spawn 3000 heli's on start!
 
Doesn't seem to be working on my DayZ.st server running v1.7.7.1

Not getting them to spawn at all. Not even the initial 3 on the ground?

UPDATE:
If I revert back to the original server_spawnCrashSite.sqf file, the crashsites are back as normal. So there appears to be something wrong in that edited file that's not liking my server.
I'm using the one Matt L linked by the way.
 
Anyone care to share how they got this working on 1.7.7.1?

I have followed the instructions from OP plus AlienX changes. Now I don't get crashsites at all!
 
Still unable to get this working on a DayZ.st server running v1.7.7.1
Anyone have any ideas to help?
Here's an excerpt from my RPT file...

HTML:
21:25:03 Warning Message: File z\addons\dayz_server\system\server_cleanup.fsm, line 0: '.': '*' encountered instead of '='
21:25:03 Warning Message: Config : some input after EndOfFile.
21:25:03 "CRASHSPAWNER: Starting spawn logic for animated helicrashs - written by Grafzahl [SC:false||PW:false||CD:2]"
21:25:03 "CRASHSPAWNER: 90000% chance to start a crashing MH-6J Little Bird with loot table 'HeliCrashWEST' at 33.587"
21:25:03 Error in expression <fnc_selectRandom;
} else {
_position = [getMarkerPos _spawnMarker,0,_spawnRadius>
21:25:03  Error position: <getMarkerPos _spawnMarker,0,_spawnRadius>
21:25:03  Error getmarkerpos: Type Number, expected String
21:25:03 File z\addons\dayz_server\compile\server_spawnCrashSite.sqf, line 104
21:25:03 "z\addons\dayz_server\compile\fn_bases.sqf found a nice spot at Berezino [114:63] (9)"
 
I'm running chernarus 1.7.7.1 and I'm using this method for this script.

The helis spawn, fly and crash but there is no loot spawning:

Code:
17:38:40 "CRASHSPAWNER: Loot spawn at '[7397.72,10698.2,0]' with loot table '15.3165'"
17:38:40 Error in expression <s select _index;
_itemType = _itemTypes select _index;


_lootPos = [_pos, ((ran>
17:38:40   Error position: <select _index;


_lootPos = [_pos, ((ran>
17:38:40   Error Zero divisor
17:38:40 File z\addons\dayz_server\compile\server_spawnFlywreck.sqf, line 244
17:38:40 "CRASHSPAWNER: Loot spawn at '[7396.73,10699.1,0]' with loot table '15.3165'"
17:38:40 Error in expression <s select _index;
_itemType = _itemTypes select _index;


_lootPos = [_pos, ((ran>
17:38:40   Error position: <select _index;


_lootPos = [_pos, ((ran>
17:38:40   Error Zero divisor
17:38:40 File z\addons\dayz_server\compile\server_spawnFlywreck.sqf, line 244
17:38:40 "CRASHSPAWNER: Loot spawn at '[7401.24,10696.6,0]' with loot table '15.3165'"
17:38:40 Error in expression <s select _index;
_itemType = _itemTypes select _index;


_lootPos = [_pos, ((ran>
17:38:40   Error position: <select _index;


_lootPos = [_pos, ((ran>
17:38:40   Error Zero divisor
17:38:40 File z\addons\dayz_server\compile\server_spawnFlywreck.sqf, line 244
17:38:40 "CRASHSPAWNER: Loot spawn at '[7403.07,10692.9,0]' with loot table '15.3165'"
17:38:40 Error in expression <s select _index;
_itemType = _itemTypes select _index;


_lootPos = [_pos, ((ran>
17:38:40   Error position: <select _index;


_lootPos = [_pos, ((ran>
17:38:40   Error Zero divisor
17:38:40 File z\addons\dayz_server\compile\server_spawnFlywreck.sqf, line 244
17:38:40 "CRASHSPAWNER: Loot spawn at '[7395.36,10697.8,0]' with loot table '15.3165'"
17:38:40 Error in expression <s select _index;
_itemType = _itemTypes select _index;


_lootPos = [_pos, ((ran>
17:38:40   Error position: <select _index;


_lootPos = [_pos, ((ran>
17:38:40   Error Zero divisor
17:38:40 File z\addons\dayz_server\compile\server_spawnFlywreck.sqf, line 244
17:38:40 "CRASHSPAWNER: Crash completed! Wreck at: [7397.33,10692.2,-0.548218] - Runtime: 241 Seconds || Distance from calculated POC: 32 meters"
 
The choopers are crashing at startpoints for me, anyone know anything of this? Running namalsk map
 
sorry for double posting but got a little annoying problem left. I have no smoke coming out of the crashed heli:



Code:
Code:
//Animation is done, lets create the actual Crashside
        _crash = createVehicle [_crashModel, _pos, [], 0, "CAN_COLLIDE"];
        _crash setVariable["Sarge",1];
 
        //If you want all Grass around the crashsite to be cutted: Uncomment the next Line (Noobmode)
        _crashcleaner = createVehicle ["ClutterCutter_EP1", _pos, [], 0, "CAN_COLLIDE"];
 
        //Setting the Direction would add realism, but it sucks because of the bugged model when not on plane ground.
        //If you want it anyways, just uncomment the next line
        //_crash setDir _dir;
 
        // 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];
 
        //Make it burn (or not)
        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 _randomizedLoot) + _guaranteedLoot;
        //_config =        configFile >> "CfgBuildingLoot" >> _lootTable;
        //_itemTypes =    [] + getArray (_config >> "itemType");
        _itemTypes = [] + getArray (configFile >> "CfgBuildingLoot" >> _lootTable >> "lootType");
        _index =        dayz_CBLBase find _lootTable;
        //_index =        dayz_CBLBase  find "HeliCrash";  //find "HeliCrash"
        _weights =        dayz_CBLChances select _index;
        _cntWeights =    count _weights;
 
        //Creating the Lootpiles outside of the _crashModel
        for "_x" from (round(random _randomizedLoot) + _guaranteedLoot) to 1 step -1 do {
            //Create loot
            _index = floor(random _cntWeights);
            _index = _weights select _index;
            _itemType = _itemTypes select _index;
   
            //Let the Loot spawn in a non-perfect circle around _crashModel
            _lootPos = [_pos, ((random 2) + (sizeOf(_crashModel) * _lootRadius)), random 360] call BIS_fnc_relPos;
            [_itemType select 0, _itemType select 1, _lootPos, 0] call spawn_loot;
 
            diag_log(format["CRASHSPAWNER: Loot spawn at '%1' with loot table '%2'", _lootPos, sizeOf(_crashModel)]);
 
            // ReammoBox is preferred parent class here, as WeaponHolder wouldn't match MedBox0 and other such items.
            _nearby = _pos nearObjects ["ReammoBox", sizeOf(_crashModel)];
            {
                _x setVariable ["permaLoot",true];
            } forEach _nearBy;
        };
 
        //Adding 5 dead soldiers around the wreck, poor guys
        for "_x" from 1 to 5 do {
            _lootPos = [_pos, ((random 4)+3), random 360] call BIS_fnc_relPos;
            _deadBody = createVehicle[["Body1","Body2"] call BIS_fnc_selectRandom,_lootPos,[], 0, "CAN_COLLIDE"];
            _deadBody setDir (random 360);
        };
        _endTime = time - _startTime;
        diag_log(format["CRASHSPAWNER: Crash completed! Wreck at: %2 - Runtime: %1 Seconds || Distance from calculated POC: %3 meters", round(_endTime), str(getPos _crash), round(_position distance _crash)]);
    };
};
 
For anyone using a custom loot table change the following to make sure the crash sites use your loot table rather than the default client side one

_itemTypes =[] + getArray (missionConfigFile >> "CfgBuildingLoot" >> _lootTable >> "lootType");
 
ah yeah sure, I actually forgot to post the code, here you go:

My working solution:
Code:
_itemTypes = [] + getArray (configFile >> "CfgBuildingLoot" >> _lootTable >> "lootType");
_index =        dayz_CBLBase find _lootTable;
_weights =        dayz_CBLChances select _index;
_cntWeights =    count _weights;
 
//Creating the Lootpiles outside of the _crashModel
for "_x" from (round(random _randomizedLoot) + _guaranteedLoot) to 1 step -1 do {
    //Create loot
    _index = floor(random _cntWeights);
    _index = _weights select _index;
    _itemType = _itemTypes select _index;
 
    //Let the Loot spawn in a non-perfect circle around _crashModel
    _lootPos = [_pos, ((random 2) + (sizeOf(_crashModel) * _lootRadius)), random 360] call BIS_fnc_relPos;
    [_itemType select 0, _itemType select 1, _lootPos, 0] call spawn_loot;
 
    diag_log(format["CRASHSPAWNER: Loot spawn at '%1' with loot table '%2'", _lootPos, sizeOf(_crashModel)]);
 
    // ReammoBox is preferred parent class here, as WeaponHolder wouldn't match MedBox0 and other such items.
    _nearby = _pos nearObjects ["ReammoBox", sizeOf(_crashModel)];
    {
        _x setVariable ["permaLoot",true];
    } forEach _nearBy;
};

Original:
Code:
        _num        = round(random _randomizedLoot) + _guaranteedLoot;
 
        _config =        configFile >> "CfgBuildingLoot" >> _lootTable;
        _itemTypes =    [] + getArray (_config >> "itemType");
        _index =        dayz_CBLBase  find "HeliCrash";
        _weights =        dayz_CBLChances select _index;
        _cntWeights = count _weights;
 
        //Creating the Lootpiles outside of the _crashModel
        for "_x" from 1 to _num do {
            //Create loot
            _index = floor(random _cntWeights);
            _index = _weights select _index;
            _itemType = _itemTypes select _index;
 
            //Let the Loot spawn in a non-perfect circle around _crashModel
            _lootPos = [_pos, ((random 2) + (sizeOf(_crashModel) * _lootRadius)), random 360] call BIS_fnc_relPos;
            [_itemType select 0, _itemType select 1, _lootPos, 0] call spawn_loot;
 
            diag_log(format["CRASHSPAWNER: Loot spawn at '%1' with loot table '%2'", _lootPos, sizeOf(_crashModel)]);
 
            // ReammoBox is preferred parent class here, as WeaponHolder wouldn't match MedBox0 and other such items.
            _nearby = _pos nearObjects ["ReammoBox", sizeOf(_crashModel)];
            {
                _x setVariable ["permaLoot",true];
            } forEach _nearBy;
        };

Could you keep me informed if you get smoke on the downed crashes?
 
Is there a way to make it so the loot doesn't spawn until the zombies do? Perhaps even a minimum # of zombies needing to be killed in the vicinity before the loot spawns?
It's an old bug where people just drive right up to the crashsite so the zombies don't spawn, and loot the goodies without a fight.
 
Back
Top