Jump to content
Sign in to follow this  
Whitey01

Supply Box Event.

Recommended Posts

Hi inmates.
Does anyone of you know where I can adjust the map size.
With us, the supply box event boxes always end up outside the map.
Lg. Whitey

Share this post


Link to post
Share on other sites

Ain't the vanilla exile SupplyBox spawned around airports? 
there is a dropRadius parameter in config, check if its not set too high. plus would depend where the airport is located, if its on maps borders you would want to set it to proper value

 

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 = 12; // minutes
            maxTime = 30; // minutes
            minimumPlayersOnline = 2;
            dropRadius = 500; // 500m around an airport (including the main airport on Altis!)
            dropAltitude = 100; // altitude of the drop
            markerTime = 5; // minutes

 

Share this post


Link to post
Share on other sites

@chernaruski

 

I have a Custom ExileServer_system_event_supplyBox_start.sqf

so that the drops are randomly distributed on the card.

 

ExileServer_system_event_supplyBox_start.sqf

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");
_dropAltitude = getNumber (_config >> "dropAltitude");
_dropRadius = getNumber (_config >> "dropRadius");
_boxType = selectRandom (getArray (_config >> "types")); 
_spawnCenter = getArray(configFile >> "CfgWorlds" >> worldName >> "centerPosition");                     
_min = 0;                                                                                                 
_max = worldSize/2 - _dropRadius * 2;
_mindist = 20;                                                                                             
_water = 0;                                                                                             
_shoremode = 0; 
_position = [_spawnCenter,_min,_max,_mindist,_water,5,_shoremode] call BIS_fnc_findSafePos;
_position set [2, _dropAltitude];
["toastRequest", ["InfoTitleAndText", ["Supply drop incoming in 10 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 in 5 Minutes!"]]] call ExileServer_system_network_send_broadcast;
uiSleep (60 * 4);
["toastRequest", ["InfoTitleAndText", ["Supply drop incoming in 1 Minutes!"]]] 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; 

 

 

config.cpp

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 = 20; // minutes
            maxTime = 60; // minutes
            minimumPlayersOnline = 1;
            dropRadius = 500; // 500m around an airport (including the main airport on Altis!)
            dropAltitude = 100; // altitude of the drop
            markerTime = 30; // 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.
            */

 

 

Share this post


Link to post
Share on other sites

I do not know if that will bring anything ...
... but what if you used the following.


_mapsizeX = worldSize;
_mapsizeY = worldSize;


Would that limit the map to the playable map?

Share this post


Link to post
Share on other sites

Then the configuration of the terrain you are using is wrong. Your custom ExileServer_system_event_supplyBox_start is pulling data from  CfgWorlds and if the centerPosition there is set to wrong values, the whole script won't work for you properly. 

As a workaround , you can hardcode center position according to the values of the center of this map in editor. Open the map and find the center and write the values in:
for example ChernarusRedux, center is around x=8192,y=8192,z=doesn't really matters
so you hardcode it as following:

_spawnCenter = [8192,8192,100];  

hardcoding values, will ruin the script if you decide to change the terrain in future tho.                   

  • Thanks 1

Share this post


Link to post
Share on other sites
Sign in to follow this  

×