OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: bedges on 19 Oct 2005, 21:44:55

Title: why won't they stop?
Post by: bedges on 19 Oct 2005, 21:44:55
i am making a script which creates units using the (surprise surprise) createunit command. in the init string part i tried putting 'dostop this'.

loon won't stop.

i tried putting a trigger together in-game, same createunit command, giving loon a name, then after he was created, dostopping him by name. no problem. loon stops.

i tried recreating this in a script by assigning a random name to the loon, then after he was created, dostopping him by that name.

loon still won't stop.

what gives?
Title: Re:why won't they stop?
Post by: macguba on 19 Oct 2005, 21:55:11
It could be another command overriding it ... say a return to formation from a group leader.   Or maybe if he has a waypoint.

Or it could be that it takes loons a second or two to wake up after createunit, and the command is being issued when he is still asleep.  Try issuing it a few seconds later.
Title: Re:why won't they stop?
Post by: THobson on 19 Oct 2005, 22:06:06
In addition: when you create a unit you have to have it assigned to a group - it may be trying to get to its group leader.  try: [this] join grpNull
Title: Re:why won't they stop?
Post by: bdfy85 on 20 Oct 2005, 10:43:37
hint: create a group in the editor and place  'dostop this' in the  init field of each  unit. What will you see ? :)
Posible solutions :
-use disableAi command to stop anf enableAI function to let soldiers move.
-use dostop loop
-unassign all soldiers from its groups (not recommend )

Title: Re:why won't they stop?
Post by: Tyger on 20 Oct 2005, 11:24:54
Quote
int: create a group in the editor and place  'dostop this' in the  init field of each  unit. What will you see ?
Posible solutions :
-use disableAi command to stop anf enableAI function to let soldiers move.

There is no enableAI command...
Title: Re:why won't they stop?
Post by: bdfy85 on 20 Oct 2005, 16:58:29
there's _function_ ;) not command
Title: Re:why won't they stop?
Post by: bedges on 20 Oct 2005, 21:42:23
thanks all. i've worked around the problem, and have fixed it simply - always the best way ;)