GDMaim export issue with .csv file(s)

Godot Version

v4.4.1
v4.5

Question

I’m using a .csv in my project and trying to use GDMaim as well. When I export my project, the .csv file is getting lost. I even have *.csv in the Filters to export non-resource files/folders in the Export settings. When I use the “no_gdmaim” feature, the .csv is exported properly.

Is there a known workaround for this? Do I just need to modify the GDMaim add-on myself / hard-code the workaround?

How are you using the csv files in your project? Are you loading them by FileAccess?

Yes. So far I’ve been able to modify the GDMain _export_file function and this worked. But now I’m running into real-time obfuscation bugs that don’t happen when I run the program through the Editor. So I’m trying to use the command window debugger/source maps and it’s challenging.

func _export_file(path : String, type : String, features : PackedStringArray) -> void:
	if !_enabled:
		return

	var ext : String = path.get_extension()
	if ext == "csv":
		#skip() #HACK
		pass
	elif ext == "ico":
		skip() #HACK
		add_file(path, FileAccess.get_file_as_bytes(path), true) #HACK

In the code above, I commented out the Skip function which wasn’t very intuitive. But it worked.

Then there was a bug where the Node which was using the file wasn’t found. So I moved the code into the parent Node. But now the bug I’m getting is:

SCRIPT ERROR: Invalid access to property or key ‘__8mFybwPs4brfTD’ on a base object of type ‘Dictionary’.
at: __F83iLeUobP0ma (res://scenes/main.gd:1140)
GDScript backtrace (most recent call first):
[0] __F83iLeUobP0ma (res://scenes/main.gd:1140)

I’m thinking it has to do with Dictionaries like the following:
var sound_file_paths: Dictionary
var sound_entries: Array[Dictionary]

There’s some notes on GDMain about it:

I may need to refactor my code which I’m not looking forward to. I’m so close to the finish :frowning:

For anyone stumbling on this, the issue with using dictionaries with GDMaim is this:

# dictionary
var category_dict: Dictionary = {"category": "Joe"}

# node with a category property
var new_item: Node

# Doesn't work:
new_item.category = category_dict.category
new_item.category = category_dict["category"]

# Better to use:
new_item.category = category_dict.get(["category"], "")

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.