End dialogue prematurely through the Dialogue Manager singleton #1242
Unanswered
GuacGameDev
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Good evening, I have been using Dialogue Manager for a while now and I can't seem to find a way to skip all dialogue. I'm using it in a cutscene and while I can skip the cutscene, the dialogue manager keeps bringing up speech bubbles. Has anyone found a way to do this from the included DialogueManager singleton so I don't have to grab the bubble node? Somebody in a previous QA wanted the functionality for walking away from NPCs and I couldn't find anything similar to just completely skipping with a function. I'm using v3.7.1.
`func _input(event: InputEvent) -> void:
if event.is_action_pressed("pause") and playing == true:
playing = false
skipping = true
_end_conversation(dialogue)
func start_dialogue():
# Make sure we're connected to dialogue_ended
if not DialogueManager.dialogue_ended.is_connected(Callable(self, "_end_conversation")):
DialogueManager.dialogue_ended.connect(_end_conversation)
DialogueManager.show_dialogue_balloon(dialogue,dialogue_segment,[self])
func _end_conversation(end_dialogue: DialogueResource):
#if we aren't at the end of the dialogue, don't end the cutscene
if dialogue != end_dialogue and skipping == false:
return
#check if the player has skipped dialogue
if skipping == true:
DialogueManager.dialogue_ended.emit()
#TODO: make the skip cutscene also end the dialogue
SceneTransition.play_fade_to_black()
await get_tree().create_timer(1.0).timeout
#SaveManager.load_game(SaveManager.current_slot)
SceneTransition.reverse_fade_to_black()
#restore player control
get_tree().paused = false
if MainInstances.player != null:
MainInstances.player.set_state(MainInstances.player.idle_state)
MainInstances.player.cutscene_active = false
visible = false
print("end_conversation called")`
All reactions