Modify conversation (reload Database?) in Play Mode?

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
Jamez0r
Posts: 59
Joined: Fri Nov 20, 2020 8:18 pm

Modify conversation (reload Database?) in Play Mode?

Post by Jamez0r »

Hey Tony! I feel like this question has probably already been asked, but I searched this forum and couldn't find it.

We're using typewriter, and have been adding the RPG-Maker style 'pauses' in our conversation. It's tough to get the right 'flow' for the conversations, so we are finding that we have to run the game and talk to the NPC, note down how we want to change the 'pauses', stop the game, modify the conversation, then run the game again and check if it feels right.

Is there a way that we could quicken this process by making modifications to the Dialogue Database while the game is running? I think I recall from the documentation that the database is essentially loaded (copied into memory) when you run the game... might there be a way that I could re-load it after making changes?

The end goal would be able to run the game, start the conversation with the NPC and make changes to its Conversation (in the Dialogue window), then exit the conversation, do whatever magic to reload/update the database, then restart the conversation and see how the changes feel. Rinse, repeat, without having to stop and start the game running.

Could it be possible? :geek:

Thanks as always for the help!!
User avatar
Tony Li
Posts: 22037
Joined: Thu Jul 18, 2013 1:27 pm

Re: Modify conversation (reload Database?) in Play Mode?

Post by Tony Li »

Hi,

Before entering play mode, UNtick the Dialogue Manager's Other Settings > Instantiate Database. This will make the Dialogue System use the dialogue database asset directly. Any changes you make in the Dialogue Editor window will be reflected right away.

However, the catch is that if any of your custom code makes changes to the dialogue database, they'll be permanent since you're directly accessing the asset instead of using an in-memory copy. However, there should be no reason to change the dialogue database in code. Normally you change Lua values instead (e.g., via DialogueLua.SetVariable).
Jamez0r
Posts: 59
Joined: Fri Nov 20, 2020 8:18 pm

Re: Modify conversation (reload Database?) in Play Mode?

Post by Jamez0r »

Tony Li wrote: Fri Apr 30, 2021 9:36 pm Hi,

Before entering play mode, UNtick the Dialogue Manager's Other Settings > Instantiate Database. This will make the Dialogue System use the dialogue database asset directly. Any changes you make in the Dialogue Editor window will be reflected right away.

However, the catch is that if any of your custom code makes changes to the dialogue database, they'll be permanent since you're directly accessing the asset instead of using an in-memory copy. However, there should be no reason to change the dialogue database in code. Normally you change Lua values instead (e.g., via DialogueLua.SetVariable).
Thanks for the super quick response Tony!

Sounds great - about to test it out! Had one quick follow-up question: is there any downside to keeping the "instantiate database" setting unchecked permanently? Like, would it make any difference in a production build or anything like that, where I should set it back?
Jamez0r
Posts: 59
Joined: Fri Nov 20, 2020 8:18 pm

Re: Modify conversation (reload Database?) in Play Mode?

Post by Jamez0r »

Tony Li wrote: Fri Apr 30, 2021 9:36 pm Hi,

Before entering play mode, UNtick the Dialogue Manager's Other Settings > Instantiate Database. This will make the Dialogue System use the dialogue database asset directly. Any changes you make in the Dialogue Editor window will be reflected right away.

However, the catch is that if any of your custom code makes changes to the dialogue database, they'll be permanent since you're directly accessing the asset instead of using an in-memory copy. However, there should be no reason to change the dialogue database in code. Normally you change Lua values instead (e.g., via DialogueLua.SetVariable).
Hmm, I just checked and "Instantiate Database" was already un-ticked. I ran the game again, talked to an NPC, exited the conversation, changed some of the dialogue in the conversation, and then talked to the NPC and it did not show the new changes. (It did show the nodes highlighted in green in the Dialogue window as I progressed through the conversation, but didn't show the new changes in-game). I tried doing a File -> Save Project just in case that mattered. Could there be any other setting that is preventing my changes from getting saved/updated, or anything else I could check? :oops:
User avatar
Tony Li
Posts: 22037
Joined: Thu Jul 18, 2013 1:27 pm

Re: Modify conversation (reload Database?) in Play Mode?

Post by Tony Li »

Also temporarily set the Dialogue Manager's Other Settings > Warm Up Conversation Controller to Off. That could use some more documentation in the manual.
Jamez0r
Posts: 59
Joined: Fri Nov 20, 2020 8:18 pm

Re: Modify conversation (reload Database?) in Play Mode?

Post by Jamez0r »

Badass - that did indeed work! Thanks Tony, gonna save us a lot of time!

I did notice that with Warm Up set to Off, when I talk to an NPC for the first time after running the game, it took a good 6 seconds for the dialogue to start to appear. Is that normal with the setting set to Off? Not a big deal, since we can just set it to Off when we need to do these conversation-tweaks, and then set it back to On. Mostly was just curious :)

Thanks!!
User avatar
Tony Li
Posts: 22037
Joined: Thu Jul 18, 2013 1:27 pm

Re: Modify conversation (reload Database?) in Play Mode?

Post by Tony Li »

Yes. The warmup takes care of that initialization when the game starts so it's not present during play. But the warmup requires instantiating the database. So, like you said, just set it back to On or Extra when you're done editing the database during play.
Jamez0r
Posts: 59
Joined: Fri Nov 20, 2020 8:18 pm

Re: Modify conversation (reload Database?) in Play Mode?

Post by Jamez0r »

Perfecto. Thanks a lot!!
Post Reply