Start conversation when new scene is loaded? (ink)
-
- Posts: 9
- Joined: Fri Dec 18, 2020 7:35 am
Start conversation when new scene is loaded? (ink)
Hello,
Apologies if this is a RTFM question but I can't seem to find a straight forward answer and have tried multiple approaches. I simply want to set up each scene so that a conversation starts as soon as the scene loads. Is it possible to do this with dialogue triggers or will I need to create my own system with scripts? I am using inkle to generate my conversations.
Apologies if this is a RTFM question but I can't seem to find a straight forward answer and have tried multiple approaches. I simply want to set up each scene so that a conversation starts as soon as the scene loads. Is it possible to do this with dialogue triggers or will I need to create my own system with scripts? I am using inkle to generate my conversations.
Re: Start conversation when new scene is loaded? (ink)
Hi,
Set the scene's Dialogue System Trigger to OnStart.
Set the scene's Dialogue System Trigger to OnStart.
-
- Posts: 9
- Joined: Fri Dec 18, 2020 7:35 am
Re: Start conversation when new scene is loaded? (ink)
Hi Tony
I tried that. but it only seems to run when the game first starts, even if I include a dialogue manager in every scene. If I switch scenes while the game is running, the conversation does not start.
I tried that. but it only seems to run when the game first starts, even if I include a dialogue manager in every scene. If I switch scenes while the game is running, the conversation does not start.
Re: Start conversation when new scene is loaded? (ink)
Hi,
Are the Dialogue Manager's Other Settings > Allow Only One Instance and Don't Destroy On Load checkboxes ticked?
Are there any errors or warnings in the Console window?
Are the Dialogue Manager's Other Settings > Allow Only One Instance and Don't Destroy On Load checkboxes ticked?
Are there any errors or warnings in the Console window?
-
- Posts: 9
- Joined: Fri Dec 18, 2020 7:35 am
Re: Start conversation when new scene is loaded? (ink)
Both settings are checked on the Dialogue Manager object. There are no errors in the console. I have also double checked that all json files are registered with the Dialogue Manager ink integration script. I don't know if this would make a difference, but I am changing the scene via LoadLevel() called in my ink script.
Re: Start conversation when new scene is loaded? (ink)
Hi,
One way to handle it is to set a Dialogue System variable to the name of the next scene:
1. Define a variable -- for example, named "NextScene" -- and set its initial value to "none".
2. In your Ink script, use {Sequence(SetVariable(NextScene,sceneName))} to set the NextScene variable.
3. Add a Dialogue System Trigger to the Dialogue Manager.
That's probably it. Your Ink script runs within the context of a Dialogue System conversation. The conversation is still active when it calls LoadLevel(), so the Dialogue System won't let it start a new conversation.Frost Mage wrote: ↑Sat Dec 26, 2020 9:04 pmI don't know if this would make a difference, but I am changing the scene via LoadLevel() called in my ink script.
One way to handle it is to set a Dialogue System variable to the name of the next scene:
1. Define a variable -- for example, named "NextScene" -- and set its initial value to "none".
2. In your Ink script, use {Sequence(SetVariable(NextScene,sceneName))} to set the NextScene variable.
3. Add a Dialogue System Trigger to the Dialogue Manager.
- Set it to OnConversationEnd.
- In the Conditions section, check if the variable NextScene is no longer "none".
- In the Actions section, select Add Action > Play Sequence. In the Sequence, use LoadLevel() to load the scene and SetVariable() to set the variable back to "none".
-
- Posts: 9
- Joined: Fri Dec 18, 2020 7:35 am
Re: Start conversation when new scene is loaded? (ink)
Thank you Tony, that worked like a charm!
-
- Posts: 9
- Joined: Fri Dec 18, 2020 7:35 am
Re: Start conversation when new scene is loaded? (ink)
Addendum:
I am trying to add saving to my project, but every time I add the Dialogue System saver component to my project the scene transitions break down. No errors are shown, and it appears that the new dialogue is run for a split second before closing.
I am trying to add saving to my project, but every time I add the Dialogue System saver component to my project the scene transitions break down. No errors are shown, and it appears that the new dialogue is run for a split second before closing.
Re: Start conversation when new scene is loaded? (ink)
Hi,
What Saver components are you using? If you're using a Conversation State Saver component, remove it. Conversation State Saver isn't designed to work with the Ink integration.
Are there any warnings or errors in the Console window?
What Saver components are you using? If you're using a Conversation State Saver component, remove it. Conversation State Saver isn't designed to work with the Ink integration.
Are there any warnings or errors in the Console window?
-
- Posts: 9
- Joined: Fri Dec 18, 2020 7:35 am
Re: Start conversation when new scene is loaded? (ink)
I removed the Dialogue save system component and everything seems to work fine. I am using a "JSON data serializer" and "Playerprefs Saved Game Data Storer" components. I have the "include in save data" option checked on my Ink integrator.