KublaKhan1797 asked a question about variable scope on the official boards, and ScarfaceDM gave a nice summary:
A standard variable defined outside (and above) any function or void main will be global within that script, a standard variable defined within a function or void main will not be global within that script, it will be usable within the function or void main that it was defined in.
A local variable is stored on an object and is retrievable from any script as long as it exists, they are not persistent unless stored on items in a PCs inventory and then the PCs character exported.
A global variable is not persistent in any way, it is simply 'global', it is not stored on any object thus making it retrievable via its sVarName and not from an object.
A campaign variable is stored in the database folder in your NWN2 directory and also not on any object, and is persistent and retrievable from any script as long as it exists.
The thread is here:
http://nwn2forums.bioware.com/forums/viewtopic.html?topic=539873&forum=114
Recent comments
2 years 19 weeks ago
2 years 19 weeks ago
2 years 19 weeks ago
2 years 25 weeks ago
2 years 26 weeks ago
2 years 42 weeks ago
2 years 43 weeks ago
2 years 47 weeks ago
2 years 47 weeks ago
2 years 50 weeks ago