Invalid get index on base Dictionary

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By nosrick
:warning: Old Version Published before Godot 3 was released.

So I’m loading some files into a dictionary, and in the editor, it works fine.
However, when exported, I get the above error, when trying to assign the index “BasicAttack”.

Here’s the code for the assignment:

var name = file.substr(0, file.length() - 3)
var attack = load("res://Code/Attacks/" + file)
var attackJson = {}
attackJson.parse_json(jsonData[name])
attacks[name] = attack.new(attackJson.attack.name, attackJson.attack.internalName, attackJson.attack.pushback)

Why would this be?
(I’m using 2.1 alpha, at the moment.)

can you provide a sample project for it?

volzhs | 2016-06-23 13:35

My entire project is here:
Bitbucket
(and the offending call is in AttackHandler.gd)

But if you want me to try and make a minimal example, I’ll do that, too.

nosrick | 2016-06-23 16:01

:bust_in_silhouette: Reply From: volzhs

Export > Resources > Export Mode

changing Export all resources in the project to Export all files in the project directory will fix your problem.

EDIT: It suddenly works after tinkering with some settings and then changing them back.

nosrick | 2016-06-23 18:25