Best Practice for feeding text into the dialogue box

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
boz
Posts: 76
Joined: Mon Oct 19, 2020 8:59 pm

Best Practice for feeding text into the dialogue box

Post by boz »

Howdy,

I want to create a system where:
1) Dialogue plays, you hit next next next, then it asks you to make a choice.
2) This choice happens in a different UI outside of the dialogue box (DSFU doesn't know about it).
3) Then the result of that choice has it's own logic and dice rolls and etc then feeds the result back into the dialogue box.

So this wouldn't be telling the DSFU to select a node and play that text, it just simply just outputs the result of what happened in the dialogue box, probably a constructed string sent from a script.

Eventually, an event will tell the DSFU to pick up at a dialogue node (would it have to start a new conversation? Or can you use an outside script to specify a specific node to start from?).

My main question is - what would be a best practice for allowing an outside script to feed in text to the dialogue?
And then an advanced version of that - could a defined Actor in the database be saying those resulting messages?
Ex:
NARRATOR:
You received a wound: Sprained Ankle.
You lost 5 stamina.

Thanks for any advice :D
User avatar
Tony Li
Posts: 22049
Joined: Thu Jul 18, 2013 1:27 pm

Re: Best Practice for feeding text into the dialogue box

Post by Tony Li »

Hi,

One way is to write a custom sequencer command. (See Cutscene Sequences Tutorials part 6.)

For example, say you write a command ResolveCombat that does its own logic. At the end, it uses DialogueLua.SetVariable() to record the result in a Dialogue System variable named "Result". Then your conversation could look like this:

externalAction.png
externalAction.png (15.59 KiB) Viewed 215 times

The last node's Dialogue Text uses the [var=variable] markup tag to show the value of the variable Result.
boz
Posts: 76
Joined: Mon Oct 19, 2020 8:59 pm

Re: Best Practice for feeding text into the dialogue box

Post by boz »

I managed to get something working with this, thank you!
User avatar
Tony Li
Posts: 22049
Joined: Thu Jul 18, 2013 1:27 pm

Re: Best Practice for feeding text into the dialogue box

Post by Tony Li »

Happy to help!
Post Reply