How to disable/show another dialog after once showing it?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By RAYVENN

Hi, I am making a game called School Adventures.
I am trying to implement dialogs as a type of “quests”. For dialogs I am using addon called Dialogic. Simply I go to the teacher, using “ui_accept” I call the dialog and the dialog shows up.(He asks me a questions about math, english etc. and I have multiple answers to choose) But if I come to the teacher again, the same dialog shows up and I want the dialog to work like this :

If I choose the wrong answer, text like ( try it again) will show up until I choose the right answer.

If I choose the correct answer, the dialog will close and after that if I come to the teacher next time, a new dialog with new questions will show up.

I was trying to figure it out but I just don’t know how to do it. I would be really pleased if someone could help me with it beacuse I am down in the dumps. The best way to show me how to do it would be call on a discord if it is possible.

extends Area2D 

var active = false

func _ready():
     connect("body_entered", self, '_on_Ucitel_body_entered')
     connect("body_exited", self, '_on_Ucitel_body_exited')

func _process(delta):
     $QuestionMark.visible = active

func _input(event):
     if get_node_or_null("DialogNode") == null:
          if event.is_action_pressed("ui_accept") and active:
               get_tree().paused = true
               var dialog = Dialogic.start('chat_with_teacher')
               dialog.pause_mode = Node.PAUSE_MODE_PROCESS
               dialog.connect('timeline_end', self, 'unpause')
func unpause(timeline_name):
     get_tree().paused = false

func _on_Ucitel_body_entered(body):
     if == 'Player':
     active = true

func _on_Ucitel_body_exited(body):
     if == 'Player':
enter code here
     if == 'Player':
     active = false

_on_Ucitel_body_entered = Ucitel means teacher in my language

:bust_in_silhouette: Reply From: exuin

You need to use dialogic signals to set a variable that says whether you got the question right or not, and check it when starting the dialogue.

Could you please help me with it through discord? I am trying everything I can but I am just a beginner and after few hours of trying different things I still don’t know how to do it :stuck_out_tongue:

RAYVENN | 2023-02-12 16:30