Animated C130 crashes - Eventually dropping carepackages at way points

no rmod installed on that vid.. :)
oooooo I asked grafzahl about this when he released the choppers, he said that class wasn't available in chernarus. I played with a10s but never tried the chutes. I am going to have to start tinkering in my test server now :D
 
I dont mind lol, saves me the work of having to do it :p Im working on wayyyy to many things at once, kinda get side tracked to much
 
If you manage to get it working you can create a post with it or tell me how u did it and ill add it to the tutorial. It means I can spend more time on my humanity systems and teaming systems :D
 
the loot spawn shudnt be to hard, depends how u coded it to drop the carepackages :p Could steal the bit of coding from where it creates the wreck of the c130 crash and delete the carepackage when it hits the ground and spawn in a new one the way the wrecks work :p
 
//Get position of the helis wreck, but make sure its on the ground;
_pos = [getpos _crashwreck select 0, getpos _crashwreck select 1,0];
_landedPos = [getpos _crashwreck select 0, getpos _crashwreck select 1];

possibly something like _carepos = getpos _carepackage blah blah blah.

then have it spawn the the carepackage the way it does the wrecks by using
the rest of the code minus the dead soldiers and add another varible for the Netted boxes and call for that insted once it has landed insted of the _crashmodel

_carecrash = createVehicle [_careModel, _pos, [], 0, "CAN_COLLIDE"];

This is just off the top of my head, havnt tested or looked at the coding in depth yet :p
 
yea got it working already... gotta add some exceptions like if it doesnt get to the ground within 30secs it gets set down automaticly

basic construct is ready kinda... some tweaking here and there and have a look into the BE filters .. coz attachto should give some problems e.g.

but will do that tomorrow :D
 
kinda stuck at the moment, i want to get the drop locations for chernarus by using bis_fnc_findsafepos

goal is to only drop it in some kind of rotated L shape area along the coast ... to help the bambies to gear up with some basic stuff coz i dont want them to mirror the heli crashes

i defined a new center and radius.. and blacklisted some area... and its just not doing it :S

what i got:
Code:
_blacklist = [[0.101, 15360.1], [11075.6,5328.23]];
//first array: top left corner, second array: somewhere around msta
_spawnMarker = [8910.85,3474.14];
//somewhere near pusta
_preWaypointPos = [_spawnMarker,0,8000,10,0,1000,0,_blacklist] call BIS_fnc_findSafePos;

result:
Code:
17:41:28 Error in expression <"_maxX", "_minY", "_maxY"];
_minX = _tl select 0;
_maxX = _br select 0;
_minY = >
17:41:28  Error position: <select 0;
_maxX = _br select 0;
_minY = >
17:41:28  Error select: Type Number, expected Array,Config entry
17:41:28 File ca\modules\functions\misc\fn_isPosBlacklisted.sqf, line 37

anyone got an idea?
 
Possibly if we modify the random way points to random fixed ones and have it fly from kemenka, with different random waypoints

So lets say for examples WP1 is near the spawn location, WP2 random from say 4 or 5 different locations, wp3 the same wp4 the same wp 5 the same, wp 6 random crash location that way it will drop a carepackage at points we define are safe

unless someone else can come up with a better way, thats the most simple way i could think of.

However I can give you a piece of coding that will push bright green or whatever color smoke off carepackages if you want them to just be random locations at the random waypoints
 
kinda stuck at the moment, i want to get the drop locations for chernarus by using bis_fnc_findsafepos

goal is to only drop it in some kind of rotated L shape area along the coast ... to help the bambies to gear up with some basic stuff coz i dont want them to mirror the heli crashes

i defined a new center and radius.. and blacklisted some area... and its just not doing it :S

what i got:
Code:
_blacklist = [[0.101, 15360.1], [11075.6,5328.23]];
//first array: top left corner, second array: somewhere around msta
_spawnMarker = [8910.85,3474.14];
//somewhere near pusta
_preWaypointPos = [_spawnMarker,0,8000,10,0,1000,0,_blacklist] call BIS_fnc_findSafePos;

result:
Code:
17:41:28 Error in expression <"_maxX", "_minY", "_maxY"];
_minX = _tl select 0;
_maxX = _br select 0;
_minY = >
17:41:28  Error position: <select 0;
_maxX = _br select 0;
_minY = >
17:41:28  Error select: Type Number, expected Array,Config entry
17:41:28 File ca\modules\functions\misc\fn_isPosBlacklisted.sqf, line 37

anyone got an idea?


Looks like you've got a syntax error somewhere in your code.
Also I haven't got fn_isPosBlacklisted.sqf anywhere? =S
 
safepos:
Code:
scriptName "Functions\misc\fn_findSafePos.sqf";
/*
    File: findSafePos.sqf
    Author: Joris-Jan van 't Land
 
    Description:
    Function to retrieve and dynamic position in the world according to several parameters.
 
    Parameter(s):
    _this select 0: center position (Array)
                        Note: passing [] (empty Array), the world's safePositionAnchor entry will be used.
    _this select 1: minimum distance from the center position (Number)
    _this select 2: maximum distance from the center position (Number)
                        Note: passing -1, the world's safePositionRadius entry will be used.
    _this select 3: minimum distance from the nearest object (Number)
    _this select 4: water mode (Number)
                        0: cannot be in water
                        1: can either be in water or not
                        2: must be in water
    _this select 5: maximum terrain gradient (average altitude difference in meters - Number)
    _this select 6: shore mode (Number):
                        0: does not have to be at a shore
                        1: must be at a shore
    _this select 7: (optional) blacklist (Array of Arrays):
                        (_this select 7) select X: Top-left and bottom-right coordinates of blacklisted area (Array)
    _this select 8: (optional) default positions (Array of Arrays):
                        (_this select 8) select 0: default position on land (Array)
                        (_this select 8) select 1: default position on water (Array)
   
    Returns:
    Coordinate array with a position solution.
   
    TODO:
    * Maybe allow passing several combinations of position, min and max dist ... so that you can
    avoid several things?
    * Interpretation of minDist / maxDist is wrong. It's not true distance that is used. Too bad?
*/
 
scopeName "main";
 
private ["_pos", "_minDist", "_maxDist", "_objDist", "_waterMode", "_maxGradient", "_shoreMode", "_defaultPos", "_blacklist"];
_pos = _this select 0;
_minDist = _this select 1;
_maxDist = _this select 2;
_objDist = _this select 3;
_waterMode = _this select 4;
_maxGradient = _this select 5;
_shoreMode = _this select 6;
 
if (_shoreMode == 0) then {_shoreMode = false} else {_shoreMode = true};
 
_blacklist = [];
if ((count _this) > 7) then
{
    _blacklist = _this select 7;
};
 
_defaultPos = [];
if ((count _this) > 8) then
{
    _defaultPos = _this select 8;
};
 
/* See if default world values should be used. */
if ((count _pos) == 0) then
{
    _pos = getArray(configFile >> "CfgWorlds" >> worldName >> "safePositionAnchor");
};
if ((count _pos) == 0) exitWith {debugLog "Log: [findSafePos] No center position was passed!"; []}; /* TODO: instead return defaults below. */
 
if (_maxDist == -1) then
{
    _maxDist = getNumber(configFile >> "CfgWorlds" >> worldName >> "safePositionRadius");
};
 
/* TODO: Validate parameters. */
 
private ["_newPos", "_posX", "_posY"];
_newPos = [];
_posX = _pos select 0;
_posY = _pos select 1;
 
 
/* Limit the amount of attempts at finding a good location. */
private ["_attempts"];
_attempts = 0;
while {_attempts < 1000} do
{
    private ["_newX", "_newY", "_testPos"];
    _newX = _posX + (_maxDist - (random (_maxDist * 2)));
    _newY = _posY + (_maxDist - (random (_maxDist * 2)));
    _testPos = [_newX, _newY];
 
    /* Blacklist check. */
    /* TODO: Do not use function when the blacklist is empty? */
    if (!([_testPos, _blacklist] call BIS_fnc_isPosBlacklisted)) then
    {
            if ((_pos distance _testPos) >= _minDist) then
            {
                if (!((count (_testPos isFlatEmpty [_objDist, 0, _maxGradient, _objDist max 5, _waterMode, _shoreMode, objNull])) == 0)) then
                {
                    _newPos = _testPos;
                    breakTo "main";
                };
            };
    };
 
    _attempts = _attempts + 1;
};
 
/* No position was found, use defaults. */
if ((count _newPos) == 0) then
{
    if (_waterMode == 0) then
    {
        if ((count _defaultPos) > 0) then
        {
            _newPos = _defaultPos select 0;
        }
        else
        {
            /* Use world Armory default position: */
            _newPos = getArray(configFile >> "CfgWorlds" >> worldName >> "Armory" >> "positionStart");
        };
    }
    else
    {
        if ((count _defaultPos) > 1) then
        {
            _newPos = _defaultPos select 1;
        }
        else
        {
            /* Use world Armory default water position: */
            _newPos = getArray(configFile >> "CfgWorlds" >> worldName >> "Armory" >> "positionStartWater");
        };
    };
};
 
if ((count _newPos) == 0) then
{
    /* Still nothing was found, use world center positions. */
    _newPos = getArray(configFile >> "CfgWorlds" >> worldName >> "centerPosition");
};
_newPos

blacklisted:
Code:
scriptName "Functions\misc\fn_isPosBlacklisted.sqf";
/*
    File: isPosBlacklisted.sqf
    Author: Joris-Jan van 't Land & Karel Moricky
 
    Description:
    Function checks a blacklist and sees if the given position is on it or not.
   
    Parameter(s):
    _this select 0: position (Array)
    _this select 1: blacklist (Array or Object/Trigger)
   
    Returns:
    Is the position blacklisted or not (Boolean)
*/
 
private ["_pos", "_list", "_x", "_y", "_listed"];
_pos = _this select 0;
_list = _this select 1;
 
_x = _pos select 0;
_y = _pos select 1;
_listed = false;
 
/* Go through all areas in the blacklist. */
for "_i" from 0 to ((count _list) - 1) do {
    _current = (_list select _i);
    switch (typename _current) do {
        /* --- Definition by top-left and bottom right corner ------------------------------- */
        case (typeName []): {
            /* Check the top-left and bottom-right coordinates. */
            private ["_tl", "_br"];
            _tl = _current select 0;
            _br = _current select 1;
   
            private ["_minX", "_maxX", "_minY", "_maxY"];
            _minX = _tl select 0;
            _maxX = _br select 0;
            _minY = _br select 1;
            _maxY = _tl select 1;
   
            if ((_x > _minX) && (_x < _maxX) && (_y > _minY) && (_y < _maxY)) exitWith {
                _listed = true;
            };
        };
        /*--- Definition by trigger -------------------------------------------------------- */
        case (typeName objNull): {
            if ([_current,_pos] call BIS_fnc_inTrigger) exitwith {
                _listed = true;
            };
        };
        default {
            debuglog "Log: Error in isPosBlacklisted.sqf - wrong input data.";
        };
    };
};
 
_listed
 
anyways, i added some static points along the coast as a workaround... gonna release my first ugly version... its heavily customized for my own needs...

first of all, credits to grafzahl who wrote the original animated heli crash script and to Leh2012 and Gerasimow9 who wrote the c130 cargo drop script...

===========================================================

so, coz i'm lazy and stuff i havent renamed many variables and there are some unused in the script still, cba to clean it up yet...

please note: there are static coords for drop points in the script, they are designed to work with chernarus!!!

===========================================================

1. download http://www.share-online.biz/dl/YK5XOENMFE

and extract into your compile folder in the server.pbo

2. open system\server_cleanup.fsm in your server.pbo

find
Code:
//Check for hackers

and replace the line starting with
" if(vehicle _x != _x && !(vehicle _x in _safety)

with this line:
Code:
      "  if(vehicle _x != _x && !(vehicle _x in _safety) && (typeOf vehicle _x) != ""ParachuteWest"" && (vehicle _x getVariable [""Sarge"",0] != 1)) then {" \n

3. open your system\server_monitor.sqf in your server.pbo and paste this at the end:

Code:
nul =    [
                6,        //Number of the guaranteed Loot-Piles at the Crashside
                3,        //Number of the random Loot-Piles at the Crashside 3+(1,2,3 or 4)
                (50*60),    //Fixed-Time (in seconds) between each start of a new Chopper
                (15*60),      //Random time (in seconds) added between each start of a new Chopper
                0.75,        //Spawnchance of the Heli (1 will spawn all possible Choppers, 0.5 only 50% of them)
                'center', //'center' Center-Marker for the Random-Crashpoints, for Chernarus this is a point near Stary
                8000,    // [106,[960.577,3480.34,0.002]]Radius in Meters from the Center-Marker in which the Choppers can crash and get waypoints
                true,    //Should the spawned crashsite burn (at night) & have smoke?
                false,    //Should the flames & smoke fade after a while?
                2,    //RANDOM WP
                3,        //GUARANTEED WP
                1        //Amount of Damage the Heli has to get while in-air to explode before the POC. (0.0001 = Insta-Explode when any damage//bullethit, 1 = Only Explode when completly damaged)
            ] spawn server_spawnAN2;

4. open your init\server_functions.sqf in your server.pbo

find:
server_spawnCrashSite = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_spawnCrashSite.sqf";

paste this below:
Code:
server_spawnAN2  =    compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_spawnAN2.sqf";
server_carepackagedrop  =    compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_carepackagedrop.sqf";

========================================================

thats it.. i hope it works :D

 
anyways, i added some static points along the coast as a workaround... gonna release my first ugly version... its heavily customized for my own needs...

first of all, credits to grafzahl who wrote the original animated heli crash script and to Leh2012 and Gerasimow9 who wrote the c130 cargo drop script...

===========================================================

so, coz i'm lazy and stuff i havent renamed many variables and there are some unused in the script still, cba to clean it up yet...

please note: there are static coords for drop points in the script, they are designed to work with chernarus!!!

===========================================================

1. download http://www.share-online.biz/dl/YK5XOENMFE

and extract into your compile folder in the server.pbo

2. open system\server_cleanup.fsm in your server.pbo

find
Code:
//Check for hackers

and replace the line starting with
" if(vehicle _x != _x && !(vehicle _x in _safety)

with this line:
Code:
      "  if(vehicle _x != _x && !(vehicle _x in _safety) && (typeOf vehicle _x) != ""ParachuteWest"" && (vehicle _x getVariable [""Sarge"",0] != 1)) then {" \n

3. open your system\server_monitor.sqf in your server.pbo and paste this at the end:

Code:
nul =    [
                6,        //Number of the guaranteed Loot-Piles at the Crashside
                3,        //Number of the random Loot-Piles at the Crashside 3+(1,2,3 or 4)
                (50*60),    //Fixed-Time (in seconds) between each start of a new Chopper
                (15*60),      //Random time (in seconds) added between each start of a new Chopper
                0.75,        //Spawnchance of the Heli (1 will spawn all possible Choppers, 0.5 only 50% of them)
                'center', //'center' Center-Marker for the Random-Crashpoints, for Chernarus this is a point near Stary
                8000,    // [106,[960.577,3480.34,0.002]]Radius in Meters from the Center-Marker in which the Choppers can crash and get waypoints
                true,    //Should the spawned crashsite burn (at night) & have smoke?
                false,    //Should the flames & smoke fade after a while?
                2,    //RANDOM WP
                3,        //GUARANTEED WP
                1        //Amount of Damage the Heli has to get while in-air to explode before the POC. (0.0001 = Insta-Explode when any damage//bullethit, 1 = Only Explode when completly damaged)
            ] spawn server_spawnAN2;

4. open your init\server_functions.sqf in your server.pbo

find:
server_spawnCrashSite = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_spawnCrashSite.sqf";

paste this below:
Code:
server_spawnAN2  =    compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_spawnAN2.sqf";
server_carepackagedrop  =    compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_carepackagedrop.sqf";

========================================================

thats it.. i hope it works :D

Loving it mate :D

We swapped the an2 for an osprey as we have a lot of planes on our server and players moan when they don't know if it's AI or not. Great work thx for your work and your mod too Zombz guys
 
Just trying to figure out now how to announce it in global from the server PBO :p Got the coding set up to translate the co-ords already, so i shud have the announcement ready in a day or two, If i can figure out how to only announce it to players with a radio ill add that in

That way radios then become a handy part of the game.

Also had a few cool ideas for this script will be testing those out too, and releasing when done. just gotta look through the coding and locate the static waypoints u added for the coast so i can modify them for a 2nd script that will run aswell :p
 
does someone have crashed an2 model name ? ?
and also an2 model name is AN2_DZ not just AN2 so you could change that in first post.


9:02:03 "C130StartCRASHSPAWNER: AN2 Cargo Plane started flying from [6993.7,173.053,300] to [6457.06,5190.83,114.982] NOW!(TIME:702||LT:HeliCrash)"
9:02:03 "C130CRASHSPAWNER: Adding Pre-POC-Waypoint #1 on [5263.36,6200.04,106.836]"
9:02:03 "C130CRASHSPAWNER: Adding Pre-POC-Waypoint #2 on [4921.93,5148.96,31.5836]"
9:02:03 "C130CRASHSPAWNER: Adding Pre-POC-Waypoint #3 on [5263.36,6200.04,106.836]"
9:02:03 "C130CRASHSPAWNER: Adding Pre-POC-Waypoint #4 on [4921.93,5148.96,31.5836]"
9:02:03 "C130CRASHSPAWNER: Adding Pre-POC-Waypoint #5 on [4516.49,3296.73,3.68049]"
9:02:25 "DEBUG FPS : 45.4545"
9:02:33 Server: Object 3:75 not found (message 94)
9:05:26 "DEBUG FPS : 47.4777"
9:07:53 "C130EndCRASHSPAWNER: AN2 Cargo Plane just exploded at [6297.44,5111.45,91.2442]!, "
9:08:06 Cannot create non-ai vehicle AN2_DZWreck,

So almost working still missing correct model name :)
 
Did you try AN2Wreck? Otherwise there's some code you can run to show you the cursor target ID on screen in game, can't remember where I saved it though.
 
Back
Top