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.
[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”.
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.
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![']".
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.