Item confusion...

Kaitlin
02 Sept 2006, 10:32
Long story short, I'm making a text based adventure game for a school project, using QDK. I want to make it so that a character can step into a time machine and go back in time.

There are three buttons that need to be pressed, in the correct order. That's not a problem, I've figured out how to do that using flags and conditions.

The problem is, the buttons are named "red button", "blue button" and "green button". When I specify a custom command of 'press #@red button#', etc, I get the same response every time I type 'press (colour) button', no matter which colour I have put in.

If I don't include the #@__#, then it works fine, only it means that it can be done from anywhere in the game, not just in the room containing the time machine. That doesn't really work out.

Can somebody tell me why this is happening and how I can fix it?

Kaitlin
02 Sept 2006, 10:35
I figured out how I can contain it to the room, by specifying the custom commands in room properties as opposed to game properties, but I'd still be interested in knowing why it didn't work, for future reference. :)

paul_one
02 Sept 2006, 12:16
#@red button# Means:
get the real name of an object and put it 'into' a place called "red button".

So, when you type:
'press red button'
it get's "red button" and put's it in a place called "red button".....

So:
[red button] == "red button"

But if you type:
'press green button'
it get's "green button" and put's it in a place called "red button".....

so:
[red button] == "green button".

These 'places' are called variables, and they hold strings of words, or numbers.

Kaitlin
03 Sept 2006, 01:41
I'm kind of new at this, as you might be able to tell. :oops:

I sort of understand, but not totally. :)