• 0
Sign in to follow this  
Anhor

Supply Drop Event

Question

Hi all,

I run into a problem when I wanna use the Exile Events (Earthquake, Ambient Fly Over ......) and despair in search of a solution O.o

I love the Supply Drop Event ....... but what todo if you run a map WITHOUT airports?

The event starts, I get the messages ......... and the marker (drop) is allways in the left bottom corner of the map.

Is it possible to merge the files so the event uses random points of the map? I would be grateful for any help ......

 

Share this post


Link to post
Share on other sites

8 answers to this question

  • 0

You could just simply define your own positions within ExileClient_util_world_getAllAirportPositions.sqf or within ExileServer_system_event_supplyBox_start.sqf

Either would work so where you define your locations shouldn't matter, as far as i know nothing else is using that airport position check

Share this post


Link to post
Share on other sites
  • 0

Thx Care Bear,

this was my idea too. But after I take a look inside the ExileServer_system_event_supplyBox_start.sqf my positiv thinking fade a bit.

It looks like not that easy.

So maybe someone can take a look of that what I did:

Origin

Spoiler

private["_airportPositions", "_config", "_markerTime", "_filteredAirportPositions", "_dropAltitude", "_dropRadius", "_boxType", "_airportPosition", "_position", "_marker", "_box", "_itemClassName", "_itemCount", "_i", "_supplySmoke", "_parachute"];
_airportPositions = call ExileClient_util_world_getAllAirportPositions;
_config = configFile >> "CfgSettings" >> "Events" >> "SupplyBox";
_markerTime = getNumber (_config >> "markerTime");
if (_airportPositions isEqualTo []) exitWith
{
    "The current map has no airports. Skipping supply box drop event." call ExileServer_util_log;
};
_filteredAirportPositions = [];
{
    if !([_x, 1000] call ExileClient_util_world_isTraderZoneInRange) then
    {
        _filteredAirportPositions pushBack _x;
    };
}
forEach _airportPositions;
if (_filteredAirportPositions isEqualTo []) exitWith
{
    "The current map has airports, but they are too close to traders. Skipping supply box drop event." call ExileServer_util_log;
};
_config = configFile >> "CfgSettings" >> "Events" >> "SupplyBox";
_dropAltitude = getNumber (_config >> "dropAltitude");
_dropRadius = getNumber (_config >> "dropRadius");
_boxType = selectRandom (getArray (_config >> "types"));
_airportPosition = selectRandom _filteredAirportPositions;
_airportPosition set [2, 0];
_position = [_airportPosition, _dropRadius] call ExileClient_util_math_getRandomPositionInCircle;
_position set [2, _dropAltitude];
["toastRequest", ["InfoTitleAndText", ["Supply drop incoming!", "ETA 10 Minutes"]]] call ExileServer_system_network_send_broadcast;
_marker = createMarker [ format["ExileSupplyBox%1", diag_tickTime], _position];
_marker setMarkerType "ExileHeart";
uiSleep (60 * 5);
["toastRequest", ["InfoTitleAndText", ["Supply drop incoming!", "ETA 5 Minutes"]]] call ExileServer_system_network_send_broadcast;
uiSleep (60 * 4);
["toastRequest", ["InfoTitleAndText", ["Supply drop incoming!", "ETA 1 Minute"]]] call ExileServer_system_network_send_broadcast;
uiSleep (60 * 1);
_box = createVehicle ["Exile_Container_SupplyBox", [0, 0, 0], [], 0, "CAN_COLLIDE"];
_box setPosATL _position;
_box setDir (random 360);
clearBackpackCargoGlobal _box;
clearWeaponCargoGlobal _box;
clearMagazineCargoGlobal _box;
clearItemCargoGlobal _box;
{
    _itemClassName = _x select 0;
    _itemCount = _x select 1;
    for "_i" from 1 to _itemCount do
    {
        [_box, _itemClassName] call ExileClient_util_containerCargo_add;
    };
}
forEach (getArray (_config >> "BoxTypes" >> _boxType >> "items"));
_supplySmoke = createVehicle ["Exile_Ammo_SmokeShellOrange", getPos _box, [], 0, "CAN_COLLIDE"];
_supplySmoke attachTo [_box, [0, 0, 0.5]];
_parachute = createVehicle ["O_Parachute_02_F", getPos _box, [], 0, "FLY"];
_parachute setPosATL _position;
_parachute setDir (getDir _box);
_box attachTo [_parachute, [0, 0, -1.2]];
waitUntil { ((getPos _box) select 2) < 1.5 };
detach _supplySmoke;
detach _box;
_parachute disableCollisionWith _box;
_box disableCollisionWith _parachute;
_position = getPos _box;
_position set [2, 0];
_box setPos _position;
_box setVelocity [0, 0, 0];
uiSleep (60 * _markerTime);
deleteMarker _marker;

Merged to:

Spoiler

private["_Positions", "_config", "_markerTime", "_dropAltitude", "_dropRadius", "_boxType", "_position", "_marker", "_box", "_itemClassName", "_itemCount", "_i", "_supplySmoke", "_parachute"];
_Positions = ["000, 000, 000", "000, 000, 000", "000, 000, 000"];
_config = configFile >> "CfgSettings" >> "Events" >> "SupplyBox";
_markerTime = getNumber (_config >> "markerTime");

_config = configFile >> "CfgSettings" >> "Events" >> "SupplyBox";
_dropAltitude = getNumber (_config >> "dropAltitude");
_dropRadius = getNumber (_config >> "dropRadius");
_boxType = selectRandom (getArray (_config >> "types"));
_Position = selectRandom;
_Position set [2, 0];
_position = [_Position, _dropRadius] call ExileClient_util_math_getRandomPositionInCircle;
_position set [2, _dropAltitude];
["toastRequest", ["InfoTitleAndText", ["Supply drop incoming!", "ETA 10 Minutes"]]] call ExileServer_system_network_send_broadcast;
_marker = createMarker [ format["ExileSupplyBox%1", diag_tickTime], _position];
_marker setMarkerType "ExileHeart";
uiSleep (60 * 5);
["toastRequest", ["InfoTitleAndText", ["Supply drop incoming!", "ETA 5 Minutes"]]] call ExileServer_system_network_send_broadcast;
uiSleep (60 * 4);
["toastRequest", ["InfoTitleAndText", ["Supply drop incoming!", "ETA 1 Minute"]]] call ExileServer_system_network_send_broadcast;
uiSleep (60 * 1);
_box = createVehicle ["Exile_Container_SupplyBox", [0, 0, 0], [], 0, "CAN_COLLIDE"];
_box setPosATL _position;
_box setDir (random 360);
clearBackpackCargoGlobal _box;
clearWeaponCargoGlobal _box;
clearMagazineCargoGlobal _box;
clearItemCargoGlobal _box;
{
    _itemClassName = _x select 0;
    _itemCount = _x select 1;
    for "_i" from 1 to _itemCount do
    {
        [_box, _itemClassName] call ExileClient_util_containerCargo_add;
    };
}
forEach (getArray (_config >> "BoxTypes" >> _boxType >> "items"));
_supplySmoke = createVehicle ["Exile_Ammo_SmokeShellOrange", getPos _box, [], 0, "CAN_COLLIDE"];
_supplySmoke attachTo [_box, [0, 0, 0.5]];
_parachute = createVehicle ["O_Parachute_02_F", getPos _box, [], 0, "FLY"];
_parachute setPosATL _position;
_parachute setDir (getDir _box);
_box attachTo [_parachute, [0, 0, -1.2]];
waitUntil { ((getPos _box) select 2) < 1.5 };
detach _supplySmoke;
detach _box;
_parachute disableCollisionWith _box;
_box disableCollisionWith _parachute;
_position = getPos _box;
_position set [2, 0];
_box setPos _position;
_box setVelocity [0, 0, 0];
uiSleep (60 * _markerTime);
deleteMarker _marker;

Will this work (with correct coordinates)?

 

Edited by Anhor

Share this post


Link to post
Share on other sites
Advertisement
  • 0

Right idea though it's a bit off since what you did would spawn no crates or anything.

 

Position selection won't work here

_Position = selectRandom;
_Position set [2, 0];
_position = [_Position, _dropRadius] call ExileClient_util_math_getRandomPositionInCircle;
_position set [2, _dropAltitude];

Should be done like this

_DropLocation = selectRandom _Positions;
_DropLocation set [2, 0];
_Position = [_DropLocation, _dropRadius] call ExileClient_util_math_getRandomPositionInCircle;
_Position set [2, _dropAltitude];

 

So what you had was

1) _position used for 2 different things

2) selectRandom would have nothing to select from so it would do nothing

3) You could just defined your own positions within  _filteredAirportPositions and remove the extra functions for finding drop zones since they would be rendered kinda useless.

 

Spoiler

private["_config", "_markerTime", "_filteredAirportPositions", "_dropAltitude", "_dropRadius", "_boxType", "_airportPosition", "_position", "_marker", "_box", "_itemClassName", "_itemCount", "_i", "_supplySmoke", "_parachute"];
_config = configFile >> "CfgSettings" >> "Events" >> "SupplyBox";
_markerTime = getNumber (_config >> "markerTime");
_filteredAirportPositions = ["X,Y,Z","X,Y,Z","X,Y,Z"];
_config = configFile >> "CfgSettings" >> "Events" >> "SupplyBox";
_dropAltitude = getNumber (_config >> "dropAltitude");
_dropRadius = getNumber (_config >> "dropRadius");
_boxType = selectRandom (getArray (_config >> "types"));
_airportPosition = selectRandom _filteredAirportPositions;
_airportPosition set [2, 0];
_position = [_airportPosition, _dropRadius] call ExileClient_util_math_getRandomPositionInCircle;
_position set [2, _dropAltitude];
["toastRequest", ["InfoTitleAndText", ["Supply drop incoming!", "ETA 10 Minutes"]]] call ExileServer_system_network_send_broadcast;
_marker = createMarker [ format["ExileSupplyBox%1", diag_tickTime], _position];
_marker setMarkerType "ExileHeart";
uiSleep (60 * 5);
["toastRequest", ["InfoTitleAndText", ["Supply drop incoming!", "ETA 5 Minutes"]]] call ExileServer_system_network_send_broadcast;
uiSleep (60 * 4);
["toastRequest", ["InfoTitleAndText", ["Supply drop incoming!", "ETA 1 Minute"]]] call ExileServer_system_network_send_broadcast;
uiSleep (60 * 1);
_box = createVehicle ["Exile_Container_SupplyBox", [0, 0, 0], [], 0, "CAN_COLLIDE"];
_box setPosATL _position;
_box setDir (random 360);
clearBackpackCargoGlobal _box;
clearWeaponCargoGlobal _box;
clearMagazineCargoGlobal _box;
clearItemCargoGlobal _box;
{
	_itemClassName = _x select 0;
	_itemCount = _x select 1;
	for "_i" from 1 to _itemCount do 
	{
		[_box, _itemClassName] call ExileClient_util_containerCargo_add;
	};
}
forEach (getArray (_config >> "BoxTypes" >> _boxType >> "items"));
_supplySmoke = createVehicle ["Exile_Ammo_SmokeShellOrange", getPos _box, [], 0, "CAN_COLLIDE"];
_supplySmoke attachTo [_box, [0, 0, 0.5]];
_parachute = createVehicle ["O_Parachute_02_F", getPos _box, [], 0, "FLY"];
_parachute setPosATL _position;
_parachute setDir (getDir _box);
_box attachTo [_parachute, [0, 0, -1.2]];
waitUntil { ((getPos _box) select 2) < 1.5 };
detach _supplySmoke;
detach _box;
_parachute disableCollisionWith _box;
_box disableCollisionWith _parachute;
_position = getPos _box;
_position set [2, 0];
_box setPos _position;
_box setVelocity [0, 0, 0];
uiSleep (60 * _markerTime);
deleteMarker _marker;

 

 

  • Like 3

Share this post


Link to post
Share on other sites
  • 0

I´m very thankful Care Bear, your great!

And thank you for pointing out my misunderstandings, the only way to get better 9_9

Share this post


Link to post
Share on other sites
  • 0

Hi Care Bear,

unfortunately the event does not start. This is what the RPT shows:

 6:38:54 "ExileServer - Spawning ExileServer_system_event_supplyBox_start..."
 6:38:54 Error in expression < selectRandom _Positions;
_DropLocation set [2, 0];
_Position = [_DropLocation, >
 6:38:54   Error position: <set [2, 0];
_Position = [_DropLocation, >
 6:38:54   Error set: Type String, expected Array
 6:38:54 File exile_server\code\ExileServer_system_event_supplyBox_start.sqf, line 12

This is what I use:

Spoiler

private["_Positions", "_config", "_markerTime", "_dropAltitude", "_dropRadius", "_boxType", "_position", "_marker", "_box", "_itemClassName", "_itemCount", "_i", "_supplySmoke", "_parachute"];
_Positions = ["8918, 8605, 0", "3568, 13002, 0", "13173, 13491, 0", "13453, 3987, 0", "2850, 1527, 0"];
_config = configFile >> "CfgSettings" >> "Events" >> "SupplyBox";
_markerTime = getNumber (_config >> "markerTime");

_config = configFile >> "CfgSettings" >> "Events" >> "SupplyBox";
_dropAltitude = getNumber (_config >> "dropAltitude");
_dropRadius = getNumber (_config >> "dropRadius");
_boxType = selectRandom (getArray (_config >> "types"));
_DropLocation = selectRandom _Positions;
_DropLocation set [2, 0];
_Position = [_DropLocation, _dropRadius] call ExileClient_util_math_getRandomPositionInCircle;
_position set [2, _dropAltitude];
["toastRequest", ["InfoTitleAndText", ["Supply drop!", "ETA 10 Minutes"]]] call ExileServer_system_network_send_broadcast;
_marker = createMarker [ format["ExileSupplyBox%1", diag_tickTime], _position];
_marker setMarkerType "ExileHeart";
uiSleep (60 * 5);
["toastRequest", ["InfoTitleAndText", ["Supply drop!", "ETA 5 Minutes"]]] call ExileServer_system_network_send_broadcast;
uiSleep (60 * 4);
["toastRequest", ["InfoTitleAndText", ["Supply drop!", "ETA 1 Minute"]]] call ExileServer_system_network_send_broadcast;
uiSleep (60 * 1);
_box = createVehicle ["Exile_Container_SupplyBox", [0, 0, 0], [], 0, "CAN_COLLIDE"];
_box setPosATL _position;
_box setDir (random 360);
clearBackpackCargoGlobal _box;
clearWeaponCargoGlobal _box;
clearMagazineCargoGlobal _box;
clearItemCargoGlobal _box;
{
    _itemClassName = _x select 0;
    _itemCount = _x select 1;
    for "_i" from 1 to _itemCount do
    {
        [_box, _itemClassName] call ExileClient_util_containerCargo_add;
    };
}
forEach (getArray (_config >> "BoxTypes" >> _boxType >> "items"));
_supplySmoke = createVehicle ["Exile_Ammo_SmokeShellOrange", getPos _box, [], 0, "CAN_COLLIDE"];
_supplySmoke attachTo [_box, [0, 0, 0.5]];
_parachute = createVehicle ["O_Parachute_02_F", getPos _box, [], 0, "FLY"];
_parachute setPosATL _position;
_parachute setDir (getDir _box);
_box attachTo [_parachute, [0, 0, -1.2]];
waitUntil { ((getPos _box) select 2) < 1.5 };
detach _supplySmoke;
detach _box;
_parachute disableCollisionWith _box;
_box disableCollisionWith _parachute;
_position = getPos _box;
_position set [2, 0];
_box setPos _position;
_box setVelocity [0, 0, 0];
uiSleep (60 * _markerTime);
deleteMarker _marker;

 

I deleted the whole line ( _DropLocation set [2, 0]; ) from the script and get no error in RPT anymore.

Maybe it was useless?

Edit: No, not realy. Now I have this in RPT

8:15:44 "ExileServer - Spawning ExileServer_system_event_supplyBox_start..."
 8:15:44 Error in expression <_offsetY"];
_centerX = (_this select 0) select 0;
_centerY = (_this select 0) se>
 8:15:44   Error position: <select 0;
_centerY = (_this select 0) se>
 8:15:44   Error Generic error in expression
 8:15:44 File exile_client\code\ExileClient_util_math_getRandomPositionInCircle.sqf, line 13

 

Edited by Anhor

Share this post


Link to post
Share on other sites
  • 0

I checked the cofigs and locations returned are only X and Y.

 

So for Tanoa it returns an array like this

[[7085.57,7681.84],[1836.48,12994.2],[11878.5,2962.99],[1906.88,3464.02],[12195.2,13062.3]] 

been a while since the last time i've touched anything arma coding related but adding your coords using this as a template should fix it for you.

_Positions = [[8918,8605],[3568,13002],[13173,13491],[13453,3987],[2850,1527]];

 

Share this post


Link to post
Share on other sites
  • 0

Nice my friend ........ should I add the "_DropLocation set [2, 0];" into the script again or not?

 

Edit:

It works! Thx again Care Bear!

 

Edited by Anhor

Share this post


Link to post
Share on other sites
  • 0

Probably,  i haven't looked at in great detail to tell you what exactly that offset does but i'd leave it as is since the first time around i didn't actually know that only X and Y coords are pulled from configs and my array was wrong :P

Share this post


Link to post
Share on other sites
Advertisement

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.