A play button

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]

This is the error message I’m getting:

“If play button is pressed” should be followed by a comma (if it’s a one-liner) or a colon (if the body of the rule contains multiple statements).

A couple of things are going on, here.

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.

Hope that helps.

Jesus, I think I have to recuse myself from further discussion until I’m no longer ill. Somehow, I saw “instead” on that line instead of “if”.

Yes it does. I wanted to add multiple voice messages, hence the cycling. Also, I was having issues, I think, with this before:

A button is a kind of thing. The play button is a button.

But I’ll try this all again and see what happens, thanks.

The cycling message part doesn’t work in this case. I’ve used it before in descriptions of backdrops, but not in this instance.

After pushing the play button: say "[oneof]Message one says...[cycling]"

This is the error message:

If you cut and pasted verbatim, you’re just missing a space between ‘one’ and ‘of’

ie It should be

[one of]

-Wade

I thought I tried that; I guess not, thanks.