Home   Help Search Login Register  

Author Topic: trouble with random position of unit !  (Read 2279 times)

0 Members and 1 Guest are viewing this topic.

Offline sharkattack

  • Former Staff
  • ****
trouble with random position of unit !
« on: 20 Feb 2007, 21:04:56 »
hi guys ...
having a bit bother... ive got several possible locations for a potential target in editor..
i can get target to occupy either one no probs .. however � the unit needs one waypoint .. if he spawns at point a b c or d .. his waypoint position remains set to default and he proceeds to move to it ..ive tried setting conditions but they seem to be ignored no matter what he moves to 1st waypoint ... how could i move the waypoint to the position of the unit ... or disable the movement of target untill a condition is met .. hope you get my drift ..

many thanx in advance   :good:
edit*

SOLVED

the old disableAI "MOVE" did the trick .. was trying it as two words  disable  AI
« Last Edit: 21 Feb 2007, 15:08:56 by shark attack »
"HOLY SARDINE" - see Shark-Attack meet his match

Offline Wolfrug

  • Addons Depot
  • Former Staff
  • ****
  • Official OFPEC Old Timer
Re: trouble with random position of unit !
« Reply #1 on: 21 Feb 2007, 15:38:59 »
Moving waypoint to the position of the unit (write somewhere, init field should be good)

[group this, 1] setWPos getpos this

Simple as that. Will put the first waypoint (AFAIK waypoint 0 is the one automatically created underneath each unit at startup, and hence invisible) on top of the unit, regardless of where he's spawned.

:) And if you don't want to use the disableAI command, you can simply put [/i]this Stop true in the unit's init field and it won't move until it's allowed to again (unitName Stop false).

Wolfrug out.
"When 900 years YOU reach, look as good you will not!"

Offline sharkattack

  • Former Staff
  • ****
Re: trouble with random position of unit !
« Reply #2 on: 21 Feb 2007, 17:26:34 »
Thanx wolfrug ....
will try tonight .. nice one mate       :)
"HOLY SARDINE" - see Shark-Attack meet his match

Offline Wolfrug

  • Addons Depot
  • Former Staff
  • ****
  • Official OFPEC Old Timer
Re: trouble with random position of unit !
« Reply #3 on: 22 Feb 2007, 07:17:13 »
Did some more testing, and argh, I can't get waypoint [1] to move anywhere!  :dunno: The waypoints only seem to move from nr. 2 and up. But anyway, you should be fine with the stop command nonetheless. Sigh, ArmA scripts :D

Wolfrug out.
"When 900 years YOU reach, look as good you will not!"

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re: trouble with random position of unit !
« Reply #4 on: 22 Feb 2007, 15:21:26 »
There is another command introduced by ArmA: setWaypointPosition

Syntax (from comref) goes:

waypoint setWaypointPosition [center, radius]

Example:  [grp, 2] setWaypointPosition [position player, 0]


Planck
I know a little about a lot, and a lot about a little.

Offline sharkattack

  • Former Staff
  • ****
Re: trouble with random position of unit !
« Reply #5 on: 22 Feb 2007, 18:16:00 »
thanx planck .. will try it against the disableAI "MOVE"...
nice one lads  thanx  for help ....
"HOLY SARDINE" - see Shark-Attack meet his match