Jump to content
wingtip

Cant get supply drop to work

Recommended Posts

I have a mission i am trying to complete and im having issues trying to figure out how to get a supply drop to work.  Most videos on youtube are old and have outdated info with tons of scripts that are easily done these days in the 3den editor with existing modules.   Looking through the forums here at the compiled list of tutorials i wasnt finding anything that really related either....  

   All i want to do is set a trigger so that when blufor is present or when they clear an area that it triggers a chopper to bring a supply and drop it.   I have a chopper down, a requestor and a provider (ammo arsenal), and the trigger.  The chopper is synced to the provider, the provider is synced to the requester, and the requester synced to the trigger.  

    The only script i have is in the crate init which is _signal = "SmokeShellGreen" createVehicle (position _this); _signal attachTo [_this, [0,0,0]];  to have it smoke on the way down and make it easy to find in the jungle.  But the smoke script is useless if i cant get the chopper to even take off let alone fly to the trigger/requester location.....  Am i missing a script or doing it wrong?

Share this post


Link to post
Share on other sites
3 hours ago, wingtip said:

I have a chopper down, a requestor and a provider (ammo arsenal), and the trigger.  The chopper is synced to the provider, the provider is synced to the requester, and the requester synced to the trigger. 

These modules are not designed to be used that way. They are meant for any player that is synchronised to the requester, to be able to use their command menu( under supports ) and choose from the available supports( what ever providers have been synchronised with the requester ).

There are likely better scripts for just doing a standard supply drop from a trigger.

Share this post


Link to post
Share on other sites

  I dont want the players to have that option as people are idiots and would trigger the supply drop at the wrong time and at the wrong location then they would be screwed when they actually needed the supply drop....   Can you tell me how to do it another way with scripts?

Share this post


Link to post
Share on other sites

i want to set this up so that when blufor reaches a location on the map (or clears an area, i havent decided which yet), that  a supply drop will be incoming to prepare them for the next objective....    so i need a trigger, a heli with the supplies and have them drop it over the trigger area.  Im using the tanoa map.

 

   Looking at larrows links in his signature i did find a example script mission that is very similiar but it is triggered by the drop of an ir grenade... i may be able to tweak this to a blufor present trigger instead of the grenade toss....and some other minor changes...testing now.

Share this post


Link to post
Share on other sites

Umm what if you create the heli above the unit ?and when it drops the supply it will fly away and disappear

Share this post


Link to post
Share on other sites

@wingtip,

Quote

 _signal = "SmokeShellGreen_infinite" createVehicle (position _this);

an infinite smoke will last until you retrieve the drop. Delete the smoke as part of your retrieval action,


deleteVehicle _signal;

 

As for the actual script,

Quote

i want to set this up so that when blufor reaches a location on the map (or clears an area, i havent decided which yet),

establish the exact criteria for the whole thing-- like does the chopper land or just kick the box out at altitude? Does the chopper exfil to a location or just disappear on horizon? Can the chopper get shot down? Step-by-step exactly what your expectations are.

Have fun!

Share this post


Link to post
Share on other sites

well as for the details...  after the blufor clear an area i have a task set for them to move to different area where a supply drop will allow them to change out of their wetsuits and into different uniforms and allows them to gear up and dump the crap underwater rifles lol....   i'd like to make this supply the arsenal (as much as i hate this cause players will take forever in arsenal unless i start sending in enemy forces lol)..... so once they set the trigger once in the area, a chopper spawns in flight (the chopper i want to use has the id rhs_uh1h_hidf), flies to the trigger area with the arsenal supply and drops the supply drop with smoke attached for ease of locating ( something like this??? _signal = "SmokeShellGreen" createVehicle (position _this); _signal attachTo [_this, [0,0,0]]; )  Then the heli will fly away then can be deleted somewhere else out of the area... 

 

Thanks everyone for all the help so far....  ive spent a lot of time on this mission so far and is only like my 2nd mission... i started this mission several years ago but got frustrated ...  came back and with updates to the editor it made things more fluid and fun.... once i get this and a few other small things figured out i can just expand my missions to my hearts content lol

Share this post


Link to post
Share on other sites

here you are this will go in your trigger  

_position = (yourTriggername getRelPos [(random ((triggerArea yourTriggername) select 0)), random(360)]);// this will be the random position of the supply the location of the trigger is very important because in its area will the drop detached.The trigger must be circle!
_posheli = getMarkerPos "your marker name where do you want the heli to spawn"
_supplyheli = createVehicle ["rhs_uh1h_hidf", , [], 0, "FLY"];
_helicrew = createVehicleCrew _supplyheli;
//here goes your supply attachment script
_heligroup = group (_helicrew select 0);
_wp = _heligroup addWaypoint [_position,0];
_wp setWaypointType "MOVE";
_wp setWaypointSpeed "Full";
_wp setWaypointBehaviour "Aware";
_wp setWaypointStatements ["true", here goes your supply detachment script];

_randomPosMapNoLand = [nil, ["ground"]] call BIS_fnc_randomPos; //this is where the unit will go
_wp2 = _heligroup addWaypoint [_position,0];
_wp2 setWaypointType "MOVE";
_wp2 setWaypointSpeed "Full";
_wp2 setWaypointBehaviour "Aware";
_wp setWaypointStatements ["true", deleteVehicle _supplyheli;];

 

Share this post


Link to post
Share on other sites

so if i understand you correctly,  all i need is 1 trigger and 1 marker?  i dont need anything from the systems menu?    When i place 1 trigger and try to insert the script (after replacing "yourtriggername" with "triggersupply1"  i get an error ...

http://puu.sh/Gz7eK/d03116bea5.jpg

 

i added this to my trigger in the on activation:

hint "HEADQUARTERS: A supply drop is inbound.  Ditch the wet suits and gear up, but quickly as enemy forces will certainly see the supply drop and may take action.";_position = (triggersupply1 getRelPos [(random ((triggerArea triggersupply1) select 0)), random(360)]);// this will be the random   
position of the supply the location of the trigger is very important because in its area will the drop detached.The trigger must be   
circle! 
_posheli = getMarkerPos "supply1"  <do i need these quotes or no quotes???
_supplyheli = createVehicle ["rhs_uh1h_hidf", , [], 0, "FLY"]; 
_helicrew = createVehicleCrew _supplyheli; 
//here goes your supply attachment script 
_heligroup = group (_helicrew select 0); 
_wp = _heligroup addWaypoint [_position,0]; 
_wp setWaypointType "MOVE"; 
_wp setWaypointSpeed "Full"; 
_wp setWaypointBehaviour "Aware"; 
_wp setWaypointStatements ["true", here goes your supply detachment script]; 
 
_randomPosMapNoLand = [nil, ["ground"]] call BIS_fnc_randomPos; //this is where the unit will go 
_wp2 = _heligroup addWaypoint [_position,0]; 
_wp2 setWaypointType "MOVE"; 
_wp2 setWaypointSpeed "Full"; 
_wp2 setWaypointBehaviour "Aware"; 
_wp setWaypointStatements ["true", deleteVehicle _supplyheli;];

Share this post


Link to post
Share on other sites

I have to test it.I did not tested it yet

Wait a minute

yes you need 1 marker and one trigger.But you have to place the attach and detach code where i wrote it ,also your trigger area could be greater than 25 25 

oh i forgot the spawn posiotn of the heli

 

Share this post


Link to post
Share on other sites

i will certainly change the dimensions of the area, this was just a quick test... i updated my prior post with the exact script i had used....   But can you explain what you mean about the attach and detach code....   thank you for your patience

Share this post


Link to post
Share on other sites
2 minutes ago, wingtip said:

i will certainly change the dimensions of the area, this was just a quick test... i updated my prior post with the exact script i had used....   But can you explain what you mean about the attach and detach code....   thank you for your patience

pls wait until i fix the code ,havent tested it and i will post it for you also meanwhile please tell me what is your supply drop or what do you weant for supply?

Share this post


Link to post
Share on other sites

well the blufor starts out in diving gear and are dropped into the water... once they make their way to the beach  they cant do the rest of the mission in wet gear as their carrying capacity is very limited and the underwater rifle sucks.....     so i can either drop an arsenal so the player can make any loadout they want or i can make a supply drop with specific uniforms and gear but i think that would be making it to complicated and time consuming to edit when a arsenal would be much quicker to edit in...

Share this post


Link to post
Share on other sites

@wingtip,
Here's a simple function to get you started,

Spoiler

YOU_fnc_supplyDrop=
{	params [["_caller", player, [objNull]]];

	private _pos = [_caller, 3000, 5000, 3, 0, 20, 0] call BIS_fnc_findSafePos;
	_veh= createVehicle ["B_heli_light_01_f", _pos,[],0, "FLY"];
	_veh allowDamage false;
	_grp=createVehicleCrew _veh;
	_grp setBehaviour "CARELESS";
	you_supply= _veh;
	you_recieve= _caller;
	[_grp, group _caller, 10, 0, {you_supply distance you_recieve <200}, 2] spawn BIS_fnc_stalk;
	(leader _grp) sideChat "Supplies En Route";

waitUntil {sleep 1; _veh distance _caller < 200};

	(leader _grp) sideChat "Supplies Deployed";
	_vehPos= getPosASL _veh;
	[_veh, _vehPos, _caller] spawn {
		sleep 1;
		_obj = "B_cargoNet_01_ammo_f" createVehicle getPos (_this select 0);
		_obj setPosASL (_this select 1);
		_signal = "SmokeShellGreen_infinite" createVehicle getPos _obj;
		_signal attachTo [_obj, [0,0,0]];
		waitUntil {sleep 1; _obj distance (_this select 2) < 5};
		deleteVehicle _signal;
	};
waitUntil {sleep 1; _veh distance _caller > 2000};

	deleteVehicle _veh;
	{deleteVehicle _x} forEach units _grp;
};

You can customize all the spawned objects (vehicle, smoke shell color, cargo type).

Spawn the function any time with,


[]spawn YOU_fnc_supplyDrop;

Add the caller to the params array, it defaults to "player".

Have fun!

  • Like 1

Share this post


Link to post
Share on other sites
4 minutes ago, wogz187 said:

@wingtip,
Here's a simple function to get you started,

  Reveal hidden contents


YOU_fnc_supplyDrop=
{	params [["_caller", player, [objNull]]];

	private _pos = [_caller, 3000, 5000, 3, 0, 20, 0] call BIS_fnc_findSafePos;
	_veh= createVehicle ["B_heli_light_01_f", _pos,[],0, "FLY"];
	_veh allowDamage false;
	_grp=createVehicleCrew _veh;
	_grp setBehaviour "CARELESS";
	you_supply= _veh;
	you_recieve= _caller;
	[_grp, group _caller, 10, 0, {you_supply distance you_recieve <200}, 2] spawn BIS_fnc_stalk;
	(leader _grp) sideChat "Supplies En Route";

waitUntil {sleep 1; _veh distance _caller < 200};

	(leader _grp) sideChat "Supplies Deployed";
	_vehPos= getPosASL _veh;
	[_veh, _vehPos, _caller] spawn {
		sleep 1;
		_obj = "B_cargoNet_01_ammo_f" createVehicle getPos (_this select 0);
		_obj setPosASL (_this select 1);
		_signal = "SmokeShellGreen_infinite" createVehicle getPos _obj;
		_signal attachTo [_obj, [0,0,0]];
		waitUntil {sleep 1; _obj distance (_this select 2) < 5};
		deleteVehicle _signal;
	};
waitUntil {sleep 1; _veh distance _caller > 2000};

	deleteVehicle _veh;
	{deleteVehicle _x} forEach units _grp;
};

You can customize all the spawned objects (vehicle, smoke shell color, cargo type).

Spawn the function any time with,



[]spawn YOU_fnc_supplyDrop;

Add the caller to the params array, it defaults to "player".

Have fun!

Yeah this is much simplier

Share this post


Link to post
Share on other sites

thats done with a trigger or via the radio commands?  Im a noob at mission editing so where are you placing this script wogz??   I will start replacing/editing with the correct veh name etc while i wait for another reply... thank you ....   i hope spriterfight you continue with the method you were describing as well for comparison....    I may also post the example mission file i found that does the supply drop via system modules if i can figure out how to tweak its contents for use in my mission...

Share this post


Link to post
Share on other sites

_position = (trg1 getRelPos [(random ((triggerArea trg1) select 0)), random(360)]);
_posheli = getMarkerPos "helispawn";
_supplyheli = createVehicle ["rhs_uh1h_hidf", _posheli, [], 0, "FLY"];
createVehicleCrew _supplyheli;
_supplyhelicrew = crew _supplyheli;
_heligroup = group (_supplyhelicrew select 0);

_wp = _heligroup addWaypoint [_position,0];
_wp setWaypointType "MOVE";
_wp setWaypointSpeed "Full";
_wp setWaypointBehaviour "Aware";
waitUntil {_supplyheli distance _position < 100};
_para = createVehicle ["B_Parachute_02_F", [0,0,100], [], 0, ""];
_para attachTo [_supplyheli, [0, 0, -3]];
detach _supplycrate;
_supplycrate attachTo [_para,[0,0,-2]];
detach _para;
_supplycrate addEventHandler ["InventoryOpened", {
	params ["_unit", "_container"];

	[ "AmmoboxInit", [ _supplycrate, true, {(_this distance _target) < 1} ] ] call BIS_fnc_arsenal;
}];

_randomPosMapNoLand = [nil, ["ground"]] call BIS_fnc_randomPos;
_wp2 = _heligroup addWaypoint [_randomPosMapNoLand,0];
_wp2 setWaypointType "MOVE";
_wp2 setWaypointSpeed "Full";
_wp2 setWaypointBehaviour "Aware";
_wp2 setWaypointStatements ["true", "deleteVehicle _supplyheli"];

trg1 is your trigger area ,you can activate it with the radio or whatever you want

  • Like 1

Share this post


Link to post
Share on other sites

@wingtip,

Quote

thats done with a trigger or via the radio commands? 

You may call the function from anywhere, any time. Trigger activation, event handler, addAction, whatever you like.
For example just paste this in the On Activation field of a trigger,

[]spawn YOU_fnc_supplyDrop;

 

Quote

...so where are you placing this script wogz??

You may paste the function just about anywhere code will stick. Init.sqf, Attributes Init dialog, a units init dialog-- it just needs to be loaded.
 

Quote

 I will start replacing/editing with the correct veh name etc while i wait for another reply...

Oh no! Please don't do that! Replace the stings for the objects to customize, like this,

Find:
"B_heli_light_01_f"
and replace with,
"rhs_uh1h_hidf"

You can do the same for the cargo box and the smoke shell color.

Have fun!

  • Like 1

Share this post


Link to post
Share on other sites

yes thats what i meant and did, only the object names .....    im still confused a little on your method...right now im testing spriter's updated script...

Share this post


Link to post
Share on other sites
3 minutes ago, wingtip said:

yes thats what i meant and did, only the object names .....    im still confused a little on your method...right now im testing spriter's updated script...

Just put this in the trigger's activation ,the trigger is name should be trg1  and you can choose if you want it by radio or if the player movea in the trigger area.also make a marker where do you want the heli to spawn and name it "helispawn"

Share this post


Link to post
Share on other sites

Ok, this is starting to work somewhat lol......  its now spawning the heli instantly without me being in the trigger area despite it being set to blufor/present and immediately drops its supply drop soon as it spawns in....i also need to add the smoke script in so blufor can find it in the thick jungle

 

   also getting an error

 

http://puu.sh/Gz8NM/ace70fa59e.jpg

Share this post


Link to post
Share on other sites

You set the marker too close to the trigger area thats why it drops its supply instantly

Thats why you got the error because it was closer than 100 already

Share this post


Link to post
Share on other sites

@wingtip,

Quote

im still confused a little on your method..

The function spawns a helicopter between 3-5 km away from the caller (defaults to player). The helicopter automatically flies to the caller. When within distance the chopper drops a cargo box (we can fit a parachute on there if you prefer). The helicopter then flies back to its original position and deletes itself.

When the caller reaches the cargo box the smoke effect is deleted.

You can request supplies any time (with a button for example) but the easiest way to implement it is to paste the whole function in your character's init dialog and the spawn call,

[]spawn YOU_fnc_supplyDrop;

in your trigger's On Activation field.

Have fun!
 

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×