Text substitutions in tables

Hello, all:

I have looked through the manuals I have and through the books – I cannot find how to make text like definite articles optional. For example, I tried the subject that the character will speak about and I typed “{F} {Scott} Fitzgerald” but this didn’t work, even when I tried parentheses and brackets. Is it possible to make text optional? I feel embarrassed asking but can’t find what should be a simple answer.

In the above example, the player is asking about F. Scott Fitzgerald of the character.

Could you please try boiling the issue down to a minimal example that demonstrates the issue you’re having? Please put it in a code block, either using the icon in the editing bar that looks like </> or putting ia line with three back-ticks: ``` before it and another line with three back-ticks after it, so it’ll look like this:

Lab is a room.

Right now we can’t really guess how you’ve set things up, and I’m not even clear on what it is you want. Given the title, my best guess is that “F Scott Fitzgerald” is the value of a topic in a table and you want to know how to match against it.

Trouble is, you probably want any of the elements to work, but for none to be required so long as there’s at least one. But you can’t have “F/-- Scott/-- Fitzgerald/–” as a topic – it can’t match the empty string. But the desired behavior (if it is the desired behavior) is the default when parsing objects, so you could do something like:

Lab is a room.
Bob is a person in the Lab.

A subject is a kind of object.
A subject can be privately-named.
A subject is usually publicly-named.
A subject has a text called the description.
F Scott Fitzgerald is a subject. "A writer."
To say (subj - subject): say the description of subj.

Subject-asking it about is an action applying to one thing and one visible thing.
Understand "ask [someone] about [any subject]" as subject-asking it about.
Carry out subject-asking: say "[The second noun][line break]".

test me with "ask bob about f / ask bob about scott fitzgerald / ask bob about f scott / ask bob about fitzgerald"

You’ll probably want to make use of Punctuation Removal by Emily Short to deal with the player typing “F. Scott”.

2 Likes

No problem, here is the code:

instead of asking unassuming man about a topic listed in the Table of Faulkner Replies:
	say "[reply entry][paragraph break]"

Table of Faulkner Replies
topic	reply
"{F} {Scott} Fitzgerald"
"Too many tragically write themselves out too young and then their lives are unhappy.  That happened with Fitzgerald, happened with Sherwood Anderson, and so they go to pieces."


That’s a topic column (not technically texts). You can write topics that match a range of player inputs. See the end of chapter 16.13, or… hm, I’m not sure where the more explicit description of topics is. But you want "f/-- scott/-- fitzgerald".

1 Like

Thank you for the suggestion, the notation doesn’t work in the Table. But thank you for referring me to the correct chapter!

You’ll need to adjust the topic to get what you want. The example I gave requires the word “fitzgerald”, so ASK MAN ABOUT F won’t match.

My guess about what you wanted was right… my solution works.

Thank you for your help. I’ll site you in the credits, thank you.