Jump to content
Sign in to follow this  
Toasted Duckie

Prevent AI helicopter from taking off?

Recommended Posts

Hey guys, first off, I have been looking all over for this and tried a million things but no succes, so I figgured I just ask.

What I have is a AI helo with some waypoints, I don't want the helicopter to take off at the start though. setfuel 0 Isn't going to be any good since then the crew and cargo will bail, and cargo won't return on setfuel 1. There has to be a easier way for this.

I've tried a lot of things but without succes, so if anyone can help me please do so smile_o.gif    

Lastly: I'm new to this whole editing and just starting to get the very basics down, so bear with me here confused_o.gif

Share this post


Link to post
Share on other sites

What exactly do you want the chopper to do in the mission?

Eg:- Could the chopper hold at a waypoint outta sight?

Share this post


Link to post
Share on other sites

have the first waypoint of the heli (0) as a hold and synchronise it with a trigger (type: switch) for whatever the conditions are that required to be met before the heli is allowed to take of.

hope that works, kinda rushed as I'm just heading of to work.

Share this post


Link to post
Share on other sites
Guest

If you want the eye candy of the helo starting up, and holding with the blades spinning for X time -

CSL spent ALOT of time and aggravation to come up with a script that holds a helo down, no matter what, until a global is set to release it.

It works, in fact it works to perfection.

:::::::::::::::::::::::::

CSL_HeliStay1.sqf

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

//This script is designed as stand alone to keep helos forced on the ground once having landed

// when the helicopter is on the ground, execute this script

// pass the array above, and if desired a timeout like this:

// [W_Helicopter_1] execVM "CSL_HeliStay1.sqf";

// or like this:

// [W_Helicopter_1, 600] execVM "CSL_HeliStay1.sqf";

// when you want to allow the helicopter to take off again, set the particular global for this script to 0;

// F_1_Stay = 0

_helicopter = vehicle (_this select 0);

_timeOut = -99;

if (count _this > 1) then

{

_timeOut = _this select 1;

};

// get the position and vector direction of the helicopter.

_heliPos = getPos _helicopter;

_heliVectorDir = vectorDir _helicopter;

_heliVectorUp = vectorUp _helicopter;

_heliVeloctiy = [0,0,0];

_startTime = time;

_timePassed = time - _startTime;

_timeLeft = _timeOut - _timePassed;

if (_timeOut == -99) then

{

_timeLeft = 1;

};

//// loop keeps the helicopter's position fixed until the caller allows it to quit

//// modify the F_1_Stay to represent your global

while {(F_1_Stay == 1) and (_timeLeft > 0)} do

{

//// prevent take off the hard way since the damn thing insists on taking off no matter what

_helicopter doMove _heliPos;

_helicopter setVelocity _heliVeloctiy;

_helicopter setPos _heliPos;

_helicopter setVectorDir _heliVectorDir;

_helicopter setVectorUp _heliVectorUp;

_timePassed = time - _startTime;

_timeLeft = _timeOut - _timePassed;

if (_timeOut == -99) then

{

_timeLeft = 1;

};

// synchronise with frame rate

_i = 0;

waitUntil {_i = _i + 1; _i > 1};

};

Just use a global, and set it to 1 before the script is ran, then set it to 0 if you want the script to end

The script can be set to time out as well, as he shows in an optional execution of the script.

Where you see in the script :

//// modify the F_1_Stay to represent your global

while {(F_1_Stay == 1) and (_timeLeft > 0)} do

Modify the global in the script line to use yours.

Execute the script as CSL indicated in his description at the top of the script

Thats it.

Maybe it is, maybe it is not what you are looking for, but it is unbreakable by the ai.

This is used in Kolgujev Conlfict Arma to prevent helos from jumping around while units move out to board them, and this is with a waypoint plan enabled - the helo will go no where until the global is set to 0, where it will then proceed with the waypoint plan.

Share this post


Link to post
Share on other sites

I allready achieved what I wanted, but thanks for the replies guys! I think that little script will come in handy as well sometime smile_o.gif

Share this post


Link to post
Share on other sites

How did you solve it without the script?

Share this post


Link to post
Share on other sites
How did you solve it without the script?

I didn't really solve the issue as you might think. I didn't need a helicopter to have the pilot boarded, so I created the pilot, helicopter and crew separately and let the pilot walk towards the helicopter. Then I just synchronized the next waypoint (get in) with a trigger. That gave the result I needed.

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  

×