0 votes

Hey there! I have a scene that i want to instance a lot that has 2 exported dictionaries. Unfortunately, the godot UI doesn't seem to support dictionary editing. If i add keys to the dictionary i can edit the values but i am unable to add or delete keys, which doesn't make sense since dictionaries are dynamic. Any better way to edit the dictionary across instances? Thanks in advance. Here are some pictures to illustrate what i mean:

https://imgur.com/a/4af6x21
https://imgur.com/a/84R8o1s

in Engine by (243 points)

1 Answer

+2 votes

Which Godot are you using? I'm using Godot 3.1 Beta3 and it looks like this:

Code for the example

extends Node

export(Dictionary) var dic = {}

func _ready():
    for key in dic.keys():
        print(key + " value is: " + str(dic[key]))

Node Inspector

enter image description here

Output
enter image description here

by (521 points)

I'm using the steam version which does not have version 3.1 since it is still in beta, and unfortunately they have not used the betas steam feature to allow people to use it. Specifically, i am using godot 3.0.6.

You will have to wait for the official 3.1 release that has no official date or download from the engine website the last build of the 3.1 version. It’s very stable, I’m using it for a few weeks (since Beta1) and did not have any problems related to the engine.
If you download the 3.1 version, remember to make a backup of your project before opening it with tue 3.1 engine because if you do so, you won’t be able to open the same project on lower versions.
If this answer helped you, please select it as best answer to set this problem as solved. If you have more doubts, please ask!

I didn't want to use godot 3.1 until it was released because i'm working on a game that we plan to release and i didn't want to use an unstable build for that. I'll try godot 3.1 though and if it works well for me i'll put this as best answer.

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 [email protected] with your username.