So I am new to storage systems, and when parsing a complex json file I don't know how to go to a key inside of another key in a dictionary. I looked in these pages and didn't found it, searched on the q&a and few videotutorials and I'm not able to find how to do so.
Adding the explanation would be very helpful. Thanks.
https://docs.godotengine.org/en/latest/classes/class_dictionary.html#dictionary &
https://docs.godotengine.org/en/latest/getting_started/scripting/gdscript/gdscript_basics.html#dictionary
func _ready():
var dict = {
"foo": {
"bar": {
"baz": true,
},
},
}
# Static string access (use this if you don't need dynamic access, it's easier to read and write):
print(dict.foo.bar.baz) # Prints "True"
# Dynamic access (use this if the key you're indexing with is dynamic):
print(dict["foo"]["bar"]["baz"]) # Prints "True"
You can mix and match indexing styles together.
Most helpful comment
You can mix and match indexing styles together.