Dear Tony,
The current default situtiaon is that ,when the player or npc's line come to an END,the whole dialogue panel disappears.
But I am figuring how to load another scene or open another panel when the line ends?
just like
-Start scene
-"Npc:hello,world"-"Player:Goodbye![END]"
-Load scene 2 or open a panel,it shows [Gave Over!]
Where can I modify the setting?
Thank you!: )
How can I load another scene or open another panel when the line ends?
-
- Posts: 16
- Joined: Tue Apr 04, 2017 10:10 am
Re: How can I load another scene or open another panel when the line ends?
Hi,
I'll provide a few ways to do this so you can choose the one that works best for your needs.
To change scenes during a conversation, use the LoadLevel() sequencer command:
Or, add a Dialogue System Events component to one of the GameObjects that receives the OnConversationEnd event. This adds events that you can connect in the Unity inspector in the same way that you can connect event handlers to a UI Button's OnClick() event.
Or, write a script that has an OnConversationEnd() method, and add it to one of the GameObjects that receives the OnConversationEnd event. In this method, change the scene however you want.
I'll provide a few ways to do this so you can choose the one that works best for your needs.
To change scenes during a conversation, use the LoadLevel() sequencer command:
- Dialogue Text: [Player] "Take me to the cave."
- Sequence: LoadLevel(Cave)
Or, add a Dialogue System Events component to one of the GameObjects that receives the OnConversationEnd event. This adds events that you can connect in the Unity inspector in the same way that you can connect event handlers to a UI Button's OnClick() event.
Or, write a script that has an OnConversationEnd() method, and add it to one of the GameObjects that receives the OnConversationEnd event. In this method, change the scene however you want.
-
- Posts: 16
- Joined: Tue Apr 04, 2017 10:10 am
Re: How can I load another scene or open another panel when the line ends?
Hi!Tony,
Thank you!! It works!
But here comes another question.
I have 2 scenes: LevelStart and LevelEnd.
The game starts from LevelStart . When the line ends, it switches to LevelEnd. When I click Play button on Unity3d Panel, the conversation starts right away. The conversation ends up to the LevelEnd.
In the LevelEnd scene, there is a button. Onclick() ,it connects an empty object with the script Game Saver.
So when i click the button--->GameSaver-->GameSaver.RestartGame.
It did load the LevelStart,but nothing happen. The conversation doesn't start again just like I click Play button at the first beginning.
The question is as short as How to restart the game .: )
Thank you for your patience. : )
Thank you!! It works!
But here comes another question.
I have 2 scenes: LevelStart and LevelEnd.
The game starts from LevelStart . When the line ends, it switches to LevelEnd. When I click Play button on Unity3d Panel, the conversation starts right away. The conversation ends up to the LevelEnd.
In the LevelEnd scene, there is a button. Onclick() ,it connects an empty object with the script Game Saver.
So when i click the button--->GameSaver-->GameSaver.RestartGame.
It did load the LevelStart,but nothing happen. The conversation doesn't start again just like I click Play button at the first beginning.
The question is as short as How to restart the game .: )
Thank you for your patience. : )
Re: How can I load another scene or open another panel when the line ends?
Hi,
I have two recommendations:
1. In LevelStart, get rid of the Play button. Instead, change the Conversation Trigger to OnStart. This way, when GameSaver loads LevelStart, the conversation will automatically restart.
2. Or, add a new scene 0 named GameStart. Put the Play button in GameStart. When the player clicks the Play button, load LevelStart. Set up LevelStart as #1 above. This way the player will see a Play button when the game first loads, but when the game restarts it will go directly to the conversation. If you're using a Level Manager component, set its Default Starting Level to LevelStart. Otherwise, set the Game Saver's Starting Level to LevelStart.
I have two recommendations:
1. In LevelStart, get rid of the Play button. Instead, change the Conversation Trigger to OnStart. This way, when GameSaver loads LevelStart, the conversation will automatically restart.
2. Or, add a new scene 0 named GameStart. Put the Play button in GameStart. When the player clicks the Play button, load LevelStart. Set up LevelStart as #1 above. This way the player will see a Play button when the game first loads, but when the game restarts it will go directly to the conversation. If you're using a Level Manager component, set its Default Starting Level to LevelStart. Otherwise, set the Game Saver's Starting Level to LevelStart.
-
- Posts: 16
- Joined: Tue Apr 04, 2017 10:10 am
Re: How can I load another scene or open another panel when the line ends?
Hi Tony,Tony Li wrote:Hi,
I have two recommendations:
1. In LevelStart, get rid of the Play button. Instead, change the Conversation Trigger to OnStart. This way, when GameSaver loads LevelStart, the conversation will automatically restart.
2. Or, add a new scene 0 named GameStart. Put the Play button in GameStart. When the player clicks the Play button, load LevelStart. Set up LevelStart as #1 above. This way the player will see a Play button when the game first loads, but when the game restarts it will go directly to the conversation. If you're using a Level Manager component, set its Default Starting Level to LevelStart. Otherwise, set the Game Saver's Starting Level to LevelStart.
I made a simple demo. It restarted and loaded to LevelStart Again.But the conversation do not start,I don't know why.
In the LevelStart, I attached the Conversation Trigger to Dialogue Manager and set the Conversation Trigger to OnStart.
In the LevelEnd,I created a empty object and attach the Game Saver to it . And I made a button linked to the Restart function.
When I clicked the button. The scene switched from LevelEnd to LevelStart. But nothing shows on the screen. The conversation did not start.
I used Level Manager component instead of Game Saver component. I even write the script call the function SceneManager.LoadLevel("LevelStart"); But it resulted to the same. When I clicked the button, the scene switched to LevelStart, the conversation didn't start.
Please Help~~~~
- Attachments
-
- 屏幕快照 2017-04-14 15.07.31.png (78.56 KiB) Viewed 3086 times
-
- 屏幕快照 2017-04-14 15.04.33.png (112.2 KiB) Viewed 3086 times
-
- 屏幕快照 2017-04-14 15.03.19.png (35.61 KiB) Viewed 3086 times
Re: How can I load another scene or open another panel when the line ends?
Move the Conversation Trigger to a separate GameObject in LevelStart.
The Dialogue Manager GameObject survives across scene changes. This means it only runs "OnStart" once, at the very beginning of the game.
If you move the Conversation Trigger to a different GameObject in LevelStart, it will run "OnStart" every time you load LevelStart.
The Dialogue Manager GameObject survives across scene changes. This means it only runs "OnStart" once, at the very beginning of the game.
If you move the Conversation Trigger to a different GameObject in LevelStart, it will run "OnStart" every time you load LevelStart.