Jump to content

Recommended Posts

Hi All,

I am using ACE 3 and RHS. 
My goal is to paradrop some crates when C130 reaches a waypoint.

I created a box which is on ground and want to load it into C130 by a code.

Any idea how to do this with ACE3 load?
I thought loadcargo [box, c130, false] 

Should do the trick but didn't work out.

In addition to that simple unload cargo will drop the box with parachute right?

Share this post


Link to post
Share on other sites

You can do an airdrop with vanilla support modules.  I would not suggest using the c130. I just tried it and the AI didn't do very well and took to long to get lined up, taking two passes at least to get lined up.  The supply drop module has an init line that you can call your crate contents with.  

Share this post


Link to post
Share on other sites

Hi All,

I am using ACE 3 and RHS. 

My goal is to paradrop some crates when C130 reaches a waypoint.

I created a box which is on ground and want to load it into C130 by a code.

Any idea how to do this with ACE3 load?

I thought loadcargo [box, c130, false] 

Should do the trick but didn't work out.

In addition to that simple unload cargo will drop the box with parachute right?

 

You could attach the crate to the plane, detect when the plane is near the waypoint, and then detach the crate when its near.

 

Put this in the init of the crate and name your crate something like "Crate1" and name the plane something like "Plane".

this disableCollisionWith plane; //Just in case they collide, no boom
this attachTo [plane,[0,0,-1]]; //attach it to the plane, fiddle with the position

You can use a trigger to make the plane drop the crate.

Put this in the condition field of the trigger:

Plane in thisList;

Put this in the act field of the trigger:

detach Crate1; //off it goes
Chute = "B_Parachute_02_F" createVehicle position Crate1; //Create the chute
Chute attachTo [Crate1, [0,0,1]]; // attach the chute to the crate

You'll have to mess around with it, its not tested but should work.

Share this post


Link to post
Share on other sites

I will give a try to that one but I don't know why such simple action needs scripting in the first place :(
Plane should paradrop the objects if the waypoint is "unload cargo"...

Share this post


Link to post
Share on other sites

I will give a try to that one but I don't know why such simple action needs scripting in the first place :(

Plane should paradrop the objects if the waypoint is "unload cargo"...

This is what I use. Scripting sometimes gives you more options which previously you might not have had.

 

/*
	Author: HallyG
	Spawns a supply drop of desired object.

	Arguments(s):
	0: Supply Drop Object (classname) to spawn - <STRING>
	1: Supply Drop Centre - <MARKER, OBJECT, LOCATION, GROUP, TASK, POSITION>
	2: Supply Drop Height - <SCALAR>
	3: Supply Drop attachTo Position - <ARRAY>

	Return Value:
	<OBJECT>
	
	Example:
	[
		"CargoNet_01_box_F",
		position player,
		100,
		[0,0,-1.2],
		WEST
	] call FUNCTIONNAME
__________________________________________________________________*/
params [
	["_object", "CargoNet_01_box_F", [""]],
	["_centre", [0, 0, 0], ["", objNull, taskNull, locationNull, [], grpNull], [3]],
	["_height", 100, [0]],
	["_attachTo", [0, 0, -1.2], [[]], [3]]
];

_centre = _centre call {
	if (_this isEqualType objNull) exitWith {getPosASL _this};
	if (_this isEqualType grpNull) exitWith {getPosASL (leader _this)};
	if (_this isEqualType "") exitWith {getMarkerPos _this};
	if (_this isEqualType locationNull) exitWith {locationPosition _this};
	if (_this isEqualType taskNull) exitWith {taskDestination  _this};
	if (_this isEqualType []) exitWith {_this};
	[0, 0, 0]
};

if (!(isClass (configfile >> "cfgVehicles" >> _object)) || _centre isEqualTo [0, 0, 0]) exitWith {
	objNull
};

private _obj = createVehicle [_object, _centre vectorAdd [0, 0, _height], [], 0, "NONE"]; 
private _para = createVehicle ["B_parachute_02_F", [0,0,0], [], 0, "FLY"];

_para setDir getDir _obj;
_para setPos getPos _obj;
_obj lock false;
_obj attachTo [_para, _attachTo];

[_obj, _para] spawn {
	params ["_obj","_para"];
		
	waitUntil {
		sleep 0.01;
		((position _obj) select 2) < 2 
		|| 
		isNull _para 
		|| 
		(count (lineIntersectsWith [getPosASL _obj, (getPosASL _obj) vectorAdd [0, 0, -0.5], _obj, _para])) > 0
	};
		
	_para disableCollisionWith _obj;
	_obj setVectorUp [0,0,1];
	_obj setVelocity [0,0,0];
	detach _obj;
		
	if (!isNull _para) then {deleteVehicle _para};

	(format ["A supply drop has touched down, grid %1.", mapGridPosition getPosATL _obj]) remoteExec ["systemChat", 0, false]; 
};

_obj 

 

  • Like 1

Share this post


Link to post
Share on other sites

I just noticed that RHS mod brings new waypoints. There is paradrop cargo waypoint which works perfectly (at least in mission review). I will try it now in dedicated server

Share this post


Link to post
Share on other sites
On 9/12/2016 at 10:22 PM, hallyg said:

This is what I use. Scripting sometimes gives you more options which previously you might not have had.

 


/*
	Author: HallyG
	Spawns a supply drop of desired object.

	Arguments(s):
	0: Supply Drop Object (classname) to spawn - <STRING>
	1: Supply Drop Centre - <MARKER, OBJECT, LOCATION, GROUP, TASK, POSITION>
	2: Supply Drop Height - <SCALAR>
	3: Supply Drop attachTo Position - <ARRAY>

	Return Value:
	<OBJECT>
	
	Example:
	[
		"CargoNet_01_box_F",
		position player,
		100,
		[0,0,-1.2],
		WEST
	] call FUNCTIONNAME
__________________________________________________________________*/
params [
	["_object", "CargoNet_01_box_F", [""]],
	["_centre", [0, 0, 0], ["", objNull, taskNull, locationNull, [], grpNull], [3]],
	["_height", 100, [0]],
	["_attachTo", [0, 0, -1.2], [[]], [3]]
];

_centre = _centre call {
	if (_this isEqualType objNull) exitWith {getPosASL _this};
	if (_this isEqualType grpNull) exitWith {getPosASL (leader _this)};
	if (_this isEqualType "") exitWith {getMarkerPos _this};
	if (_this isEqualType locationNull) exitWith {locationPosition _this};
	if (_this isEqualType taskNull) exitWith {taskDestination  _this};
	if (_this isEqualType []) exitWith {_this};
	[0, 0, 0]
};

if (!(isClass (configfile >> "cfgVehicles" >> _object)) || _centre isEqualTo [0, 0, 0]) exitWith {
	objNull
};

private _obj = createVehicle [_object, _centre vectorAdd [0, 0, _height], [], 0, "NONE"]; 
private _para = createVehicle ["B_parachute_02_F", [0,0,0], [], 0, "FLY"];

_para setDir getDir _obj;
_para setPos getPos _obj;
_obj lock false;
_obj attachTo [_para, _attachTo];

[_obj, _para] spawn {
	params ["_obj","_para"];
		
	waitUntil {
		sleep 0.01;
		((position _obj) select 2) < 2 
		|| 
		isNull _para 
		|| 
		(count (lineIntersectsWith [getPosASL _obj, (getPosASL _obj) vectorAdd [0, 0, -0.5], _obj, _para])) > 0
	};
		
	_para disableCollisionWith _obj;
	_obj setVectorUp [0,0,1];
	_obj setVelocity [0,0,0];
	detach _obj;
		
	if (!isNull _para) then {deleteVehicle _para};

	(format ["A supply drop has touched down, grid %1.", mapGridPosition getPosATL _obj]) remoteExec ["systemChat", 0, false]; 
};

_obj 

 

 

Great script exploring it further, it's simple well written and nicely documented !

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

×