[Gameplay data structure] Dialogue and Choices

Hello there!
I’m testing for the first time around dialogue trees.

I’m storing the conversations inside an XML file. Simple Conversation nodes: prompt with id, answers and links to other nodes.

It works great.
But what’s the smartest way to make some answer “active”? What if I want consequences? I obviously can’t hard-code the possibilities in the conversation manager, so I have to encode it somehow directly in the xml.

And not only story persistent choices. I’m talking also about animations. What’s the best way to mark certain animation reactions based on the answer choosen?

Thanks for the answers

Can’t you just add some extra tags with references to animations and C# functions?

1 Like

yup…Solved.
I didn’t know the System.Reflection library and the method.Invoke function.
Thanks for the tip ^^

Reflection is awesome, but watch out, it can end up having a big performance cost if you do it too much. Save your function reference in a pointer or whatever.