Commanding a character to do things randomly

Hi. I’m new… and so forth.

The documentation and examples are, in a word–exhaustive. But trying to actually piece together the code that inform will understand, of what I want to do, is difficult. I’ll scour the rule book, examples, and the “yellow pages” as I call them, and try different things. Usually I scrape together something that runs, eventually. Not this time.

I’ll just put some code here, and add [comments] to what I can’t figure out. If that’s not enough, please let me know how to clarify. This is a huge stumbling block.

The Magician is a man. "Like something out of Vaudeville, he stands there in a long-tailed black tuxedo, top hat, and white gloves. His fingers are poised to perform mesmerizing miracles, preposterous prestidigitation, and feats of ludicrous legerdemain."
 
Performing is an action that applies to.. [no idea here]
 
<player input> Magician, perform
[Magician performs one of the following illusions completely at random]
 
say "The [the noun] snaps his fingers and there is a thunderclap, followed by a puff of smoke that covers him completely. When it clears, he is wearing a white tuxedo."
 
say "The [the noun] waves one glove in front of the other and produces a playing card, which he flings into the air--it disappears in a brief flash of flame."
 
say "The [the noun] pulls his top hat off and holds it against his chest, upside down. He reaches inside and his arm sinks down to the shoulder. He pulls it up with a dazzling smile and produces a rabbit."

What are my options? Please don’t assume I know anything beyond what I’ve shown you, explain the entire method from start to finish.

2 Likes

I’m putting together a new edition of my Inform Handbook. In the meantime, the existing edition (from 2015) is available for download from this obsolete page on my obsolete website: The Inform 7 Handbook

My general advice (based on my frustration years ago when I first tried to learn TADS 3) is, start with simple challenges. You’ve given yourself a rather complex challenge there, so it’s not surprising that you’ve hit a roadblock.

I’m going to have a look at your idea for a scene, because it’s interesting. Maybe someone else will post a solution before I get to it. Maybe I’ll have a solution in an hour or so. Or not … we’ll see.

2 Likes

Okay, here’s a version that does the basic stuff you have in mind:

The Magic Lab is a room. "Magicians work on their tricks here."

The magician is a man in the Magic Lab. The description is "Like something out of Vaudeville, he stands there in a long-tailed black tuxedo, top hat, and white gloves. His fingers are poised to perform mesmerizing miracles, preposterous prestidigitation, and feats of ludicrous legerdemain."
 
Performing is an action applying to nothing. Understand "perform" as performing.

Persuasion rule for asking the magician to try performing: persuasion succeeds.

Instead of the magician performing:
	say "The magician [one of]snaps his fingers and there is a thunderclap, followed by a puff of smoke that covers him completely. When it clears, he is wearing a white tuxedo[or]waves one glove in front of the other and produces a playing card, which he flings into the air--it disappears in a brief flash of flame[or]pulls his top hat off and holds it against his chest, upside down. He reaches inside and his arm sinks down to the shoulder. He pulls it up with a dazzling smile and produces a rabbit[at random].";
	rule succeeds.

The first thing I did was add a room, in order to have a place for the tricks to be performed. Second, I provided an adequate definition of a new action, performing. Third, in order to command a character to do something, you have to have a persuasion rule that succeeds. Then I added an instead rule, which prints some text. The text switches among three possible outcomes at random. The “rule succeeds” is needed to prevent a final line indicating (wrongly) that the magician couldn’t do that.

4 Likes

Much obliged, Jim. Your example works, and the explanation really helps. Also appreciate the pointer to your manual, outdated or not–I’ll keep it handy and probably work through a few sections.

I was trying to mess around with tables as responses, based on one of the “conversation” guides in the documentation. It looks like that wasn’t the right direction to go with at all.

Aside: peeked at your book on Amazon from '85. It brought back some memories of breezing through paperbacks on lazy summer days.

2 Likes

“Walk the Moons Road” could use a floor-to-ceiling rewrite. That’s why I’ve never brought it back into print in a self-published edition. On the other hand, “The Wall at the Edge of the World” (from 1993) required basically no changes at all. I might have changed an adjective somewhere, but the new edition is the same text as the old one.

3 Likes