I’m trying to design an answering machine which has some messages on it. I want the player to be able to press the play button and have each message displayed in the correct order.
[code]A button is a kind of thing. A button can be pressed or unpressed. The play button is a part of the answering machine.
If play button is pressed
say “[oneof] [firsttime] Message one says… [only]Test[cycling]”[/code]
First, you can’t have an “if…then” statement just hanging out in your code without any context. It needs to be part of a phrase or a rule. From what you’ve written it looks like you want the button to do something when the player types a command like “PUSH BUTTON.” So you need to write a rule for the pushing action.
After pushing the play button:
say "[oneof] [firsttime] Message one says... [only]Test[cycling]"
You don’t really need a “pressed/unpressed” attribute for this, and the way you had coded it wouldn’t do anything in anycase. An either/or attribute (which is what your pressed/unpressed state was) is just a label; you can flip an object back and forth between the two states, but you have to deliberately write code to do that; it doesn’t just happen when the player enters a command.
The “[one of]…[cycling]” notations in your say message aren’t necessary, either. There’s only one option between them, so they’re just “cycling” through that one message over and over.
Finally, your “play button” is not actually a button. You have to explicitly indicate that in the code; it’s not enough to just include the word “button” in an object’s name. You want to do this:
A button is a kind of thing. The play button is a button.