So I’ve got a bit in-game that generates a paragraph or two of randomized text. I’d like high variation and also correlation between early and later bits. For example, if the first sentence is “You spot an apple on the shelf.” the second sentence is related to the apple, and makes sense in context.
I’ve got a handle on picking subjects and verbs, but it’s a little complicated routing through the action. Before I do much coding, I wanted to double check that this seems reasonable (code not compileable - only for example purposes):
[code]To say a random paragraph of text:
To say initial:
if a random chance succeeds:
say “Blah! [secondary A]”;
otherwise if a random chance succeeds:
say “Blah. [secondary B]”;
say “Blah? [one of][secondary A][or][secondary B][or][secondary C][at random]”.
Is that the best way to do it? I can sorta imagine something with tables, but I don’t know if it would actually be any easier/cleaner/more flexible, and having a dozen tables for random text gen feels sort of extravagant.