What is the recommended way to start scene-specific events after specific dialog?

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
User avatar
Hulda_Gnodima
Posts: 19
Joined: Fri Jan 17, 2020 9:04 am

What is the recommended way to start scene-specific events after specific dialog?

Post by Hulda_Gnodima »

Hi Tony!

Two questions about how you would recommend using your system! :)


Q1.) Best way to handle triggering scene-specific events in dialog:
I'm wondering what method you recommend when wanting to trigger scene-specific events after a specific dialog ends/starts?

I can code my own workarounds, but I was thinking you possibly had some recommendations with what works well with your system :). I looked/googled but couldn't find anything specific about your asset with this, but I may just be really bad at looking for it!

Things I want to make happen in connection with a specific dialog (assuming there are multiple dialogs in a scene) starting/ending/happening are for instance:
A. Transition to new scene.
B. Start custom scene-specific-scripts (like changing the music)

Q2.) Best way to update which conversation will be played
I was also wondering if you have recommendations on how to handle changing the dialogues that are triggered by an NPCs "Dialog System Trigger" (DST) in a Scene? My thought is to write a custom script that checks if conversation has happened and if so gets the DST-component and sets "Conversation" to something new, but I thought perhaps you have a built in way to do this that I should use instead.

Thanks in advance! You are amazing and your asset is WONDERFUL : )
Best regards,
Hulda
User avatar
Tony Li
Posts: 22049
Joined: Thu Jul 18, 2013 1:27 pm

Re: What is the recommended way to start scene-specific events after specific dialog?

Post by Tony Li »

Hi Hulda!
Hulda_Gnodima wrote: Thu Apr 15, 2021 5:15 pmQ1.) Best way to handle triggering scene-specific events in dialog:
To transition to a new scene during a conversation (including the last dialogue entry node of a conversation), use the LoadLevel() sequencer command in the node's Sequence field. If you have set up the save system, it will use the save system, including a nice scene transition if you've set up the save system's scene transition manager. (The SaveSystemPrefabs package on the Dialogue System Extras page has Save System prefab with a preconfigured scene transition manager.) If you haven't set up the save system, it will just use Unity's default SceneManager.LoadScene().

Here are two ways to start custom scene-specific scripts:

1. For one-off events, use a scene event.

2. If it's something that you can generalize to use in multiple places, use the SendMessage() sequencer command, or write a custom sequencer command, or register a C# method with Lua.

Hulda_Gnodima wrote: Thu Apr 15, 2021 5:15 pmQ2.) Best way to update which conversation will be played
See: How To: Run a Conversation Only Once. The second post in the thread suggests ways to play different conversations after the player has seen the first conversation.

I don't recommend changing the Dialogue System Trigger's conversation field because the change won't be included in save data unless you handle that yourself. So if you save the game and reload, or move to a different scene and return to the original scene, the Dialogue System Trigger's conversation field will be reset to its original value.
User avatar
Hulda_Gnodima
Posts: 19
Joined: Fri Jan 17, 2020 9:04 am

Re: What is the recommended way to start scene-specific events after specific dialog?

Post by Hulda_Gnodima »

Thank you so much for your quick reply as always! I'm glad I asked. I will take your recommendations to heart, they sounds very good. :)
User avatar
Tony Li
Posts: 22049
Joined: Thu Jul 18, 2013 1:27 pm

Re: What is the recommended way to start scene-specific events after specific dialog?

Post by Tony Li »

Glad to help!
Post Reply