Dialogue tables automatically referenced by actor (and more)

Hello,

In the project I’m working on, I have several actors that I would like to have the player be able to have conversations with. What I was thinking I would do is have a subject/response table for each actor. I know that I can call these tables by writing (something like):

After asking Joe about a topic listed in the Table of Joe's Responses: say "[Response entry]";

But instead of having one of these bits of code for every actor, is there some rule I could use/write that would allow me to say it once, where [Actor’s Name] can vary, so that I could write, just once, something like:

After asking [Actor's Name] about a topic listed in the Table of [Actor's Name]'s Responses: say "[Response entry]";

The reason I think it would be more efficient for me to do this is that, in general, the specific column from which the response is taken depends upon how irritated the actor is with the player; this makes each “… After asking Joe about a topic listed in…” block of code over a dozen lines. So, I’d rather not repeat that for each of the multiple actors.

Any ideas? Are my goal and motivation clear?

You can assign people tables as properties–you have to say “A person has a table name called…” rather than “A person has a table called…” Then you can implement what you want in a pretty straightforward way:

[code]Lab is a room. Bob is a man in Lab. Alice is a woman in Lab.
A person has a table name called the response table. The response table of Alice is the Table of Alice’s Responses. The response table of Bob is the table of Bob’s Responses.

After asking a person (called interlocutor) about a topic listed in the response table of the interlocutor: say the response entry.

Table of Alice’s Responses
Topic Response
“red/white queen” “Not really very polite, but I suppose they were kittens the whole time.”
“fish” “I got tired of poems about fish.”

Table of Bob’s Responses
Topic Response
“fish” “My God I love fish so much you don’t even know.”
“hook” “And line, and sinker!”[/code]

(Note that the spacing is messed up. Also that things will probably go poorly if the response tables don’t have topic and response columns, and that the yourself character gets the empty table as a response table which is probably OK.)

1 Like

Oh, well, that’s exactly the kind of thing I was thinking of. Thanks!