Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: stuh505 on Thu 13/05/2004 05:32:48

Title: unable to use global vars in room scripts?
Post by: stuh505 on Thu 13/05/2004 05:32:48
When I try to use the variables I have "exported" from my main script in my room script, it doesn't seem to recognize that they have been defined....

eg:

at the beginning of global script:

int LW_SKILLS[18];

at end of global script:

export LW_SKILLS;

in room script (walks onto region):

if (LW_SKILLS[1]==0)
Ã,  something;

I can get around with by making a function to access and return the variable...but I'm confused why this doens't work to begin with
Title: Re: unable to use global vars in room scripts?
Post by: Scorpiorus on Thu 13/05/2004 06:00:44
The exported variable is also required to be imported like any other function.

for a certain room:

// room script
import int LW_SKILLS[18];


for all rooms:
// script header
import int LW_SKILLS[18];