Creating an object to record/play back spoken words.

I’m trying to create a toy doll which can record something the player says and play it back. I think I’ve got most of it figured out, but the last part is giving me trouble. Here’s the code so far:

Talkity Tota is a female person in the toy store. Talkity Tota is portable. The description of Talkity Tota is “DESCRIPTION TEXT.”

Talkity Tota’s recording is a text that varies. Talkity Tota’s recording is “Goo goo ga ga!”

The black button is part of Talkity Tota. The description of the black button is “Push this button, and Talkity Tota will record whatever words she hears next.”

The white button is part of Talkity Tota. The description of the white button is “Push this button to make Talkity Tota play back whatever she’s recorded.”

After pushing the black button:
say “Talkity Tota is primed to record the next words she hears.”;
now Talkity Tota is curious.

After pushing the white button:
say “Talkity Tota says ‘[Talkity Tota’s recording]’”;
now Talkity Tota is satisfied.

Talkity Tota can be curious or satisfied. Talkity Tota is satisfied.

Teaching Talkity Tota is a recurring scene. Teaching Talkity Tota begins when Talkity Tota is curious. Teaching Talkity Tota ends when Talkity Tota is satisfied.

When Teaching Talkity Tota ends:
say “Talkity Tota’s audio player stops recording. Push the white button to hear what you recorded.”


So far, so good. The problem occurs when I try to get the game to recognizing ‘saying’ something. As far as I can work out, I think it should look something like this:

After saying something (called the statement) when Talkity Tota is curious:
now Talkity Tota’s recording is “[the statement]”;
now Talkity Tota is satisfied.

Inform doesn’t like that, though, and I can’t find anything in the instruction book that addresses this in the way I need to do it (the closest is using the command prompt to name a character, but that won’t work in this case because the puzzle involves using the doll to tape someone else talking.) Does anyone have any suggestions to make this work?

The player action for “SAY FOO” is called answering, not saying.

I tried that earlier, but “after answering something” in the above code gives the same error as “after saying something”, so there’s got to be something else wrong with it.

The action’s name is “answering that” so “After answering that some text …”

Thanks for your help, everyone. Adding this code seemed to work at first:

After answering that some text (called the statement) when Talkity Tota is curious:
now Talkity Tota’s recording is “[the statement].”;
now Talkity Tota is satisfied.

…at least in the sense that the game runs, and the doll responses properly to the “say ‘text’” command. However, when pushing the playback button, some of the time I get “Talkity Tota says ’ '”, with no actual message, as if it blanked out the original and then didn’t replace it. The rest of the time the game crashes with the message “Glulxe fatal error: Memory access out of range (5000432)” I don’t know why it’s doing that, or why it sometimes crashes then and sometimes doesn’t. Am I somehow making the game use up all its resources?

(The good news is that the actual puzzle part works great, since I only have to program it for once piece of text. Maybe that will help me narrow down where the problem is… it really does seem to be only in that last bit where it has to record the player’s input. I could drop it altogether and just say something like ‘the doll repeats your words back to you’, but I really want to make a more interactive object for the player to mess around with, if possible.)

This seems to work:

After answering that when Talkity Tota is curious:
	now Talkity Tota's recording is the substituted form of "[the topic understood].";
	now Talkity Tota is satisfied.

There’s some problem with grabbing the topic with (called …) (now reported here).

It works great now! Thanks so much for your help!