Table of Contents

EnableHeroAI()

Syntax

EnableHeroAI(heroName,false)

Description

heroName is internal name of the hero controlled by computer
Second argument takes values true (enable) or false (disable).

Function returns console error as if there was no value of “false” variable. Of course it makes no sense in terms of logic and should be ignored, function does work as desired nontheless.

This function disables and enables AI for the specified computer-controlled hero and returns error when invoked for human player. Disabled heroes not only don’t take any actions, but even do not rearrange their armies and artifacts.
This is very useful for singleplayer maps, as makes the AI pass its turn fast, also allows to exactly adjust enemy tactics with no risk of merging stacks or switching artifacts. Not to mention placing static hero as a border guard is an interesting option.
The behaviour of hero can still be controlled by script commands such as MoveHero() or MoveHeroRealTime().

scripting/advmap/enableheroai.txt · Last modified: 2008/09/14 09:52 (external edit)
Creative Commons License Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0