Substitutable text *within* the source code itself?

In the “say” command, we are able to have substitutable text like so:

I am wondering if there is any way to do this inside the source code itself?

For example, using the chatnodes that come with Mark Tilford’s “Simple Chat” extension, let’s say we have defined a chat-node for every NPC in the game;

And then we have defined some action that will lead the player to a chat node, and, naturally, the chat node that the player gets led toward depends on who the player is talking to - here’s an example:

This works quite nicely, but, purely for the sake of knowing, i wonder if there is a way to put substitutable text inside the source code somehow?

Is there any mechanism where the above action could be condensed to something of the formula:

Has anyone developed some clever way to do this?

How about something like this:

[code]Table of People Chat
Name Node-Name
Ben Ben-chatnode1
Alice Alice-chatnode1
Nazeem Nazeem-chatnode1
[note that the spaces between the Name and Node-Name, and correspondingly on the rows below it, should be tabs instead, for the table to work correctly]

Carry out chatting:
choose row with a Name of noun in the Table of People Chat;
run a conversation from Node-Name entry;
stop the action.[/code]

That sounds like a brilliant idea. I’ll play around with that! Thank-you :slight_smile:

You might also try something like this:

A person has a chat node called the chatter. 
The chatter of Ben is Ben-chatnode1. 
The chatter of Alice is Alice-chatnode1. 
The chatter of Nazeem is Nazeem-chatnode1.

Carry out chatting:
   run a conversation from the chatter of the noun.