Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: SmashManiac on Sat 10/01/2004 20:20:46

Title: Independent global variables???
Post by: SmashManiac on Sat 10/01/2004 20:20:46
I think that there is three types of global integer variables you can create:

- In the interaction editor (there's "Global 1" already there)
- The SetGlobalInt and GetGlobalInt functions
- An int variable in the script header

I have absolutely no problem to communicate my integers declared in the header and GlobalInts functions, but I'm only able to access them in the script. Also, I'm only able to access the global variables from the interaction editor with the interaction editor.

Am I wrong? Is there a way to change an integer variable with "Game - Set variable value" and check it in a script, or change an integer in the script and check it in a "Conditional - If a variable is set to an certain value"?
Title: Re:Independent global variables???
Post by: Scorpiorus on Sat 10/01/2004 20:39:15
Yep, the only thing you can do is to read an interaction editor variable from the text script:

GetGraphicalVariable (string variable_name);

Returns the value of the interaction editor VARIABLE_NAME variable. This allows your script to access the values of variables set in the interaction editor.
Example:

if (GetGraphicalVariable("climbed rock")==1)
  { code here }

will execute the code only if interaction variable "climbed rock" is 1.
See Also: GetGlobalInt

~Cheers
Title: Re:Independent global variables???
Post by: SmashManiac on Sat 10/01/2004 21:09:47
Thanks! I would have never imagined it was called a graphical variable! That would help for creating my template!

...but sadly what I really need is a SetGraphicalVariable function, or something that will do the same thing. Since nothing of that name exists, I now highly doubt I can do it. Am I wrong again?
Title: Re:Independent global variables???
Post by: Scorpiorus on Sat 10/01/2004 21:22:13
Quote...but sadly what I really need is a SetGraphicalVariable function, or something that will do the same thing.
there is no such I'm afraid.
Title: Re:Independent global variables???
Post by: Ishmael on Sun 11/01/2004 09:34:53
This is the reason I use only scripts, it is much clearer and easily manageable. (Unless you screw the scripts and loose track of it....) To be hones, I don't have much clue on how to use then interaction editor......

(Inrelative post, I know, but I had the odd feeling that I had to bring this up...... sorry.)