Structs as Global Variables?
Strife_and_Discord
Member Posts: 17
Hello!
I am trying to create a struct to act as a global variable within an include file.
For example in a central core include file #A I define the following:
In file/Include #B I want to reference said struct as a global variable, like this:
The intent is only to set said struct once and rely on it. Unfortunately I cant seem to make it work(Tried variou syntax ways). Is it at all possible, or am I doomed to have to use a function to set these fields up?
Thanks in advance!
I am trying to create a struct to act as a global variable within an include file.
For example in a central core include file #A I define the following:
//System Details struct struct SYSTEM_DATA_STRUCT { int nSystemToggleType; string sSystemName; string sSystemDescription; string sSystemScript; };
In file/Include #B I want to reference said struct as a global variable, like this:
struct SYSTEM_DATA_STRUCT stSystemDetails { stSystemDetails.nSystemToggleType = TOGGLE_TYPE_SUB_SYSTEM; stSystemDetails.sSystemName = "Time System"; stSystemDetails.sSystemDescription = "Toggle for the Debugging of the Eminence Time System"; stSystemDetails.sSystemScript = "emn_time_inc"; };
The intent is only to set said struct once and rely on it. Unfortunately I cant seem to make it work(Tried variou syntax ways). Is it at all possible, or am I doomed to have to use a function to set these fields up?
Thanks in advance!
0
Comments
On load, load them to local variables onto the module object. On change, save the campaign variables with the new values.