Please do advise me on how to signal a generic, very common, call to the UI? :O

Godot Version

v4.4.2.stable.official

Question

It has printed that the first function occured. (First image)



I highly value the simplicity of the script on the first images side, and so - ideally - any bloat would be on the latter script!!

It appears you’re wanting to emit a custom signal called “textWriter” that passes an Array containing lines of dialog as an argument when it is emitted.

To do this, you’ll need to make sure your signal declaration includes an argument for the Array and you are connected to that signal in your other script.

In the “dialogTest…” script, change the declared signal to:

signal textWriter(dialog)

From the screen grabs, I can’t tell if the “textWriter” signal is connected to the “textWriter( )” function within the “textTextie.gd” script. The signal can be connected via the IDE. Or connected within the code by adding this code within a “_ready( )” function:

// Replace node_name with the name of the node 
// the "dialogTest..." script is attached to.
// I suggest using an @onready variable to that node
func _ready() -> void:
	node_name.textWriter.connect(textWriter)

That should get your signal operating when the “interact( )” function is called.

1 Like

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