• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

How to stop AI

Status
Not open for further replies.
Level 5
Joined
Oct 27, 2007
Messages
158
Is there any way, how to stop computer AI after some minutes or after enter chat?
After the stopping AI, computer should do nothing.


What type of AI are you referring to? A base building AI or just units controlled by the AI?

In case of the former you simply send a command to the AI telling it to stop all activity. You'll need a command processing function in the AI script.

JASS:
native CommandAI takes player num, integer command, integer data returns nothing

In case of the latter you simply tell the AI to ignore all guard positions of his units. This will prevent the AI from controlling the units. The units will still attack when they're attacked, or a hostile unit moves in to close, but it will prevent the AI from changing the guard order of the unit. Another solution is to give all the units of the AI to the passive neutral extra player.

JASS:
native RemoveAllGuardPositions takes player num returns nothing

edit: Pause unit or Pause comp ai would be better like already said, if you don't mind the unit not responding to anything.
 
Status
Not open for further replies.
Top