Jump to content
Sign in to follow this  
waigl

Spawning a flying helicopter with a sling load attached over water

Recommended Posts

Hi,

I am trying to spawn a helicopter that is supposed to bring the players some cargo to a predefined point on the island, drop the cargo, then fly away again. Since I want the helicopter spawning in on the edge of the map, it will have to spawn over water (I'm playing on Altis). Suppose I want a Chinook to bring me a Humvee, I would do this:

_spawnpos = [30718.199, -185.97, 200];
_CH47F = createVehicle ["RHS_CH_47F", _spawnpos, [], 0, "FLY"];
createVehicleCrew (_CH47F);
_cargo =  "rhsusf_m1025_d" createVehicle _spawnpos;
_CH47F setSlingLoad _cargo;

That code kinda works, but there are two problems:

  1. The z-coordinate of _spawnpos seems to have no effect whatsoever. I have no idea how to make things spawn at a given altitude in the air, as opposed to directly on the land/water.
  2. More importantly, roughly 50% of the time, the Humvee will sink into the sea before it can be slingload-attached to the helicopter.

Does anybody have an idea how to make this work more reliably?

Share this post


Link to post
Share on other sites

1. was a terrible riddle I had to solve for myself back in the days.

You can easily do something like:

_spawnpos set [2,1500];

to set the height to 1500m.

If that's not what you meant you probably were talking about the spawned chopper not being in the altitude,

after spawning the chopper you simply put

_spawnpos set [2,1500];
_chopper setposatl _spawnpos;

then the chopper is flying at 1500m.

Same goes for the humvee.

_spawnpos = [30718.199, -185.97, 200];
_CH47F = createVehicle ["RHS_CH_47F", _spawnpos, [], 0, "FLY"];
_spawnpos set [2,1500];
_CH47F setposatl _spawnpos;
createVehicleCrew (_CH47F);
_spawnpos set [2,1000]; // so the humvee doesnt collide with the chopper
_cargo =  "rhsusf_m1025_d" createVehicle _spawnpos;
_cargo setposatl _spawnpos;
_CH47F setSlingLoad _cargo;

For the setSlingLoad command it doesnt matter where the cargo is, it will be attached to the chopper, so spawn it anywhere, doesnt have to be in the air.

Edited by Grumpy Old Man
  • Like 1

Share this post


Link to post
Share on other sites

Thanks Grumpy Old Man, it works better like that - although I think altitudes of 200 meters and 195 meters are more appropriate for a helicopter and its cargo :).

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  

×