I have written a dialog, but after one specific line in the conversation I want to set the global variable "clue given" to "1".
I have got "run-script 1" in the dialog to call this from the global script:
function dialog_request (int 1) {
???
}
But what do I type in the dialogue_request to change the variables?
function dialog request (int param) {
if (1==param) {
//code here
}
}
Ah thanks for the correction! :) What is the code for changing a variable? I can't find it in the help file.
Let me warn you, it's a good thing I'm in a great mood. Most people would yell at you to read the manual. Here's the script, woah, wait, its a global variable???
For a variable, it would go like this:
clue=1;
But as far as I know you can't name Global Variables. But, the script for them goes like this:
SetGlobalInt(int globalvar, int value);
Where "int globalvar" is replaced with the # of your Global Variable, and "int value" is replaced with the value you wish to assign to your variable.
Thanks :)
I did read the manual but I still couldnt find it, but now I know why I couldnt find it. I had created the variable using the AGS interface, so I needed to use SetGraphicVariable, which I didnt know. It explains why searching for variable in the manual didn't help at all :P I've done it now tho, and my game's coming along nicely :)