Disable Continue Button for Response/Load Scene on Response
Disable Continue Button for Response/Load Scene on Response
Hello forum :>
I'm working on a 2D RPG, and I encountered some issues using dialogue system.
1) Is it possible to disable the continue function only when there's options in dialogue?
I am currently on "always" for continue and I turned off "always force response" as I want PC's subtitle to print normally. My continue button is the size of the screen so that player can tap anywhere to continue the dialogue, but I want the response options to be unskippable during dialogue. Player needs to choose an option before proceeding to the remaining part of the dialogue. Is there a way for me to do so?
2)Is it possible to load a different scene upon dialogue response?
I wanted the response options at the end of the dialogue to be something like "enter office", "leave building", "go home". When player picks the option, the respective scene will load and player will be transferred to that scene. How could I set it up?
Thank you so much for your time!
I'm working on a 2D RPG, and I encountered some issues using dialogue system.
1) Is it possible to disable the continue function only when there's options in dialogue?
I am currently on "always" for continue and I turned off "always force response" as I want PC's subtitle to print normally. My continue button is the size of the screen so that player can tap anywhere to continue the dialogue, but I want the response options to be unskippable during dialogue. Player needs to choose an option before proceeding to the remaining part of the dialogue. Is there a way for me to do so?
2)Is it possible to load a different scene upon dialogue response?
I wanted the response options at the end of the dialogue to be something like "enter office", "leave building", "go home". When player picks the option, the respective scene will load and player will be transferred to that scene. How could I set it up?
Thank you so much for your time!
Re: Disable Continue Button for Response/Load Scene on Response
Hi,
If the continue button is still visible while the response menu is visible, make sure the continue button is assigned to the subtitle panels' Continue Button field. This allows the subtitle panels to hide the continue button when appropriate (e.g., before a response menu).
I am currently on "always" for continue and I turned off "always force response" as I want PC's subtitle to print normally. My continue button is the size of the screen so that player can tap anywhere to continue the dialogue, but I want the response options to be unskippable during dialogue. Player needs to choose an option before proceeding to the remaining part of the dialogue. Is there a way for me to do so?
You can optionally specify a "spawnpoint" where the player should appear in the new scene. The spawnpoint is typically an empty GameObject placed in the scene. Example:
This would place the GameObject tagged "Player" at the position of the FoyerSpawnpoint GameObject in the Office scene.
More info: Cutscene Sequences
Set the Dialogue Manager's Subtitle Settings > Continue Button dropdown to Not Before Response Menu.
If the continue button is still visible while the response menu is visible, make sure the continue button is assigned to the subtitle panels' Continue Button field. This allows the subtitle panels to hide the continue button when appropriate (e.g., before a response menu).
I am currently on "always" for continue and I turned off "always force response" as I want PC's subtitle to print normally. My continue button is the size of the screen so that player can tap anywhere to continue the dialogue, but I want the response options to be unskippable during dialogue. Player needs to choose an option before proceeding to the remaining part of the dialogue. Is there a way for me to do so?
Yes. Use the LoadLevel() command in the response node's Sequence field, such as:
Code: Select all
LoadLevel(Office)
Code: Select all
LoadLevel(Office, FoyerSpawnpoint)
More info: Cutscene Sequences
Re: Disable Continue Button for Response/Load Scene on Response
Thank you so much for your fast response!
I tried the loadscene out and it worked smoothly.
However, for the response issue,
Objects are assigned accordingly on the standard dialogue UI.
I modified based on JRPG Template Standard Dialogue UI. The part that I changed under response menu panel is that I replaced the vertical layout group with grid layout group under "Content". I wanted my options to be in columns of 2.
On top of that I assigned a UI button key trigger to the response button template for the button to work.
I am still new to the unity so I hope this does not confuse you.
May I know why is only the first option of the response clickable? Also why is it clickable even outside of the dialogue box?
Thank you so much for your help.
I tried the loadscene out and it worked smoothly.
However, for the response issue,
I threw in a sprite to check on the behaviour of the continue button. I realised that when "Not before response menu" is set, it did disable the continue button. However, I realised that the true issue that caused the dialogue to proceed is that, when I click outside of the dialogue box, the first option of the response is been clicked instead. Anywhere I click when there's a response menu will lead to the first option being clicked. Other options are unclickable.Tony Li wrote: ↑Mon Feb 10, 2020 9:30 am Hi,Set the Dialogue Manager's Subtitle Settings > Continue Button dropdown to Not Before Response Menu.
If the continue button is still visible while the response menu is visible, make sure the continue button is assigned to the subtitle panels' Continue Button field. This allows the subtitle panels to hide the continue button when appropriate (e.g., before a response menu).
Objects are assigned accordingly on the standard dialogue UI.
I modified based on JRPG Template Standard Dialogue UI. The part that I changed under response menu panel is that I replaced the vertical layout group with grid layout group under "Content". I wanted my options to be in columns of 2.
On top of that I assigned a UI button key trigger to the response button template for the button to work.
I am still new to the unity so I hope this does not confuse you.
May I know why is only the first option of the response clickable? Also why is it clickable even outside of the dialogue box?
Thank you so much for your help.
Re: Disable Continue Button for Response/Load Scene on Response
Try removing the UI Button Key Trigger.
The UI Button Key Trigger listens for the Key or Button Name to be pressed. (BTW, Button Name is the name of an input button defined in Edit > Project Settings > Input such as "Fire2". It's not the name of a UI button such as "Response Button Template".) When the input is pressed, the UI Button Key Trigger will "click" the button regardless of what UI element is actually highlighted or what UI element the mouse is over.
You have configured UI Button Key Trigger to listen for the left mouse button. This means that when you press the left mouse button, UI Button Key Trigger will click the UI button no matter where your mouse is.
The UI Button Key Trigger listens for the Key or Button Name to be pressed. (BTW, Button Name is the name of an input button defined in Edit > Project Settings > Input such as "Fire2". It's not the name of a UI button such as "Response Button Template".) When the input is pressed, the UI Button Key Trigger will "click" the button regardless of what UI element is actually highlighted or what UI element the mouse is over.
You have configured UI Button Key Trigger to listen for the left mouse button. This means that when you press the left mouse button, UI Button Key Trigger will click the UI button no matter where your mouse is.
Re: Disable Continue Button for Response/Load Scene on Response
Thank you so much for clarifying Tony!
I removed the UI key trigger element. However after removing it, the buttons stopped working entirely.
I have the button as a raycast target with button onclick event on StandardUIResponseButton.OnClick(). I also checked force module active under event system - standalone input module.
However when playing, the event system is not detecting anything from dialogue manager UI even though the canvas sort order is the highest. There isn't visible overlay of any element.
It is able to detect another canvas that's displaying a different textbox not using dialogue system.
What could be possibly causing this issue? And how can I go about checking it?
So sorry for the questions and thank you once again for your help and effort!
I removed the UI key trigger element. However after removing it, the buttons stopped working entirely.
I have the button as a raycast target with button onclick event on StandardUIResponseButton.OnClick(). I also checked force module active under event system - standalone input module.
However when playing, the event system is not detecting anything from dialogue manager UI even though the canvas sort order is the highest. There isn't visible overlay of any element.
It is able to detect another canvas that's displaying a different textbox not using dialogue system.
What could be possibly causing this issue? And how can I go about checking it?
So sorry for the questions and thank you once again for your help and effort!
Re: Disable Continue Button for Response/Load Scene on Response
Hi,
Does the dialogue UI's canvas have an enabled Graphic Raycaster? This component allows the Event System to run raycasts on the canvas to detect what the mouse is on top of.
Also make sure that nothing else in the canvas, such as a large invisible image, might be blocking the mouse.
If you don't have any luck, please feel free to send a copy of the scene to tony (at) pixelcrushers.com. I'm wrapping up work for the day, but I'll be happy to take a look tomorrow morning.
Does the dialogue UI's canvas have an enabled Graphic Raycaster? This component allows the Event System to run raycasts on the canvas to detect what the mouse is on top of.
Also make sure that nothing else in the canvas, such as a large invisible image, might be blocking the mouse.
If you don't have any luck, please feel free to send a copy of the scene to tony (at) pixelcrushers.com. I'm wrapping up work for the day, but I'll be happy to take a look tomorrow morning.
Re: Disable Continue Button for Response/Load Scene on Response
Hi,
Thanks for sending a reproduction project.
Whenever you add a Canvas component, you must also add a Graphic Raycaster to the same GameObject if its children include any interactable UI elements such as buttons. Otherwise the canvas won't allow any interaction.
Thanks for sending a reproduction project.
Whenever you add a Canvas component, you must also add a Graphic Raycaster to the same GameObject if its children include any interactable UI elements such as buttons. Otherwise the canvas won't allow any interaction.
Re: Disable Continue Button for Response/Load Scene on Response
Thank you so much Tony you are amazing!
It works perfectly now!
It works perfectly now!