NWNWiki
NWNWiki
3,719
pages

TRUE is a constant in NWScript that is convenient to use when a function needs to return a yes/no type of answer, and that will be interpreted as truth in a conditional or loop. Using this constant tends to make for more understandable code than using an explicit numeric value.

The actual definition of this constant is the integer value "1", but this fact should never be used within a script.


Example: A chest that uses the following script to handle the OnOpen event will lock itself once opened.

//Script in OnOpen

void main()
{
    SetLocked(OBJECT_SELF, TRUE)
}