Home   Help Search Login Register  

Author Topic: getpos command  (Read 487 times)

0 Members and 1 Guest are viewing this topic.

Offline AirCav

  • Members
  • *
  • I'm a llama!
getpos command
« on: 02 Jan 2005, 05:00:42 »
heya,

I have an issue using GetPos.  The command doesn't update the target's position after the time it was executed.  So if I have a carbomb is trying to attack a moving convoy, it will move to the point the convoy was and stop.  Is there another command that updates itself and allows AI to track a moving target?

-=AirCav=-

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re:getpos command
« Reply #1 on: 02 Jan 2005, 08:33:12 »
Well, write an sqs loop that updates the porition for the AI...

Code: [Select]
#loop
_pos = getPos (leader convoy)
carbom doMove _pos
~10
? alive carBomb: goto "loop"
exit

This is just a raw example, but the idea is there... syntaxes may not be absolutely correct...
Every 10 seconds the script gets the position of the leader of a group called convoy and gives an order for the car called carBomb to move to that position...
The scripts exits when the carBomb is 'dead'...
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline AirCav

  • Members
  • *
  • I'm a llama!
Re:getpos command
« Reply #2 on: 08 Jan 2005, 01:48:19 »
Ok, figured it out.  i'm still a script virg. and tend to stick to 'in editor' only solutions until I can figure scripts out.

The solution was to put the getpos and domove commands in a simple script waypoint followed immediately by a cycle waypoint.  

thans for the help,
-Air