Resource file loads late

4.3

I created a file from a resource I have, it’s called “IGN.tres”. In my game, there is a system that edits the resource variables and saves them. But there is also a label showing the saved text of that resource.
Whenever I look at it, the result is the previous text I had written, and the new text does not appear. Is this normal?

*I used “@export” and “load” to access the file and both methods gave the same result.

Well, show me what you got! Please post enough code context for a rando on the internet to mentally reproduce the issue.

2 Likes
@export var FN: Label
@export var SN: Label
@export var TN: Label
@export var GN: UI

 #"UI" is the resource and the file is "IGN" 

Func _process(_delta: float) -> void:
 FN.text = UI.first_gameplay_name
 SN.text = UI.second_gameplay_name
 TN.text = UI.third_gameplay_name

I’ve already tried replacing “@export” with "load()

var GN = load("path")

What happens is that when the player modifies the “UI” variables, the file does not update and uses the old values.

Example: if I change the value of “first_gameplay_name” in the TextEdit node to “Www”, the label appears with the name I put before. And if I close and try again, the file changes the value only when I quite the game. I don’t know if this will affect the game in the future, so I wanted to know if it’s normal.

Questions:

  1. What is GN? And why is it not used in the code?

  2. Are UI.first_gameplay_name and friends static variables defined on a UI class?

  3. What is your thought process on replacing @export with load?

  4. Can you post the entire script verbatim? Please don’t paraphrase.

  5. Can you post how you are saving the resource?

  6. Can you post how you are modifying the resource?

It would be easier to explain with a video.