Page 1 of 1
Changing NPC Conversations
Posted: Mon May 24, 2021 8:08 pm
by YeeHonk
I'm looking for advice on how to handle NPC conversations similar to games like Rune Factory 4, Stardew Valley, etc.
I have a calender ingame and I would like each day for the NPCs to say something different to keep the world feeling lively. Has anyone successfully implemented such a concept with Dialogue System?
Re: Changing NPC Conversations
Posted: Mon May 24, 2021 9:32 pm
by Tony Li
Hi,
One way is to record the current day in a variable:
Code: Select all
DialogueLua.SetVariable("Day", 14); // C# code
and branch your conversation based on that variable:
- dayVariableConversation.png (43.43 KiB) Viewed 320 times
You can also vary the conversation using the RandomElement() function in your Dialogue Text:
- Dialogue Text: "[lua(RandomElement("You've been here a while.|Hi, old timer.|Still here, eh?")]"
You can also add variables and conditions for other world info such as the current weather, or special events.
To change the order in which links are checked, inspect the originating node (e.g., the <START> node in the screenshot above). The "Links To:" section at the bottom shows the order in which they'll be checked. You can also change the priorities of the link arrows to specify which ones take precedence.
Re: Changing NPC Conversations
Posted: Tue May 25, 2021 8:01 pm
by YeeHonk
Thank you for the advice with screenshots Tony! You are the best!
Re: Changing NPC Conversations
Posted: Tue May 25, 2021 9:39 pm
by Tony Li
Happy to help!