FANDOM


The AI_LEVEL_* constants are used in NWScript to indicate the priority given to a creature's demands on processing power (CPU time). This primarily affects AI, with higher priorities allowing more intelligent behavior.

AI level constants
constant use
AI_LEVEL_VERY_LOW Very stupid AI and minimal CPU demands. Used for most creatures when there are no player characters in the area. At this level, creature OnHeartbeat events occur less frequently.
AI_LEVEL_LOW Used for most creatures not involved in combat when a player character is in the area. (Some people might consider this normal AI, despite the constant's name.)
AI_LEVEL_NORMAL This average AI is normally used for creatures involved in combat.
AI_LEVEL_HIGH Used for associates of player characters, but otherwise likely only needed in cutscenes.
AI_LEVEL_VERY_HIGH Used for player characters. While there is no AI involved with these creatures, this ensures that player actions are given the highest priority should the game exceed the available processing power.
AI_LEVEL_DEFAULT Used when setting an AI level to indicate that the game should control the AI level (using the above guidelines).
AI_LEVEL_INVALID Not used. (Objects without an AI are reported to have "very low" AI instead of "invalid" AI.)

While it is usually bad practice to rely on the precise value of a symbolic constant, it can be assumed that the values from "very low" to "very high" are in increasing numeric order. For example, the conditional

GetAILevel(oCreature) <= AI_LEVEL_LOW

tests oCreature for having a "low" or "very low" AI level.

See also Edit

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.