Thanks for your answer.
What resource type is it? Are they all .tscn files?
Yes, they are all *.tscn in this case
I have almost identical issue with sound files.
by the docs:
get_files()
Returns a PackedStringArray containing filenames of the directory contents
DirAccess can’t be instantiated directly. Instead it is created with a static method that takes a path for which it will be opened.
Doesn’t it just means you can’t call on
var dir_access = DirAccess()
dir_access.some_instance_method(some, args)
and have to call
var result = DirAccess.some_static_method(some, args)
instead?
DirAccess.get_files_at(LEVELS_PATH)
returns same array of strings as
DirAccess.open(LEVELS_PATH).get_files()
.
.
But! I found strange thing! Hooray!
list of files looks like this
["level_00.tscn.remap", "level_10.tscn.remap", "level_20.tscn.remap", "level_90.tscn.remap"]
Every file have a *.remap suffix
so I’m just trimming them
return load(LEVELS_PATH + level_names[current_level_index].trim_suffix('.remap'))
Almost the same issue with sound files, they have ‘.import’ suffix, triming fixes it for web, but now i have 2 instances of every sound while debugging not in browser. So it either relatively complex and not very elegant code, either search for better solution.
There is a long thread about same issue and discussion about solutions options on git hub
opened 11:35PM - 17 Sep 22 UTC
closed 03:31PM - 22 Feb 23 UTC
archived
discussion
topic:core
confirmed
topic:export
### Godot version
4.0 Beta 1
### System information
Mac OS
### Issue descrip… tion
When exporting my game in Godot 4, every `.tres` file is exported as `.tres.remap` This means that I can't call `load(resource)` because Godot throws:
`ERROR: No loader found for resource: res://Resources/Items/Seeds/AutumnWingsGourdSeeds.tres.remap.`
I think this started around Godot 4 - Alpha 16
I'm not sure what the cause is, and there is very little information available online about `.tres.remap` files.
### Steps to reproduce
Here's the sample code I'm using to encounter this:
```gdscript
func _ready():
# Animals
load_resource('res://Resources/Animals', Directory.new(), animals, animal_dict)
func load_resource(path: String, dir = Directory.new(), array = null, dict = {}):
dir.open(path)
dir.list_dir_begin()
var file_name = dir.get_next()
while(file_name != ""):
if dir.current_is_dir():
var newDir = Directory.new()
load_resource("{0}/{1}".format([path, file_name]), newDir, array, dict)
elif dir.file_exists("{0}/{1}".format([path, file_name])) and '.tres' in file_name and not '.tres.remap' in file_name:
var r = load("{0}/{1}".format([path, file_name]))
if array != null:
array.append(r)
if dict != null:
dict[r.id] = r
file_name = dir.get_next()
```
The goal is to load all the animals at run time and store them in an array & dict in memory for later use. This worked in Godot 3 and much of the 4 Alphas, but has stopped working for me recently.
### Minimal reproduction project
_No response_