SetLocalInt(object, string, int)
Store a number as a local variable within an object.
Target object to store local variable in.
Unique variable name.
Variable being stored in local object.
Stores nValue as a local number within oObject using the variable name sVarName. The parameter sVarName is a unique string identifying a single local variable. Using the same value for sVarName in subsequent calls will overwrite the original value.
There are ways of using one integer to store many variables, by basically using numbers so big they can be compared using the Bitwise Operators. See the default Bioware AI, and how they use SetSpawnInCondition(). X0_I0_SPAWNCOND holds the values and functions for this (A good example to adopt) for the SoU and HotU AI. NW_I0_GENERIC holds the same things for the NwN AI.
As with all locals, there seems to be no size limit to sVarName, however, anything over 50 characters is probably a bit extreme.
The definition of TRUE and FALSE sometimes is not known. For reference:
TRUE = 1
FALSE = 0
Using ! before a local integer value in an if statement (EG: if(!iInt) ) will check if it is == FALSE.
Using nothing before a local integer value in an if statement (EG: if(iInt) ), will check if it is != FALSE, but doesn't mean it has to be positive.
author: Daniel Beckman, editors: Jasperre, Mistress additional contributors: Xepherys, Graziano Lenzi, Lilac Soul, Jasperre, Fireboar