Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: foz on Mon 30/06/2003 20:00:44

Title: global variables
Post by: foz on Mon 30/06/2003 20:00:44
i have been trying to set a global variable inside a script.....not having any luck can anyone help.....i basically want a character in the game after a dialog option has been chosen ...for the character to look away....which i have done inside the dialog script

eg:-  

function dialog_request (int x) {
   // your code here
if (x ==5){
SetCharacterView(DAV,25);
AnimateCharacter(DAV,2,0,0);

GUIOn(2);}
}

but i want to set the global variable after the charater starts animating....please help....or my game will lose one of its puzzles


thanks
Title: Re:global variables
Post by: Pumaman on Mon 30/06/2003 22:54:51
Well, what global variable do you want to set?

Just put:

SetGlobalInt (10, 1);

under your AnimateCharacter command to set globalint 10 to 1, for example.
Title: Re:global variables
Post by: foz on Mon 30/06/2003 23:30:27
i used this instead........
if (character[DAV].loop....
to get the result i needed....thanks
i wanted to set a graphicglobalvariable..
i`m not sure if that can be done...
i noticed getgraphicglobalvariable to read them...in a script...
i got round my problem anyway


thanks mate
Title: Re:global variables
Post by: Scorpiorus on Mon 30/06/2003 23:35:21
Nope, there is no SetGraphicalVariable() function it AGS.

-Cheers