A condition rule I don't know how to write

I can’t find the problem:

Check singing into microphone: if player says "[']Shamba-Lamba-Wamba, Do You Wanna Be My Baby?[']": say "Sam nods his head approvingly as you sing your song, and when you finish signals a [']V['] for victory from the control booth.[line break] [']This here's solid gold!['] he shouts. [']This here is a million-seller! Moon Studios is saved!['][line break] And of course, Sam is right. Not only is Moon Studios saved, but you get rich. You tour the country to rave reviews and the screams of teenage girls; buy your mama a pink Cadillac; move into a big ole house in the Winterhaven community of Memphis; and you get yourself a pair of blue suede shoes.[line break] Life ouldn't be much better ...[line break] And then you get your draft notice."; end the story. otherwise: say "[']Those aren[']t the lyrics you wrote,['] Sam says from the coontrol room. [']Sing what you wrote, hillbilly![']"

Problem message:

Problem. You wrote ‘otherwise’ : but the punctuation here ‘:’ makes me think this should be a definition of a phrase and it doesn’t begin as it should, with either ‘To’ (e.g. ‘To flood the riverplain:’), ‘Definition:’, a name for a rule (e.g. ‘This is the devilishly cunning rule:’), ‘At’ plus a time (e.g. ‘At 11:12 PM:’ or ‘At the time when the clock chimes’) or the name of a rulebook, possibly followed by some description of the action or value to apply to (e.g. ‘Instead of taking something:’ or ‘Every turn:’).

Replace the period at the end of “end the story” with a semi-colon.

I think that will probably work, but I7 still has a problem:

Problem. In the sentence ‘if player says "[’]Shamba-Lamba-Wamba, Do You Wanna Be My Baby?[’]"’ , I was expecting to read a condition, but instead found some text that I couldn’t understand - ‘player says "[’]Shamba-Lamba-Wamba, Do You Wanna Be My Baby?[’]"’.

I was trying to match this phrase:

if (player says “[’]Shamba-Lamba-Wamba, Do You Wanna Be My Baby?[’]” - a condition):

But I didn’t recognise ‘player says "[’]Shamba-Lamba-Wamba, Do You Wanna Be My Baby?[’]"’.


Problem. You wrote ‘otherwise’ : but this is an ‘else’ or ‘otherwise’ with no matching ‘if’ (or ‘unless’), which must be wrong.

See the manual: 11.8 > 11.8. Otherwise

Problems occurring in translation prevented the game from being properly created. (Correct the source text to remove these problems and click on Go once again.)

To be clear: How do I get the parser to recognize the song title? Or lyrics, what have you.

What is the command or series of commands that you want the player to input in order to lead to this point in the code?

Dannii, all I can do is repeat the code from above.
Basically, I want the player to say “Shamba-Lamba-Wamba, Do You Wanna Be My Baby?” into the microphone (a thing I have named) and I want the parser to respond with the words that follow and end the story.
I implemented that idea as best I knew how, and expected it to cause a problem. Is there some kind of substitution method I’m not using that I should?

Give us a fake transcript for what you want the player to be able to do.

What do you want to do next?

sing Shamba-Lamba-Wamba, Do You Wanna Be My Baby?

Sam nods his head approvingly as you sing your song … (etc.)

Okay, that means that your primary action needs to be singing a topic, not singing into an object. Look up topics in the manual. Normally they’re used for consulting dictionaries or encyclopaedias, but they’d be the right tool for this.

OK thanks1

Hmmmm … can I create a text token that will be the lyric of the song?

Actually, I’ve been trying to create a text token – “[text]” – and I appear to be really off base here.

[text] tokens are used for actions applying to topics, so that’s what you need. This isn’t the easiest thing to look up in the documentation, but the section you want is section 17.5, “The text token.”

I read that section and tried to use it, but the parser didn’t like what I came up with. I am trying to get the parser to accept my exact wording, and so far I haven’t a clue as to what would work.

What I need is something that will hold a string of text, like A$ in Basic, and compare it with the text I want it to match, but I don’t know how to do that in Inform.

The phrase you’re looking for is probably “the topic understood.” So if you have successfully defined an action applying to one topic, with a text token, you’d write in your rule:

if the topic understood matches "Shamba-Lamba etc.":

although it might be more player-friendly to allow any phrase that includes some of the magic words, and not force them to type everything exactly including the punctuation:

if the topic understood includes "Shamba" and the topic understood includes "Lamba" and the topic understood includes "Wamba":

(I’m afraid that the matches/includes syntax is tucked away in section 18.33 on “reading a command,” which is not where you’d expect it.)

It compiles! Thanks!