I have a topic and a int variable. I want that, when the game has shown a dialog, it increases the int variables value.
You can call a function from a dialog by e.g.
run-script(1)
This will call script number 1.
In my example script-1 will make the player character walk to 282,185.
script number 2 will end the game.
You can add a many scripts as you like.
To implement this you must add a function in the Global script:
function dialog_request (int parameter) {
if (parameter == 1) {
cEGO.Walk(282, 185);
}
if (parameter == 2){
Display("GAME OVER!");
QuitGame(0);
}
}
Thanks! How can I put variables in display: display("You have " money "$ in your pocket!");?
int money=100;
Display("You have %d & in your pocket!", money);
Oh and RTFM.
Thanks. ;D Hmm. I have a hotspot in my room and i put in the interaction menu look a run script. How can i change the value of that variable in that room?
Quote from: kafka on Mon 03/04/2006 22:28:00
Thanks. ;D Hmm. I have a hotspot in my room and i put in the interaction menu look a run script. How can i change the value of that variable in that room?
You either declare the variable at the top of your room script (and it will only work in that room) or you put it in your global script, like this:
//top of global script
int thingy;
//bottom of global script
export thingy;
//global header file
import int thingy;