Attention | Topic was automatically imported from the old Question2Answer platform. | |
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')
add_child(dialog)
func unpause(timeline_name):
get_tree().paused = false
func _on_Ucitel_body_entered(body):
if body.name == 'Player':
active = true
func _on_Ucitel_body_exited(body):
if body.name == 'Player':
enter code here
if body.name == 'Player':
active = false
_on_Ucitel_body_entered = Ucitel means teacher in my language