Showing "item received" during dialogue
Showing "item received" during dialogue
I'm making a pixel art 2D top down game. I would like to implement a little cutscene, but I'm not sure of the best way to do so.
The flow is as follows:
1. An NPC says "Here, take this {item_name}.
2. Player presses continue.
3. Dialogue UI hides (This is the part that worries me the most).
4. Item received animations play
- Player arms get raised like they're holding the item up
- Item fades in and moves up to the players hands
5. A separate subtitle should appear in the middle of the screen stating "You have received {item_name}!"
6. After three seconds, everything should animate out.
7. NPC Dialogue should resume on the node after the "Here, take this..." line. (This also worries me).
#3 concerns me because my UI Panel behaves in a way that completely throws me off whenever it gets disabled.
The flow is as follows:
1. An NPC says "Here, take this {item_name}.
2. Player presses continue.
3. Dialogue UI hides (This is the part that worries me the most).
4. Item received animations play
- Player arms get raised like they're holding the item up
- Item fades in and moves up to the players hands
5. A separate subtitle should appear in the middle of the screen stating "You have received {item_name}!"
6. After three seconds, everything should animate out.
7. NPC Dialogue should resume on the node after the "Here, take this..." line. (This also worries me).
#3 concerns me because my UI Panel behaves in a way that completely throws me off whenever it gets disabled.
Re: Showing "item received" during dialogue
Hi,
Try this:
To show it in an alert, tick the Dialogue Manager's Alert Settings > Allow Alerts During Conversations. You can put the alert in a node's Script field.
Try this:
Use the SetDialoguePanel(false) sequencer command to hide the dialogue UI -- or use SetEnabled() to disable the Dialogue Manager's canvas. To use SetEnabled(), give the canvas a unique name such as DialogueCanvas. Then use SetEnabled(Canvas,false,DialogueCanvas).
It's probably easiest to do this using a node's Sequence. The node's Dialogue Text can be blank.
You could show it in a different subtitle panel or using an alert. To show it in a different subtitle panel, include the markup tag [panel=#] in the Dialogue Text, and set the Sequence to something like: {{default}}; SetDialoguePanel(true)
To show it in an alert, tick the Dialogue Manager's Alert Settings > Allow Alerts During Conversations. You can put the alert in a node's Script field.
SetDialgouePanel(true) or SetEnabled(Canvas,true,DialogueCanvas) should work.
Re: Showing "item received" during dialogue
Hi Tony!
I'm running into an issue with the last step:
I'm running into an issue with the last step:
The continue button never gets enabled after the text finishes animating in when I call SetDialoguePanel(true)SetDialgouePanel(true) or SetEnabled(Canvas,true,DialogueCanvas) should work.
Re: Showing "item received" during dialogue
Hmm, try adding this sequencer command: SetContinueMode(true)@Message(Typed)
Re: Showing "item received" during dialogue
That doesn't seem to work unfortunately. I think I have a bit more context that can help us out.
This is my default sequence:
The nodes "Take this {item}" and "Here, let's test it out..." both use the default sequence
The '<Give {Item}' node has a sequence of None(), but it has an event, from a method on a singleton that I can reference, that I call that fires off the method below. ShowSignificantItemReceivedAnimationCoroutine plays a tween animation manually, and handles the dialogue panel state.
Everything works perfectly!... except the continue button doesn't show in the last node :/
This is my default sequence:
Code: Select all
SetContinueMode(false);
SetContinueMode(true)@Message(Typed);
Delay({{end}})
The nodes "Take this {item}" and "Here, let's test it out..." both use the default sequence
The '<Give {Item}' node has a sequence of None(), but it has an event, from a method on a singleton that I can reference, that I call that fires off the method below. ShowSignificantItemReceivedAnimationCoroutine plays a tween animation manually, and handles the dialogue panel state.
Code: Select all
private IEnumerator ShowSignificantItemReceivedAnimationCoroutine() {
if (DialogueManager.isConversationActive) {
DialogueManager.SetDialoguePanel(false);
}
itemReceivedGroup.SetActive(true);
tweenSequencer.StartSequence();
Time.timeScale = 0;
yield return new WaitForSecondsRealtime(C.DURATION_TO_SHOW_SIGNIFICANT_ITEM_RECEIVED);
tweenSequencer.SmoothRewind();
yield return new WaitForSecondsRealtime(tweenSequencer.GetSequenceDuration());
DialogueManager.HideAlert();
if (DialogueManager.isConversationActive) {
DialogueManager.SetDialoguePanel(true);
} else {
Time.timeScale = 1;
}
}
Re: Showing "item received" during dialogue
Hi,
You may need to set the Dialogue Manager's Debug Level to Info to get a better idea of what's going on.
Or you can change your Default Sequence to:
and configure the typewriter effect's OnCharacter() event to deactivate the continue button GameObject and OnEnd() to activate it. This way you don't need to worry about what the sequence is doing. The typewriter should always reliably show the continue button when it's done typing.
You may need to set the Dialogue Manager's Debug Level to Info to get a better idea of what's going on.
Or you can change your Default Sequence to:
Code: Select all
Delay({{end}})
Re: Showing "item received" during dialogue
Hey Tony. Cleaning up the continue button state handling in my default dialogue sequence, and delegating it to the typewriter unity events solved my issue.
Thanks for your help again!
Thanks for your help again!
Re: Showing "item received" during dialogue
Glad to help!
Re: Showing "item received" during dialogue
Just ran into one tiny problem:
My continue button now flashes for a split second after selecting a response menu item. A breakpoint is telling me that the typewriter's OnEnd event gets hit after a menu item is selected, which would cause the issue.
My continue button now flashes for a split second after selecting a response menu item. A breakpoint is telling me that the typewriter's OnEnd event gets hit after a menu item is selected, which would cause the issue.
Re: Showing "item received" during dialogue
Is your continue button part of your subtitle panel? Does the subtitle panel stay open while the response menu is shown?
The typewriter shouldn't be invoked at all if there's no text. Maybe the selected response trying to show subtitle text, but something in its Sequence is causing it to end immediately.
The typewriter shouldn't be invoked at all if there's no text. Maybe the selected response trying to show subtitle text, but something in its Sequence is causing it to end immediately.