Godot Version
4.5
Question
I have a singletone called move_database. It contains the following dictionary:
var moves = {
1:{"Name":"bite", "Damage":2, "Accuracy": 0.5, "Piercing": 1.5, "Effects":"bleed"},
2:{"Name":"scratch", "Damage":1, "Accuracy": 2, "Piercing": 1, "Effects":"bleed"},
3:{"Name":"sword_slash", "Damage":1, "Accuracy": 2, "Piercing": 1, "Effects":"none"},
4:{"Name":"sword_thrust", "Damage":1, "Accuracy": 1, "Piercing": 2, "Effects":"none"},
5:{"Name":"fireball", "Damage":1, "Accuracy": 3, "Piercing": 1, "Effects":"burn"},
6:{"Name":"magic_missile", "Damage":2, "Accuracy": 0.5, "Piercing": 2.5, "Effects":"none"},
}
Recently, I’ve tried changing it to the following:
var moves = {
1:{"Name":"Bite", "Damage":2, "Accuracy": 0.5, "Piercing": 1.5, "Effects":"bleed"},
2:{"Name":"Scratch", "Damage":1, "Accuracy": 2, "Piercing": 1, "Effects":"bleed"},
3:{"Name":"Sword Slash", "Damage":1, "Accuracy": 2, "Piercing": 1, "Effects":"none"},
4:{"Name":"Sword Thrust", "Damage":1, "Accuracy": 1, "Piercing": 2, "Effects":"none"},
5:{"Name":"Fireball", "Damage":1, "Accuracy": 3, "Piercing": 1, "Effects":"burn"},
6:{"Name":"Magic Missile", "Damage":2, "Accuracy": 0.5, "Piercing": 2.5, "Effects":"none"},
}
As you see, the only thing changed were names of the abilities. And for some reason, all other scripts see old values (for example if I do something like print(move_database.moves[3][“Name”]) in a different script, it will output sword_slash instead of Sword Slash). I’ve tried restarting the game, restarting the engine, searching forums for solutions, but nothing worked. Please help, this problem has been tormenting me for three days at this point.