Jump to content
Sign in to follow this  
Zombitch

Drop an object from the air (with a parachute)

Recommended Posts

Hi guys,

I've done a lot of googling before posting but I don't succeed to make it work. So the thing I would like to do is the following :

1) Spawn a vehicle in the air

2) Attach a parachute to the vehicle.

For the first step I make it doing this (and it works) :

_vehicle = "C_SUV_01_F" createVehicle (getPos player);
_vehicle setPosATL (_vehicle modelToWorld[0,0,200]);

But when I want to attach a parachute to that vehicle it just does nothing; I tried to attach parachute doing this :

_parachute = "ParachuteMediumWest" createVehicle (getpos _vehicle);
_parachute setpos (_vehicle ModelToWorld [0,0,3]);
_vehicle attachTo [_parachute, [0, 0, 0]];

When I run this code it does nothing : I don't see the parachute deploying.

Any idea ?

I really really would like to make it by scripting and not using the "supplyDrop BIS function".

Thanks.

Share this post


Link to post
Share on other sites
_para = createVehicle ["B_Parachute_02_F", [0,0,100], [], 0, ""];
_para setPosATL (player modelToWorld[0,0,200]);
_veh = createVehicle ["C_SUV_01_F", [0,0,80], [], 0, ""];
_veh attachTo [_para,[0,0,0]]; 

// Land safely
WaitUntil {((((position _veh) select 2) < 0.6) || (isNil "_para"))};
detach _veh;
_veh SetVelocity [0,0,-5];           
sleep 0.3;
_veh setPos [(position _veh) select 0, (position _veh) select 1, 1];
_veh SetVelocity [0,0,0];  

Edited by kylania
  • Like 1

Share this post


Link to post
Share on other sites

Wrong parachute name..

_para = "B_Parachute_02_F";


_vehicle = "C_SUV_01_F" createVehicle (getPos player);
_vehicle setPosATL (_vehicle modelToWorld[0,0,200]);



        _DropPos1 = getpos _vehicle;

        _Chute1 = createVehicle [_para, _DropPos1, [], 0, "NONE"];

_chute1 attachTo [_vehicle, [0, 0, 1]];

As usual your man Kylania sets the tone :)

Share this post


Link to post
Share on other sites
_para = createVehicle ["B_Parachute_02_F", [0,0,100], [], 0, ""];
_para setPosATL (player modelToWorld[0,0,200]);
_veh = createVehicle ["C_SUV_01_F", [0,0,80], [], 0, ""];
_veh attachTo [_para,[0,0,0]]; 

// Land safely
WaitUntil {((((position _veh) select 2) < 0.6) || (isNil "_para"))};
detach _veh;
_veh SetVelocity [0,0,-5];           
sleep 0.3;
_veh setPos [(position _veh) select 0, (position _veh) select 1, 0.6];

Awesome. This works!

I modified it a little bit to spawn a Hunter below the supply drop Helicopter (heli). I put this

_para = createVehicle ["B_Parachute_02_F", [0,0,100], [], 0, ""];

_para setPosATL (heli modelToWorld[0,0,-15]);

_veh = createVehicle ["B_MRAP_01_F", [0,0,80], [], 0, ""];

_veh attachTo [_para,[0,2,-0.3]];

WaitUntil {((((position _veh) select 2) < 0.6) || (isNil "_para"))};

detach _veh;

_veh SetVelocity [0,0,-5];

sleep 0.3;

_veh setPos [(position _veh) select 0, (position _veh) select 1, 0.6];

into the Init of the module. Everything seems to work but a ammobox spawns on the ground and a second parachute with nothing attached in the air.

Furthermore sometimes I can't start the engine of the hunter but I can get in.

Can you guys help me to delete the ammobox and the parachute and explain why I sometimes can't drive the Hunter?

Ok now i can't start the hunters engine every time.

I tried forcing it on and it does not work:

_para = createVehicle ["B_Parachute_02_F", [0,0,100], [], 0, ""];

_para setPosATL (heli modelToWorld[0,0,-15]);

_veh = createVehicle ["B_MRAP_01_F", [0,0,80], [], 0, ""];

_veh attachTo [_para,[0,2,-0.4]];

WaitUntil {((((position _veh) select 2) < 0.6) || (isNil "_para"))};

detach _veh;

_veh SetVelocity [0,0,-5];

sleep 0.3;

_veh setPos [(position _veh) select 0, (position _veh) select 1, 0.6];

_veh engineOn true;

Edited by Ghosthawk

Share this post


Link to post
Share on other sites
_para = createVehicle ["B_Parachute_02_F", [0,0,100], [], 0, ""];
_para setPosATL (player modelToWorld[0,0,200]);
_veh = createVehicle ["C_SUV_01_F", [0,0,80], [], 0, ""];
_veh attachTo [_para,[0,0,0]]; 

// Land safely
WaitUntil {((((position _veh) select 2) < 0.6) || (isNil "_para"))};
detach _veh;
_veh SetVelocity [0,0,-5];           
sleep 0.3;
_veh setPos [(position _veh) select 0, (position _veh) select 1, 0.6];

The SUV is undrivable once it lands???

Share this post


Link to post
Share on other sites
The SUV is undrivable once it lands???

Something changed and it's keeping the velocity that prevented it from bumping and exploding. Just add this as the last line:

_veh SetVelocity [0,0,0];  

I fixed the post above.

Share this post


Link to post
Share on other sites
Something changed and it's keeping the velocity that prevented it from bumping and exploding. Just add this as the last line:

_veh SetVelocity [0,0,0];  

I fixed the post above.

Does not work for me. Still can't start the engine.

Share this post


Link to post
Share on other sites

Hmm, yeah where I was testing it it was working, but I moved and it got stuck again.

Setting the final height to 1m up seemed to free it in 20 different locations on Altis, so change the 0.6 in the 2nd to last line to 1. Give that a shot. :)

Share this post


Link to post
Share on other sites
Hmm, yeah where I was testing it it was working, but I moved and it got stuck again.

Setting the final height to 1m up seemed to free it in 20 different locations on Altis, so change the 0.6 in the 2nd to last line to 1. Give that a shot. :)

_para = createVehicle ["B_Parachute_02_F", [0,0,100], [], 0, ""];

_para setPosATL (heli modelToWorld[0,0,-15]);

_veh = createVehicle ["C_SUV_01_F", [0,0,80], [], 0, ""];

_veh attachTo [_para,[0,2,-0.4]];

WaitUntil {((((position _veh) select 2) < 1) || (isNil "_para"))};

detach _veh;

_veh SetVelocity [0,0,-5];

sleep 0.3;

_veh setPos [(position _veh) select 0, (position _veh) select 1, 1];

_veh SetVelocity [0,0,0];

That does not work. Or what did you mean?

Share this post


Link to post
Share on other sites

That's what I'm using and it's working for me. How are you running that script?

Share this post


Link to post
Share on other sites
That's what I'm using and it's working for me. How are you running that script?

I have it in the Init of the Support Heli Module.

Share this post


Link to post
Share on other sites

Ooooh, yeah, no, that's meant to be used standalone from a trigger or something instead of the support module. No idea how it would work within a module. :)

Share this post


Link to post
Share on other sites
Ooooh, yeah, no, that's meant to be used standalone from a trigger or something instead of the support module. No idea how it would work within a module. :)

Everything works fine (the parachute etc..) but i sometimes can't drive the vehicle.

I think it should be the same.

Share this post


Link to post
Share on other sites
_para = createVehicle ["B_Parachute_02_F", [0,0,100], [], 0, ""];
_para setPosATL (player modelToWorld[0,0,200]);
_veh = createVehicle ["C_SUV_01_F", [0,0,80], [], 0, ""];
_veh attachTo [_para,[0,0,0]]; 

// Land safely
WaitUntil {((((position _veh) select 2) < 0.6) || (isNil "_para"))};
detach _veh;
_veh SetVelocity [0,0,-5];           
sleep 0.3;
_veh setPos [(position _veh) select 0, (position _veh) select 1, 1];
_veh SetVelocity [0,0,0];  

I get a local variable error in my Trigger. How can I fix that?

Share this post


Link to post
Share on other sites

Remove all the _ or put that in a script and call the script from the trigger instead of the code.

Share this post


Link to post
Share on other sites

Still not working with:

_veh setPos [(position _veh) select 0, (position _veh) select 1, 1];

_veh SetVelocity [0,0,0];

You cant start the engine of the vehicle. Any idea ?

Share this post


Link to post
Share on other sites

I just copied and pasted the above script and it works fine here.

I suspect the engine is flooded make sure your not spawning it in the sea.

That will result in engine failure.

Share this post


Link to post
Share on other sites

If you spawn the object in the air you can actually then just do:

[objnull, _object] call BIS_fnc_curatorobjectedited;

First parameter is curator object, second is the object to be given a parachute

  • Like 1

Share this post


Link to post
Share on other sites
I just copied and pasted the above script and it works fine here.

I suspect the engine is flooded make sure your not spawning it in the sea.

That will result in engine failure.

Then we have a differend "version" of ArmA3, it does not work for me...engine does not start. :(

Ok, now it works with this code:

    _chuteType = "B_Parachute_02_F";    //parachute for blufor, for opfor and greenfor replace the 'B' with 'O' or 'G' respectively

   _chute = createVehicle [_chuteType, [100, 100, 200], [], 0, 'FLY'];
   _chute setPos [getMarkerPos "drop_target" select 0, getMarkerPos "drop_target" select 1, 100];
   _drop = createVehicle [_supply, position _chute, [], 0, 'NONE'];
   _drop attachTo [_chute, [0, 0, -1.3]];
   waitUntil {position _drop select 2 < 0.5 || isNull _chute};
   detach _drop;
   _drop setPos [position _drop select 0, position _drop select 1, 0];

Edited by Wiggum

Share this post


Link to post
Share on other sites

all these do is place a Hunter right on top of the marker i placed. It does not attatch it to the chute. The chute is flying while Hunter is placed on the ground.

Share this post


Link to post
Share on other sites

Still working here do as follows

place your marker "drop_target"

place this in a gamelogic init or trigger

null=["B_MRAP_01_F"] execvm "drop.sqf"

save as drop.sqf

_supply = _this select 0;
   _chuteType = "B_Parachute_02_F";   
   _chute = createVehicle [_chuteType, [100, 100, 200], [], 0, 'FLY'];
   _chute setPos [getMarkerPos "drop_target" select 0, getMarkerPos "drop_target" select 1, 100];
   _drop = createVehicle [_supply, position _chute, [], 0, 'NONE'];
   _drop attachTo [_chute, [0, 0, -1.3]];
   waitUntil {position _drop select 2 < 0.5 || isNull _chute};
   detach _drop;
   _drop setPos [position _drop select 0, position _drop select 1, 0];

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
Sign in to follow this  

×