Specific input

I want the player to say a specific phrase, “Shamba Wamba Lamba.”
I don’t know how to code this.

He’s singing into a microphone.

Check singing into microphone: if guitar is untuned: say "Sam grimaces as he listens in the control booth.[line break] ['] You need to get that axe tuned,['] he says through the intercom and points toward the door."; now player is in A Street; otherwise: if guitar is tuned and player's command matches "Shamba Lamba Wamba": 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; marry one of those hot waitresses from the Kit Kat Club, and get yourself a pair of blue suede shoes.[line break] Life couldn't be much better ...[paragraph break] And then you get your draft notice."; end the story; otherwise: say "[']Those aren[']t the lyrics you wrote,['] Sam says from the control booth. [']Sing what you wrote, hillbilly![']".

Transcript:

sing Shamba Lamba Wamba into mic
I didn’t understand that sentence.

Note: I couldn’t get the “if” to line up properly in the above, but it does in the code.

Have you created a “singing into” action? There isn’t one defined by default. Can you post that part of your code?

[code]A microphone is a thing in the recording studio.

Understand “mic” as microphone. Understand “mike” as microphone.

Singing into is an action applying to one visible thing.

Understand “sing into [something]” as singing into.

Check singing into microphone:
if guitar is untuned:
say “Sam grimaces as he listens in the control booth.[line break]
[’] You need to get that axe tuned,[’] he says through the intercom and points toward the door.”;
now player is in A Street;
otherwise:
if guitar is tuned and player’s command matches “Shamba Lamba Wamba”:
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; marry one of those hot waitresses from the Kit Kat Club, and get yourself a pair of blue suede shoes.[line break]
Life couldn’t be much better …[paragraph break]
And then you get your draft notice.”;
end the story;
otherwise:
say “[’]Those aren[’]t the lyrics you wrote,[’] Sam says from the control booth. [’]Sing what you wrote, hillbilly![’]”.[/code]

You’re trying to match the player’s command. That would be the entire line “sing shamba lamba wamba into microphone” (or “…into mic” or whatever). What you want is to define a second action, singing it into. Something like this:

Singing it into is an action applying to one topic and one thing. Understand "sing [text] into [something" as singing it into.

(See p. 17.5 in Writing with Inform.) Having done this, you can check whether the topic matches “shamba lamba wamba”.

I7 had a problem with the word “and.”

Problem. You wrote ‘Understand “sing [text] into [something” as singing it into’ : but ‘understand’ should be followed by text in which brackets ‘[’ and ‘]’ match, so for instance ‘understand “take [something]” as taking the noun’ is fine, but ‘understand “take]” as taking’ is not.

See the manual: 17.1 > 17.1. Understand

As the message says, there’s a close-bracket missing. Add one.

Doh!

Thanks.

Well, I thought that would do it, but here’s the transcript:

sing shamba lamba wamba into microphone
‘Those aren’t the lyrics you wrote,’ Sam says from the control booth. ‘Sing what you wrote, hillbilly!’

It IS an advance over where I was, just not the expected result.

So what is the new rule you wrote for the new action?

Singing it into is an action applying to one topic and one thing. Understand “sing [text] into [something” as singing it into.

That’s a definition, not a rule. What is the new rule you wrote for the new action? What is the code you wrote to make it actually do something?

Check singing into microphone: if guitar is untuned: say "Sam grimaces as he listens in the control booth.[line break] ['] You need to get that axe tuned,['] he says through the intercom and points toward the door."; now player is in A Street; otherwise: if guitar is tuned and player's command matches "Shamba Lamba Wamba": 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; marry one of those hot waitresses from the Kit Kat Club, and get yourself a pair of blue suede shoes.[line break] Life couldn't be much better ...[paragraph break] And then you get your draft notice."; end the story; otherwise: say "[']Those aren[']t the lyrics you wrote,['] Sam says from the control booth. [']Sing what you wrote, hillbilly![']".

You’re still checking if the player’s whole command matches “shamba lamba wamba”. You need to refer to the “topic understood”, not the whole command.

Take a look at stackoverflow.com/questions/1286 … n-inform-7 for a situation similar to this.

I am wondering about the word “that” in the example. Could there be a mistake there?

Example:

Instead of answertng the robot that some tex:
if the topic understood matches “xyzzy”;
say “The robot folds itself up into a cube to let you pass.”;
now the robot is asleep;
otherwise:
say “‘WRONG PAAWAAARD!’ roars the robot. ‘CHECK CAPS LAAAWWWWK!’”

No, “answering it that” (or more precisely “answering something that some text”) is the name of the action. Have a look in the Actions tab of the Index on a compiled story.

“Instead of answering it that some text”

This is the correct wording?

You need to specify whom the player will be answering. (Or just use “someone”.)

I’m still confused by that word “that.” Can someone elucidate?

If you say “how are you” I can answer you that “I’m fine.”

I’m answering it (you) that (the text “I’m fine.”)