This site is currently in read-only mode during migration to a new platform.
You cannot post questions, answers or comments, as they would be lost during the migration otherwise.
0 votes

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.)

in Engine by (38 points)

can you provide a sample project for it?

My entire project is here:
https://bitbucket.org/nosrick/monquest
(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.

1 Answer

+1 vote
Best answer

Export > Resources > Export Mode

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

by (9,800 points)
selected by

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

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.