OFPEC Forum

Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: sharkattack on 20 Feb 2007, 21:04:56

Title: trouble with random position of unit !
Post by: sharkattack 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
Title: Re: trouble with random position of unit !
Post by: Wolfrug 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.
Title: Re: trouble with random position of unit !
Post by: sharkattack on 21 Feb 2007, 17:26:34
Thanx wolfrug ....
will try tonight .. nice one mate       :)
Title: Re: trouble with random position of unit !
Post by: Wolfrug 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.
Title: Re: trouble with random position of unit !
Post by: Planck 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
Title: Re: trouble with random position of unit !
Post by: sharkattack on 22 Feb 2007, 18:16:00
thanx planck .. will try it against the disableAI "MOVE"...
nice one lads  thanx  for help ....