0 votes

Ok sooooo..... i have this problem where my nodes are not found but they clearly exist, so what do i do?

My Script Right here:

extends Control
const SAVEDIR = "user://"
onready var console
label = $Control/PopUp/Label
var savepath = SAVEDIR + "save.dat"
func onSave_pressed():
var data = {
"name" : "Player",
"Speed" : 200,
"LevelProgress" : "",
"Levels" : "",
"Stars" : "",
}

var dir = Directory.new()
if !dir.dir_exists(SAVE_DIR):
    dir.make_dir_recursive(SAVE_DIR)

var file = File.new()
var error = file.open_encrypted_with_pass(save_path, File.WRITE, "wl8x2u9x49u4tfuf88efuf93r883rhzh")
if error == OK:
    file.store_var(data)
    file.close()

console_write("data saved")

func onLoadpressed():
var file = File.new()
if file.file
exists(savepath):
var error = file.open
encryptedwithpass(savepath, File.WRITE, "wl8x2u9x49u4tfuf88efuf93r883rhzh")
if error == OK:
var player
data = file.getvar()
file.close()
console
write("data loaded")
func consolewrite(value):
console
label.text += str(value) + "\n"
func onRegisterpressed():
get
tree().changescene("res://Register.tscn")
func _on
Loginpressed():
get
tree().change_scene("res://Login.tscn")

in Engine by (12 points)

How does your scene tree look?
Show where the script is attached too, this might give a better clue at where the problem is.

hmm.. okay ill check thank you

Please show us your scene tree so that we can help you identify the problem

1 Answer

0 votes

If the Control is the root node for the scene $PopUp/Label might work.

Either way, the IDE itself will help auto-complete node paths so play around in the editor and make sure you pick one of the options it gives you.

Just type onready var console_label = $ and after the "$" it should pop up with suggestions

by (134 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.