Jump to content
Sign in to follow this  
Stewe231

Spawning Vehicles with addaction at Carrier Height

Recommended Posts

I've been trying to find this out for a few hours.

I want to use the script from this thread. http://forums.bistudio.com/showthread.php?85769-Spawning-empty-Vehicle-on-addAction

But have the aircraft spawn at 18 height. The height required for the Nimitz Class Carrier addon.

I have the script working, but I cannot find out to make the vehicles spawned by this script to spawn at 18 height.

I used this in the init lines of some other units and it worked great.

this setPosASL [position this select 0, position this select 1, 18]  

Here is my Init for the script

WaitUntil{not isNull player};
_air = player addAction ["Spawn: A10","Spawn_Vec.sqf",["A10"],5,false,true,"","player in list SpawnVehicleArea"];
_air4 = player addAction ["Spawn: F-14 CAP","Spawn_Vec.sqf",["IkaR_F14_AIM_54"],5,false,true,"","player in list SpawnVehicleArea"];
_air5 = player addAction ["Spawn: F-18","Spawn_Vec.sqf",["vfa_14_202"],5,false,true,"","player in list SpawnVehicleArea"];

And here is the Spawn_Vec.sqf

_type = (_this select 3) select 0;
_vec = _type createVehicle (getMarkerPos "Spawn_Aircraft");
_vec setDir 150;
AllVecsSpawned = AllVecsSpawned + [_vec];
publicVariable "AllVecsSpawned";

Share this post


Link to post
Share on other sites

I'm assuming the marker "Spawn_Aircraft" is placed at the position of the carrier deck on the map. You need to set the "z" coordinate (height) of the spawn position to be 18.

Try this....

_vec = createVehicle [_type, [(getMarkerPos "Spawn_Aircraft") select 0,(getMarkerPos "Spawn_Aircraft") select 1,[b][color="#FF0000"]18[/color][/b]], [], 0, "NONE"];

Share this post


Link to post
Share on other sites
I'm assuming the marker "Spawn_Aircraft" is placed at the position of the carrier deck on the map. You need to set the "z" coordinate (height) of the spawn position to be 18.

Try this....

_vec = createVehicle [_type, [(getMarkerPos "Spawn_Aircraft") select 0,(getMarkerPos "Spawn_Aircraft") select 1,[b][color="#FF0000"]18[/color][/b]], [], 0, "NONE"];

Yes, the marker is on the Carrier deck.

I got this edit to work but only on land, at a normal airport the planes spawn elevated, but when I move the trigger, player, and marker to the carrier, I can't find the aircraft. I tried changing the spawn height to several heights but I can't find them on any of them.

Share this post


Link to post
Share on other sites

Try spawning the vehicle somewhere else and moving it to the marker....

_vec = createVehicle [_type, [0,0,30], [], 0, "NONE"];
_vec setPosASL [(getMarkerPos "Spawn_Aircraft") select 0,(getMarkerPos "Spawn_Aircraft") select 1,18];

EDIT: Just tried it ...it works fine!

Edited by twirly

Share this post


Link to post
Share on other sites

No worries man... glad to help. Welcome to the forums. Actually I see you've posted before! My bad!

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  

×