• 0
BetterDeadThanZed

Supply drops are going into the bottom left corner

Question

Every supply drop goes into the bottom left corner of Esseker. I have not modified the code in any way:

Spoiler

		class SupplyBox 
		{
			/*
				Drops a supply box on a parachute next to a random airport on the map.
				The box may contain items. The box can be transported to a territory
				and installed to become a normal storage container.
			*/
			type = "spawn";
			function = "ExileServer_system_event_supplyBox_start";
			minTime = 30; // minutes
			maxTime = 45; // minutes
			minimumPlayersOnline = 2;
			dropRadius = 500; // 500m around an airport (including the main airport on Altis!)
			dropAltitude = 100; // altitude of the drop
			markerTime = 10; // minutes

			/*
				These are different types of boxes can be dropped.
				You can specify the cargo a box should contain.
				The type of box is chosen randomly from the following list.
				Add a type multiple times to increase the chance of being used.
			*/
			types[] = {"Beer", "Beer", "Tools", "Food", "Food", "RepairParts"};

			class BoxTypes
			{
				class Beer 
				{
					items[] = 
					{
						{"Exile_Item_Beer", 24}
					};
				};

				class Food 
				{
					items[] = 
					{
						{"Exile_Item_BBQSandwich", 5},
						{"Exile_Item_Catfood", 5},
						{"Exile_Item_ChristmasTinner", 5},
						{"Exile_Item_GloriousKnakworst", 5},
						{"Exile_Item_SausageGravy", 5},
						{"Exile_Item_Surstromming", 5},
						{"Exile_Item_CanOpener", 1},
						{"Exile_Item_CookingPot", 1},
						{"Exile_Item_Matches", 1}
					};
				};

				class Tools 
				{
					items[] = 
					{
						{"Exile_Item_Wrench", 1},
						{"Exile_Item_Shovel", 1},
						{"Exile_Item_Screwdriver", 1},
						{"Exile_Item_Pliers", 1},
						{"Exile_Item_Handsaw", 1},
						{"Exile_Item_FireExtinguisher", 1},
						{"Exile_Item_DuctTape", 1}
					};
				};

				class RepairParts 
				{
					items[] = 
					{
						{"Exile_Item_CarWheel", 8},
						{"Exile_Item_FuelCanisterFull", 4},
						{"Exile_Item_OilCanister", 1},
						{"Exile_Item_Grinder", 1},
						{"Exile_Item_CordlessScrewdriver", 1}
					};
				};
			};
		};

 

Is this a bug with supply drops or is it not working properly on Esseker? 

Share this post


Link to post
Share on other sites

20 answers to this question

  • 0

I think its Esseker.

The supply drops find airports and then spawn around them.

I plan on looking at the code when i get round to it and trying to make it pick a random location on the whole map and not just around airports. feel free to have a try first if you want :)

Share this post


Link to post
Share on other sites
  • 0

Does Esseker have airports?

Share this post


Link to post
Share on other sites
Advertisement
  • 0
7 minutes ago, Eichi said:

Does Esseker have airports?

It has 1 but i dont think its configured correctly. It uses a road and not runway for a start lol.

Share this post


Link to post
Share on other sites
  • 0

Could I just modify and override ExileServer_system_event_supplyBox_start.sqf? Maybe create an array of positions that would be selected by _airportPosition?

1 person likes this

Share this post


Link to post
Share on other sites
  • 0
37 minutes ago, BetterDeadThanZed said:

Could I just modify and override ExileServer_system_event_supplyBox_start.sqf? Maybe create an array of positions that would be selected by _airportPosition?

Yes.

Adjust the safe pos stuff

Spoiler

/**
 * ExileServer_system_event_supplyBox_start
 *
 * Exile Mod
 * www.exilemod.com
 * © 2015 Exile Mod Team
 *
 * This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License. 
 * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
 */
 
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;
};
*/

_spawnCenter = getArray(configFile >> "CfgWorlds" >> worldName >> "centerPosition"); 					
_min = 50; 																								
_max = 20000; 																							
_mindist = 20; 																							
_water = 0; 																							
_shoremode = 0; 


_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 = [_spawnCenter,_min,_max,_mindist,_water,5,_shoremode] call BIS_fnc_findSafePos; //[_airportPosition, _dropRadius] call ExileClient_util_math_getRandomPositionInCircle;
_position set [2, _dropAltitude];
["toastRequest", ["InfoTitleAndText", ["Supply drop incoming!", "A Heart for Inmates is going to drop a supply crate in about ten minutes. Check your map for the location."]]] 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!", "A Heart for Inmates is going to drop a supply crate in about five minutes. Check your map for the location."]]] call ExileServer_system_network_send_broadcast;
uiSleep (60 * 4);
["toastRequest", ["InfoTitleAndText", ["Supply drop incoming!", "A Heart for Inmates is going to drop a supply crate in a minute. Check your map for the location."]]] 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;

 

 

Share this post


Link to post
Share on other sites
  • 0

Posted (edited)

That's a good way to do it John. I just tested a way of doing it with an array of positions and that worked too. I'm not sure if I want to use the random method like you posted or an array of positions. With the array, I could create positions in every town, which could make for interesting firefights with AI and zombies, as well as other players, to get the crates.

*EDIT* I tried your code. I set this: "_max = 5000;"

The first supply drop was sent about 7500m from the center.

Edited by BetterDeadThanZed

Share this post


Link to post
Share on other sites
  • 0

On another note, is there a way to randomize the items that are in a supply drop as well as their quantity?

Share this post


Link to post
Share on other sites
  • 0

If johns way put it in random places over the map i think ill go with that.

as for random items, i know this is nothing to do with supply drops but the way the load screen is chosen is random, maybe the way thats done could be used to make random items be selected for the supply drops some how. Im not sure what would need changing though sorry

	if (_backgroundPicture isEqualTo false) then 
	{
		_backgroundPicture = selectRandom 
		[
			"exile_assets\texture\loading\loading_axe_co.paa",
			"exile_assets\texture\loading\loading_bigmomma_co.paa",
			"exile_assets\texture\loading\loading_cement_co.paa",
			"exile_assets\texture\loading\loading_cheathas_co.paa",
			"exile_assets\texture\loading\loading_cockonut_co.paa",
			"exile_assets\texture\loading\loading_codelock_co.paa",
			"exile_assets\texture\loading\loading_concrete_mixer_co.paa",
			"exile_assets\texture\loading\loading_dsnuts_co.paa",
			"exile_assets\texture\loading\loading_emre_co.paa",
			"exile_assets\texture\loading\loading_flag_co.paa",
			"exile_assets\texture\loading\loading_foolbox_co.paa",
			"exile_assets\texture\loading\loading_knife_co.paa",
			"exile_assets\texture\loading\loading_laptop_co.paa",
			"exile_assets\texture\loading\loading_metal_screws_co.paa",
			"exile_assets\texture\loading\loading_moobar_co.paa",
			"exile_assets\texture\loading\loading_pop_tabs_co.paa",
			"exile_assets\texture\loading\loading_raisins_co.paa",
			"exile_assets\texture\loading\loading_shovel_co.paa",
			"exile_assets\texture\loading\loading_sledge_hammer_co.paa",
			"exile_assets\texture\loading\loading_vishpirin_co.paa"
		];

 

Share this post


Link to post
Share on other sites
  • 0
9 minutes ago, Mr Health And Safety said:

If johns way put it in random places over the map i think ill go with that.

as for random items, i know this is nothing to do with supply drops but the way the load screen is chosen is random, maybe the way thats done could be used to make random items be selected for the supply drops some how. Im not sure what would need changing though sorry

 

Well, I do know of a way to randomize loot and it's quantity, but since it's defined in the config.cpp, I am not sure the code I'd use would work. Normally I'd use code like I did in my random loadout script and the script I use to spawn items in spawned vehicles but those are .sqf files.

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

  • Recently Browsing   0 members

    No registered users viewing this page.