Download

Integrating conditional checks into dialog

The dialog system I wrote is currently extremely simple: I feed it a datatable where each row contains a single line of dialogue and stuff like character portraits, animation prompts for the speaker, audio clips for recorded dialogue, and so forth. Player choices (e.g. “Slay the dragon,” “Flee from the dragon”) are entered with an accompanying FName key that corresponds to a row name in my data table, such that selecting a choice prompts the system to iterate down the tree looking for a line with that row name and continue displaying lines from there.

It works perfectly well for displaying dialog, but right now I have no ability to actually interface with game data. I would ideally like to remember previous player choices and use them to branch future dialog to create the illusion of consequences. Mechanically all I need to do is get/set bools and integers to represent player decisions, but since I’m trying to keep my entire dialog system data-driven (and not hardcoded), I’m struggling to figure out how to accomplish this short of creating an entire scripting language and directly injecting logic into my dialog. Is there something obvious I’m missing, or is a scripting language the obvious way to go here?