Home   Help Search Login Register  

Author Topic: Getting a chopper to target and follow a Unit.  (Read 2832 times)

0 Members and 1 Guest are viewing this topic.

Olle Stolpe

  • Guest
Re:Getting a chopper to target and follow a Unit.
« Reply #15 on: 27 Feb 2005, 01:24:05 »
Thanks again.. Now.
Here's my script:

Code: [Select]
_player = _this select 0
_logicpos = getpos chmark


#loop
?(not alive _player):goto "return"
patrolchopper DoMove getpos _player
~2
patrolchopper DoTarget _player
~5
goto"loop"

#return
patrolchopper flyinheight 70
patrolchopper DoMove _logicpos
?(patrolchopper distance chmark <=100):goto "land"
~10
goto "return"

#land
titleText ["landing", "PLAIN"]
patrolchopper setbehaviour "SAFE"
patrolchopper Land "land"
patrolchopper flyinheight 0
exit

 


Do you have any clue why my chopper takes off directly after landing, and then stays hovering.

Offline Raptorsaurus

  • Editors Depot Staff
  • *****
Re:Getting a chopper to target and follow a Unit.
« Reply #16 on: 27 Feb 2005, 01:45:05 »
Choppers do weird things sometimes.  You can make a mission and it works fine with the coppers landing/taking off ect. 20 times in a row, then suddenly when testing the mission the choppers stop landing where they are supposed to or they do weird stuff like hover.  That is why I made the fastland script.  The script just completely takes over the chopper when it gets close to the landing area.  No matter what the AI pilots want to do that script will setVelcity that chopper down to the exact landing spot within .5 meters!!!  Try it and if you have any problems let me know (use PM though since this thread is starting to go off topic).

Olle Stolpe

  • Guest
Re:Getting a chopper to target and follow a Unit.
« Reply #17 on: 27 Feb 2005, 01:55:59 »
Now it works..
Here's the script:

Code: [Select]
_player = _this select 0
_logicpos = getpos chmark


patrolchopper Reveal _player


#loop
   ?(not alive _player):goto "return"
   patrolchopper DoMove getpos _player
   ~2
   patrolchopper DoTarget _player
   ~5
   goto"loop"



#return
   patrolchopper flyinheight 70
   patrolchopper DoMove _logicpos
   ?(patrolchopper distance chmark <=100):goto "land"
   ~10
   goto "return"



#land
   patrolchopper Land "land"
   ~5
   
exit

 

Not bad for my very first mission uh?
Thank you so much for your help!
I'll probably need more help on this script as I go along.

For example, this is for a MP mission so I don't know I need to
use any  public variables...

Offline Raptorsaurus

  • Editors Depot Staff
  • *****
Re:Getting a chopper to target and follow a Unit.
« Reply #18 on: 27 Feb 2005, 02:11:22 »
Good job Olle!!! ;D

Hey if a problem is solved make sure you click on the "sloved" button (only administrators or the original poster can do that).