What I have so far is:
Code: Select all
/w
[h: Player = getAllPlayerNames()]
[h: NPC = input(
"SelectNPC |Salvana Wrafton,Eilias,Valthrun the Prescient|Choose an NPC| LIST",
"topicSelect |Kobolds,Shadowfall Keep,Burial Ground| Choose a topic to respond to | LIST| VALUE=STRING",
"playerSelect |"+ Player +" | Choose a Player | LIST | VALUE=STRING"
)]
[h: Response=table(topicSelect,selectNPC)]
{playerSelect + " " + Response}
What I would prefer, is to generate a list of NPC's by doing something like a Get on a "NPC" table for values, akin to how the player list is generated. However the only way I can think of doing that would be to recursively build a string by appending to the string with table calls, and I'm not really sure how you would do that...
So my questions are, is this the most effiecient way of going about this? Is there a way to dynamically build the NPC, and Topic lists from reference tables? do you see any gotcha's with the existing code?
I attempted to originally code this with properties on tokens. Where I would have a collection of NPC tokens that had properties corresponding to the various topics, with a value that was the response that NPC would give, but I had too many headaches with calling the tokens from other maps. That said I may go back to that method, as tables look to be problematic also.