OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Raptorsaurus on 27 Feb 2005, 02:23:51

Title: Re-enabling AI!!!!????
Post by: Raptorsaurus on 27 Feb 2005, 02:23:51
I have searched the forum and I found other questions regarding this, but no answers to the question!  After doing a disableAI command, is it possible to "re-enable" the AI and if so how?  Or am I relegated to deleting the disabled loon and recreating a new loon in his place?
Title: Re:Re-enabling AI!!!!????
Post by: AK-Chester on 27 Feb 2005, 02:52:14
After doing a disableAI command, is it possible to "re-enable" the AI and if so how?
Nope, I don't think so.

Or am I relegated to deleting the disabled loon and recreating a new loon in his place?
Yup. Or try using the stop command instead of disableAI.
Title: Re:Re-enabling AI!!!!????
Post by: h- on 27 Feb 2005, 09:46:03
Quote
Or am I relegated to deleting the disabled loon and recreating a new loon in his place?
Yes you are...
I wonder what went through BIS minds when they made the disableAI a public function, but no function to undo that... ::)

I think even VBS lacks the function to re-enable AI...


Quote
Or try using the stop command instead of disableAI.
doStop (I think stop does not work anymore?? at least that's what some comref claims...) has a few disadvantages, one being that it doesn't stop AI from shooting or reacting in any other way to the enemy and it has some odd bug that makes a unit that has doStop in it's init field automatically face into direction 0, and that can't be changed...
If you setDir the dude he turns back to facing 0... ::)
Title: Re:Re-enabling AI!!!!????
Post by: THobson on 27 Feb 2005, 10:04:27
Quote
it has some odd bug that makes a unit that has doStop in it's init field automatically face into direction 0, and that can't be changed...
If you setDir the dude he turns back to facing 0...
In my experience if instead of setDir you put a doStop and a doWatch in the init file it works, especially if the thing being watched is a long way away, say a bush on the horizon.
Title: Re:Re-enabling AI!!!!????
Post by: Raptorsaurus on 27 Feb 2005, 11:42:23
Well, if it was just a question of movement, dostop would be fine (I use that all the time), but in this case I want to disable auto targeting.  I think I will just take the units ammo away and then give it back to him when I want him to target again. ;D  This is easier than deleting and recreating him.  I will consider this solved.

Thanks all!