Choice Story Progression, without buttons

Godot Version

4.2

Question

I am trying to make a text progression where choice a leads to one path choice b leads to another. I’d like this to be a clickable element

The only way I have figured out how to implement is by showing/enabling and hiding/disabling individual buttons for events. And overlaying my graphics on top of said buttons.

This is terrible. There must be a better way. I’m brand new to Godot and I am struggling to find something that would work better for what I am imagining.

Here is a snippet of what’s currently going on because it’s terribly long I’m only including a small portion:

Button Nodes

@onready var start_button = $BUTTONS_R/Start
@onready var woods_button = $BUTTONS_R/Woods
@onready var fairy_button = $BUTTONS_R/Fairy

Rich Text Nodes

@onready var narration_text = $“…/Narration” #displays narration text
@onready var choices_r = $“…/ChoicesR” #displays right button choice text
@onready var choices_l = $“…/ChoicesL” #displays left button choice text

func _ready():

start_button.disabled = false
woods_button.disabled = true
fairy_button.disabled = true
narration_text.clear()
choices_l.clear()
choices_r.clear()
_start_story()

func _start_story():
narration_text.add_text(“Press to start”)
choices_l.add_text(“”)
choices_r.add_text(“Start”)

func _on_start_pressed():
woods_button.show()
woods_button.disabled = false
glen_button.show()
glen_button.disabled = false
narration_text.clear()
narration_text.add_text(“Game started”)
choices_l.clear()
choices_r.clear()
choices_l.add_text(“Glen”)
choices_r.add_text(“Woods”)
start_button.queue_free()

func _on_woods_pressed():
print(“Woods”)
fairy_button.show()
fairy_button.disabled = false
gnome_button.show()
gnome_button.disabled = false
narration_text.clear()
narration_text.add_text(“You enter the woods”)
choices_l.clear()
choices_r.clear()
choices_l.add_text(“Mossy Log”)
choices_r.add_text(“Clear Pool”)
woods_button.queue_free()
glen_button.queue_free()

Hi, it looks like you’re coding the choices manually, which won’t scale well. I think you should use a dialogue manager plugin like this: GitHub - nathanhoad/godot_dialogue_manager: A powerful nonlinear dialogue system for Godot or at least study the code so you know how to implement it on your own.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.