Jump to content

Recommended Posts

This script/FSM gives the functionality for resupply drop in MP/SP scenario.

Created because the bis support resupply drop  is not working in MP currently.

 

This is similar to support virtual resupply drop module, gives the possibility to select aircraft types, box types and its init by editing the

 

support\supplydrop.sqf

//*************************** editable **************************//

private _heliclass = selectRandom [

	"B_Heli_Transport_03_F",
	"B_Heli_Transport_01_F",
	"B_Heli_Transport_01_camo_F",
	"B_Heli_Transport_03_unarmed_F",
	"B_T_VTOL_01_vehicle_F"

];
private _boxclass = selectRandom [

	"B_supplyCrate_F",
	"Box_NATO_AmmoVeh_F",
	"B_CargoNet_01_ammo_F"

];

private _chuteType = "B_Parachute_02_F";
private _boxCode = compile "null = [_this] spawn fnc_dropboxinit;";
private _helistart = "helistartpos";// marker where the heli spawns or position array [posX,posY,posZ]

//*************************** editable **************************//

Usage:

Edit the above to fit your needs.

For helicopter spawn position create a marker somewhere on the map in editor or use  position array.

Set it for _helistart variable value.

 

Copy paste all files (besides mission.sqm) from example mission to your mission or if your mission contains those files merge the files  content.

 

Check init.sqf for this part.

	//if you want to limit support to certain units add its classnames to the aray below
	//last entry without comma at the end
	//uncomment "All" if you want it for all players
	private _givesupport = [

		//"All",
		"B_Soldier_SL_F",
		"B_Soldier_TL_F"
		
	];
	

Edit/add your desired class names  which players will have the drop menu available or Un-comment "All" for all players.

 

Edit support\dropbox.sqf as you  want. Currently only arsenal,smoke,and IR added.

 

Put an Headquarters entity module (found in systems > Intel ) with:

VARIABLE NAME - hq_suppcomm
SIDE - select  player side
CALLISGN - NATO
CUSTOM CALLISGN - your custom callisgn (will be displayed  with radio sentences)
SPEAKER - not important 

That guy will handle the radio communications for you.

 

 

	//supply drop aka bis virtual support drop provider module
	//created by DaVidoSS for MP functionality
	
if (isDedicated) exitWith {};
	
params [	
["_caller",objNull,[objNull]],
["_position",[],[[]]]	
];

if (isNull _caller) exitWith {};
if !(local _caller) exitWith {};

if (!(isNull objectParent _caller) && {(speed (vehicle _caller)) > 5}) exitWith {

	hint "You cannot call support while driving a vehicle. Stop first"
};

if !(missionNamespace getVariable "drop_ready") exitWith {
	
	null = [_caller] spawn {
		
		params ["_player"];
			
		if (isNull objectParent _player) then {
			
			null = [_player, ["RequestSupplyDrop", 100, 1]] remoteExec ["say3D", [0,-2] select isDedicated, false];
				
		} else {
			
			null = [
			(vehicle _player),
			"Requesting supply drop at the transmitted coordinates.Over!"
			] remoteExecCall ["vehicleChat", (crew (vehicle _player)) select {isPlayer _x}, false];
			
		};
		sleep 4;
		null = [hq_suppcomm, "heli_unresponsive"] remoteExec ["sideRadio", side _player, false];
			
		if (random 1 < 0.25) then {
			
			sleep 4;
			if (isNull objectParent _player) then {
				
				null = [_player, ["fucksake", 100, 1]] remoteExec ["say3D", [0,-2] select isDedicated, false];
					
			} else {
				
				null = [
					(vehicle _player),
					"Ooh for fuck sake!"
				] remoteExecCall ["vehicleChat", (crew (vehicle _player)) select {isPlayer _x}, false];
			};
		};
			
	};
};
	
if !(isNull objectParent _caller) then {
	
	_position = getPos (vehicle _caller);
		
} else {
	
	if (_position isEqualTo []) then {
	
		_position = getPos _caller;
	};
};
	
//*************************** editable **************************//

private _heliclass = selectRandom [

	"B_Heli_Transport_03_F",
	"B_Heli_Transport_01_F",
	"B_Heli_Transport_01_camo_F",
	"B_Heli_Transport_03_unarmed_F",
	"B_T_VTOL_01_vehicle_F"

];
private _boxclass = selectRandom [

	"B_supplyCrate_F",
	"Box_NATO_AmmoVeh_F",
	"B_CargoNet_01_ammo_F"

];

private _chuteType = "B_Parachute_02_F";
private _boxCode = compile "null = [_this] spawn fnc_dropboxinit;";
private _helistart = "helistartpos";// marker where the heli spawns or position array [posX,posY,posZ]

//*************************** editable **************************//
private _side = side _caller;

if (typeName _helistart == "STRING") then  {

	_helistart = getMarkerPos _helistart;

};

if (isNull objectParent _caller) then {
	
	null = [_caller, ["RequestSupplyDrop", 100, 1]] remoteExec ["say3D", [0,-2] select isDedicated, false];
		
} else {
	
	null = [
	(vehicle _caller),
	"Requesting supply drop at the transmitted coordinates.Over!"
	] remoteExecCall ["vehicleChat", (crew (vehicle _caller)) select {isPlayer _x}, false];
};

null = [[_caller,_position,_heliclass,_boxclass,_chuteType,_boxCode,_helistart,_side],
AIR_SUPPORT_PATH+"supplydrop.fsm"] remoteExec ["execFSM",2,false];

missionNamespace setVariable ["drop_ready",false,true];

 

 

Download:

 

GoogleDrive V1.3

  • Like 3

Share this post


Link to post
Share on other sites

Update.

V 1.1

Small fix for event, when helicopter is on his way to base and get killed - was immediately deleted.

 

GoogleDrive V1.1

Share this post


Link to post
Share on other sites

UPDATE

Version 1.2

Changelog:

*Switched to FSM

*Switched execution to server

*Improved scripting

Share this post


Link to post
Share on other sites

The FSM file looks sexy, a very clean way to write things like that. Good job!

  • Like 1

Share this post


Link to post
Share on other sites

Thanks for this.  Got it working for my missions,  but only locally.  In MP on dedicated server the supply drop icon does not even appear (works for same mission loxally).  Anything i miss? 

Share this post


Link to post
Share on other sites

The radio comm's are added locally by this part:

 

if (hasInterface) then {

	fnc_supplydrop = compileFinal preProcessFileLineNumbers "support\supplydrop.sqf";
	
	//if you want to limit support to certain units add its classnames to the aray below
	//last entry without comma at the end
	//uncomment "All" if you want it for all players
	private _givesupport = [

		//"All",
		"B_Soldier_SL_F",
		"B_Soldier_TL_F"
		
	];
	
	if ((typeOf player) in _givesupport || {"All" in _givesupport}) then {
	
		null = [player, "supplydrop"] call BIS_fnc_addCommMenuItem;//add radio link
		
	};
};

Try move this part to the initPlayerLocal.sqf, maybe your init.sqf are busy in some loop or wait's above this code

Share this post


Link to post
Share on other sites

Hey,

 

thanks for the reply. With this it works, but only if I am alone on the server. As soon as another player joins, I / he can call the support, radio message comes but no helicopter... 

 

works fine now. Thanks!

Share this post


Link to post
Share on other sites

UPDATE

Version 1.3

Changelog:

*fixed unitready statement which causing sometimes  no box dropp on dedicated.

 

Share this post


Link to post
Share on other sites

Hey, i got no hope that someone will answer but i want to use your script for exile where the 0-8 combination can not be used. can u tell me how the menu ist caloled so i can open like this:

 

showCommandingMenu "";
showCommandingMenu "#USER:supplydrop";

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

×