Jump to content
XOSPECTRE

Spawning Helicopter in the air

Recommended Posts

any idea how to spawn helicopter in the air whith engines on ?? but nut turn them on but in full speed just spawn helicopter in the air but flying ..   

isengine on or engine on command just turn them on its too late to turn engines on during been allready in the air

 

Share this post


Link to post
Share on other sites

Or createVehicle and use the special parameter.

Quote

special (Optional): String - Could be one of the following:

"FLY" - if vehicle is capable of flying and has crew, it will be made airborne at default height.

_vehicle = createVehicle [ "B_Heli_Light_01_F", player getPos[ 100, getDir player ], [], 0, "FLY" ];
createVehicleCrew _vehicle;

 

  • Like 1

Share this post


Link to post
Share on other sites

Thank you and any idea how to transfer it to this

 

heli1 = "heliclassname" createVehicle [2612,-1498,200];
heli1 setPosATL (heli1 modelToWorld [0,0,800]);

Share this post


Link to post
Share on other sites

@XOSPECTRE

That'd look something like this,

heli1= createVehicle ["B_Heli_Light_01_F", player getPos[ 800, getDir player ], [], 0, "FLY" ]; createVehicleCrew heli1;

hint "heli created";

This works great you just have to determine where your helicopter will spawn.

I'd put a named marker there and instead of,

player getPos [ 100, getDir player]

 

getPos namedMARK

Have fun!

Share this post


Link to post
Share on other sites
1 hour ago, XOSPECTRE said:

any idea how to transfer it to this

_vehicle = createVehicle [ "B_Heli_Light_01_F", [ 2612, -1498, 200 ], [], 0, "FLY" ];
createVehicleCrew _vehicle;
_vehicle setPosATL[ 2612, -1498, 1000 ];
_vehicle flyInHeight 1000;

And flyInHeight to make sure it stays at that altitude.

  • Like 2

Share this post


Link to post
Share on other sites

@XOSPECTRE
I ended up playing around with this for way too long last night. Thanks, @Larrow!

This is what I came up with,

spawnHELO.sqf

Spoiler

heli1= createVehicle ["B_Heli_light_01_dynamicLoadout_F", player getPos[ 100, getDir player ], [], 0, "FLY" ];


heli1 allowDamage false;

createVehicleCrew heli1;
groupH = group driver heli1;

{_x allowdamage False;} foreach units group (driver heli1);

    _wpb = groupH addwaypoint [position heloWPmark,0];
    _wpb setwaypointtype "move";
    _wpb setWaypointSpeed "LIMITED";
    groupH setBehaviour "careless";

heli1 flyInHeightASL [180, 180, 80];
heli1 flyinheight 80;

heli1 addeventhandler ["Fired",{
    (_this select 0) setvehicleammo 1;
}];

heli1 addeventhandler ["Fuel", {
    (_this select 0) setfuel 1;
}];

systemchat "Helicopter Support Online";

execVM "heloPatrol.sqf";

while {true} do {if(heli1 distance heloWPmark < 200) then {execVM "heloPatrol.sqf";};sleep 0.5;};

 

I don't know if there's anything you can use there but I sure had fun and learned a lot.

  • Like 1

Share this post


Link to post
Share on other sites

@wogz187 

definitely helps a lot thank u very much..good source of info from your script

 

Anyway i got new problem when i attach something on helicopter ai start raising its altitude forever looks like engine thingk there is something ai needs to avoid but its atttached to it.. 

 

i use this :

XCOM1 = "Mothership_01_F" createVehicle [317,11212,2000];
XCOM1 attachTo [MyheliNAME,[0,80,0]];
XCOM1 setVectorDirAndUp [[0,80,12000],[80,-12000,0]];

 

so when i created this mothership atached to heli in the air ai start moving UP all the time i tried   heli1 flyInHeightASL [800, 800,800];   but ai still fly up. 

Basically im using helicopter as holding platform for mothership and if needed it can move but ai just fly up. any idea how to bypass it ?

Share this post


Link to post
Share on other sites

@XOSPECTRE,

Quote

Anyway i got new problem when i attach something on helicopter ai start raising its altitude forever...

Yes, I know. I made a topic about this a couple weeks ago. There is not a solution I know of. You cannot attach to AI controlled air vehicles or it affects their behavior. Don't worry, I already tested with every available attachment method and object state (ex disableSimulation). The only solution I could offer is if you make the mothership stationary (still in the air but not moving) when the player isn't looking we can teleport it around but it can't move by AI control with attached objects.

Share this post


Link to post
Share on other sites

thx for reply... But i wondering how bis moved alien mothership over head in that forest where is burning small house, first contact with mother ship

Share this post


Link to post
Share on other sites
2 hours ago, XOSPECTRE said:

thx for reply... But i wondering how bis moved alien mothership over head in that forest where is burning small house, first contact with mother ship

Oh. You literally mean the mothership from Contact. I dunno. Is it a AI controlled vehicle or a prop model? I imagine the latter.

If so I misunderstood. You want to attach a helicopter to a static object? We can do that.

Share this post


Link to post
Share on other sites

Nope I need attach static object to helicopter but it's couse that problem with ai raising its altitude

Share this post


Link to post
Share on other sites
1 hour ago, XOSPECTRE said:

Nope I need attach static object to helicopter but it's couse that problem with ai raising its altitude

Yeah, sorry I couldn't find a solution to that. You'd have to use Unit Capture I think.

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

×