Conversation tables with text OR objects plus requirements

Hi folks. I’m trying to let the user do “talk about [something]” or “t [something]” and have it work similarly to the documentation’s “Nameless” example wherein the [something] can be an object (visible thing) or a text token. Besides having a shorter command, the main reason I can’t lift the code straight from the example is because my NPC can only talk in certain circumstances.

It probably would have been smart of me to post this question before my source text so big it’s infeasible to post the whole thing, but here are the relevant parts. (I tried it a few different ways. This way is stupid and redundant but it’s what I have now because it’s the version with the least problems. Still doesn’t work right though!)


Understand "t [text]" and "talk [text]" and "talk about [text]" as talking about. Talking about is an action applying to one topic. Instead of talking about something, try asking Faith about it.

Understand "t [something]" and "talk about [something]" as discussing. Discussing is an action applying to one thing. 

Instead of asking Faith about a topic listed in the Table of Faith Topics while faith is talkable: 
	if Faith is not visible:
		if the mood of Faith is hostile:
			say "There's no one around to hear you speak.";
			rule fails;
		otherwise:
			say "Faith isn't here right now.";
			rule fails;
	if Faith is not talkable:
		say Faith can't talk;
		rule fails;
	say "[reply entry][paragraph break]". 
	
carry out asking Faith about something: 
	if Faith is not visible:
		if the mood of Faith is hostile:
			say "There's no one around to hear you speak.";
			rule fails;
		otherwise:
			say "Faith isn't here right now.";
			rule fails;
	if Faith is not talkable:
		say Faith can't talk;
		rule fails;
	say "[shrug]". 
	
The block asking rule does nothing;

carry out discussing:
	if Faith is not visible:
		if the mood of Faith is hostile:
			say "There's no one around to hear you speak.";
			rule fails;
		otherwise:
			say "Faith isn't here right now.";
			rule fails;
	if Faith is not talkable:
		say Faith can't talk;
		rule fails;
	if there is a reply corresponding to an item of the noun in the Table of Faith Objects:
		let R be the reply corresponding to an item of the noun in the Table of Faith Objects;
		say "[R][paragraph break]";
		rule succeeds;
	otherwise:
		say "[shrug]";
		rule fails;
		
to say Faith can't talk:
	if the shape of Faith is blob:
		say "[The Faith] holds still while you speak, then [one of]jiggles[or]flattens out[or]wobbles[at random] in response. [It] may or may not have understood you, but either way, [it]'s not going to answer.";
	otherwise if the shape of Faith is dragon or the shape of Faith is turtle:
		say "Faith looks at you while you speak, but her response is a [one of]series of incomprehensible gestures[or]swish of her tail[or]little dance[at random][one of] accompanied by some vocal grunts[or] and a low-pitched squawking sound[or], followed by attentive silence[or][at random]. It seems she can't speak in this form.";

to say shrug:
	say "'Fay not know much about that,' Faith admits quietly."

[code]Definition: Faith is talkable if the shape of Faith is bird or the shape of Faith is fairy.

Shape is a kind of value. The shapes are blob, fairy, bird, turtle, dragon, and unicorn. Faith has a shape. Understand the shape property as describing Faith. [/code]

[code]Table of Faith Topics
topic reply
“snack/food” “‘Snack?!’ Faith demands. ‘Where is?!’”
“salt” “‘Um, Gorvy keep some in the kitchen?’ Faith suggests. ‘Gorvy and Arie like to eat it.’”

Table of Faith Objects
item reply
Faith “‘Fay is a good girl!’ Faith [if the shape of Faith is fairy]bounces[otherwise]flaps her wings[end if] excitedly.”
canister of salt “‘Arie says it makes food tasty,’ says Faith, but her voice is full of doubt. She eyes the canister warily. ‘Fay not like to touch it.’”
[/code]

Results:

ask faith about [thing] = wrong (always gets the “shrug” text)
t [thing] = works correctly
ask faith about [text] = works correctly
t [text] = wrong (just a line break with no text)

Help? :confused:

Thanks.

It doesn’t look like you’ve defined an action for asking about a thing, as opposed to a topic. You need to make a new action with a grammar line “ask [someone] about [any thing]” or Inform will always treat “Ask faith about canister” as applying to the topic “canister,” even if “canister” is the name of an object.

I’m not having a problem with the code you posted (modified a bit to make it compile at Playfic.com); are you sure you don’t have another rule interfering with this command? Start the game, type “rules” and then “actions,” and then try the command to see what’s happening.

Also, as you’ve defined discussing it seems as though it will only work for things the player can touch. You might want to make the action apply to one visible thing and change the grammar to “t [any thing]”.