Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: deedee on Tue 02/03/2004 20:01:33

Title: SetGlobalInt
Post by: deedee on Tue 02/03/2004 20:01:33
The help file says:

"Sets the global variable INDEX to VALUE"

question is... how do i know what the index number is to my variables?. (I mean, this does refer to global variables, doesn't it?).

tnx
Title: Re:SetGlobalInt
Post by: AJA on Tue 02/03/2004 20:08:56
SetGlobalInt(1,10); // sets ags's internal global integer 1 to "10"
GetGlobalInt(1); // returns the value set with setglobalint (=10)

So, this has nothing to do with the variables you create yourself.
Title: Re:SetGlobalInt
Post by: deedee on Tue 02/03/2004 22:40:42
I get it... then, is there a scripting way to change the value of the global variables you create using the interface?

or a way to do so in dialogs?
Title: Re:SetGlobalInt
Post by: Ishmael on Wed 03/03/2004 05:54:45
I'm not sure if the globalints set with SetGlobalInt are linked to the ones you can use in the interaction editor... but anyway, in dailog, using set-globalint 1 10 has the same effect as SetGlobalInt(1,10); The manual has the dialog commands listed in it... I think it was Tutorial -> Setting up your game -> conversations or something like that.
Title: Re:SetGlobalInt
Post by: Scorpiorus on Fri 05/03/2004 23:52:47
The interaction editor global variables differ from the ordinary globalints. You can only read interaction editor's global variables with the GetGraphicalVariable (string variable_name) function.

~Cheers