View Single Post
10-05-05, 03:48 AM   #1
Gorak
A Fallenroot Satyr
Join Date: Oct 2005
Posts: 21
Scope of SavedVariables insruction

Hi !

The SavedVariables directive in an add-on's TOC-file specifies the variables it saves in-between gaming sessions.

I've been developing an add-on for quite some time now, which is constructed in a very Java-like namespacing system, that is, all seperate components of the add-on are placed into different namespaces. This is accomplished by defining nested array/table variables and later-on defining the variables and functions as fields inside the table.

However, when I try to specify a table variable defined inside a namespace as the variable to save, it fails to accomplish it. In order for SavedVariables to find and save te variable, I must define the table at global level, i.e. not inside any namespaces.

While the current approach uses a global variable, that is then copied inside the namespace into the actual table when VARIABLES_LOADED event is triggered, I would certainly like to know what the scope of SavedVariables is, if anyone knows.. To me, it seems it can only identify global-level variables correctly..

- Gorak
  Reply With Quote