I am unsure of what I am doing wrong here.
int Key;
if (Key == 1) {
Display ("It's already unlocked.");
}
if (Key == 0) {
Display ("Hooray! It unlocked.");
Key = 1;
}
When the action is done, it displays the "Hooray..." but when I repeat the action, it "Hooray"s again. Any suggestions?
(Figuring out how to do all this can be a real pain :P)
It's because you define "int key" right above where you use it. It will create a new "key" variable everytime you execute that piece of code (and it will always initialize the variable with a value of "0").
Move the "int key" to the global script file.
EDIT: What is strazer talking about..? :=
Quote from: dkh on Sun 29/01/2006 17:32:17or the script header.
Don't. (http://www.adventuregamestudio.co.uk/yabb/index.php?topic=24444.msg304162#msg304162) :)
Thanks guys, it's working fine now. Woohoo, I'm one more step closer to making my game! ;D