Author Topic: Setting variables during dialogue?  (Read 422 times)  Share 

Konador

    • I can help with play testing
    •  
    • I can help with story design
    •  
    • I can help with voice acting
    •  
    • I can help with web design
    •  
Setting variables during dialogue?
« on: 26 Jul 2004, 19:45 »
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?

Mr Flibble

  • In There Like SwimWear!
    • I can help with AGS tutoring
    •  
    • I can help with characters
    •  
    • I can help with play testing
    •  
    • I can help with proof reading
    •  
    • I can help with story design
    •  
Re: Setting variables during dialogue?
« Reply #1 on: 26 Jul 2004, 19:48 »
function dialog request (int param) {

if (1==param) {
//code here
}
}
Ah! There is no emoticon for what I'm feeling!

Konador

    • I can help with play testing
    •  
    • I can help with story design
    •  
    • I can help with voice acting
    •  
    • I can help with web design
    •  
Re: Setting variables during dialogue?
« Reply #2 on: 26 Jul 2004, 19:59 »
Ah thanks for the correction! :) What is the code for changing a variable? I can't find it in the help file.

monkey0506

  • Guest
Re: Setting variables during dialogue?
« Reply #3 on: 27 Jul 2004, 01:03 »
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.

Konador

    • I can help with play testing
    •  
    • I can help with story design
    •  
    • I can help with voice acting
    •  
    • I can help with web design
    •  
Re: Setting variables during dialogue?
« Reply #4 on: 27 Jul 2004, 01:11 »
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 :)