Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: deedee on Wed 03/03/2004 18:46:36

Title: Global variables [SOLVED]
Post by: deedee on Wed 03/03/2004 18:46:36
Does anybody know if there is a scripting way in which you can modify the value of the global variables made up with the interface?

tnx
Title: Re:Global variables
Post by: SSH on Wed 03/03/2004 19:00:06
Interestingly, I think it is not possible. There's a GetGraphicalVariable function to get the values of them, but no way to change them from inside scripts! I don't know why this is! Anyway, you'll have to use a GlobalInt instead, I'm afraid. Maybe there should be a warning on those variables, like "Cannot be accessed from script" or maybe just a SetGraphicalVariable function added...
Title: Re:Global variables
Post by: deedee on Wed 03/03/2004 21:38:25
ouch! then there are a couple of variables i must remake...

thanks anyway.
Title: Re: Global variables
Post by: YotamElal on Mon 07/03/2005 07:10:33
you don't need to remake any variables.
and you don't need to use SetGlobalInt istead.

in cases that you have want to set a graphical variable within an
"if condition" in a script,

all you have to do is add SetGlobalInt(10, 1) to the script (where you want to set your graphical variable)
and outside the script a graphical condition (if 10 = 1)
            Set Global Variable (whatever to whatever)

thats how u can set a graphical variable from within a script...


Title: oops
Post by: YotamElal on Mon 07/03/2005 07:39:28
oops

now I see that SetGraphicalVariable works fine...


ignore my last post...
Title: Re: Global variables
Post by: strazer on Mon 07/03/2005 07:48:39
Yes, graphical variables are different from global variables. They are not interchangeable.

To access graphical variables (used in the interaction editor) in script, use Get/SetGraphicalVariable.
You can't access GlobalInts (used in script) in the interaction editor.

Please don't dig up old threads.