Home   Help Search Login Register  

Author Topic: Need help keeping helo on ground, until certain condition is met  (Read 1405 times)

0 Members and 1 Guest are viewing this topic.

Offline Meatball0311

  • Members
  • *
 I guess I should give a little background information to my problem and maybe someone in the community can help me out.

Situation:
---------
1)  I am using a helicopter addon that was released as a beta, however there are problems with it responding to _helo land "GET IN" (every other helo's I tested will land with engines on, when I tell troops to load the helo and it will stay on the ground with engine running).  Basically I have a helo transport script that works with every other type of helo except this one.  The script will have the helo come to my destination.. do a _helo land "GET IN", and I would tell my group to mount, then the helo will wait on the ground until a condition (takeoff) is met, then it would fly to next waypoints.  This addon however will fly to destination and with the _helo land "GET IN" command, just hover over the ground and it will only land fully touching the ground if you give it a flyInHeight 0 command.  However with the flyInHeight command when you tell your troops to mount, the helo takes back off and resituates and hovers over the ground again.  I have run into this in the past and how I solved it was by giving it a waitUntil command, and then I would use an addAction command to tell the helo to take off and fly to next waypoint.  This addon is none responsive to this and the addon creator seems to have limited availability and has not released a fix in a month + time.  So I thought this would be a great way to learn about addon making and improve on my scripting.  So I unpacked the pbo and started to mess with figuring out things.  I am thinking that I can solve this issue with adding scripts to the addon that hopefully will solve the issue and repack it and use this for my personal use.

2) I had the helo flying to its waypoints, coming in and landing on the ground, but when I would tell my troops to mount.  The helo would hover over the ground and when the first unit boarded would then land and stay on the ground until I gave it the addAction command to take back off and fly to its next waypoint.  I am looking to make the helo stay on the ground always (even when I tell the troops to mount) until I tell it to fly to the next waypoint.

3) This is what I had done...

a) in the addon config I added an eventhandler:

Quote
class EventHandlers
  {
   init = " _this exec ""\helo\scripts\rampin.sqs""";
   GetIn = "_this exec ""\helo\scripts\rampin.sqs""";
   GetOut = "_this exec ""\helo\scripts\rampin.sqs""";
  };

b) rampin.sqs
Quote
_bird = _this select 0
_gear = 1
#loop
?(not alive _bird) : goto "Exit"
~.1
?(speed _bird < 10)&&(_gear == 0) : [_bird] exec "\helo\scripts\geardown.sqs";_gear = 1
?(speed _bird >= 10)&&(_gear == 1) : [_bird] exec "\helo\scripts\gearup.sqs";_gear = 0
goto "loop"

#Exit
exit

the addon starts to see if the helo is going a certain speed to tell it whether or not to have landing gear and ramp raised or lowered

c geardown.sqs
Quote
_bird = _this select 0
_gear = 1
liftoff = 0

_bird vehicleradio "gear"

_bird animate ["gearf", 0]
_bird animate ["gearb", 0]
_bird animate ["ramp", 1]

gtg = _bird addAction ["Were up and accounted for, ready for takeoff","helo\scripts\liftOff.sqs"]

#wait
_bird flyInHeight -50
?(liftoff == 1)&&(_gear == 1) : goto "EXIT"
goto "wait"

#EXIT
_bird flyInHeight 50
_bird removeAction gtg

exit

if helo is going less than 10 it drops its landing gears and ramp and flyInHeight -50 until addaction is activated (liftoff = 1)
then I also have an addAction in my heloextract script that tells the helo to take off  (basically I have two addactions 1-from the addon and the other from an outside script)


e). gearup.sqs
Quote
_bird = _this select 0

_bird animate ["gearf", 1]
_bird animate ["gearb", 1]
_bird animate ["ramp", 0]

exit

f).  liftOff.sqs
Quote
_bird = _this select 0

liftoff = 1

exit

g). flyInHeight.sqs
Quote
_bird = _this select 0

_bird flyInHeight 50

exit

HELP!!
« Last Edit: 31 Mar 2010, 03:44:00 by Meatball0311 »