![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | rogerdv |
I have the following code to load some resources in my game (which are items, and abilities):
func load_items(path:String):
var dir = DirAccess.open(path)
if dir:
dir.list_dir_begin()
var file_name = dir.get_next()
while file_name != "":
if dir.current_is_dir():
load_items(path+file_name+"/")
else:
var item=load(path+file_name)
if item==null:
# Load failed
print("FILE ERROR: cant load item resource ",path+file_name)
else:
items[item.id]=item
file_name = dir.get_next()
It worked fine while running the project in editor, but when I build and run the game I get this errors:
FILE ERROR: cant load item resource res://game_data/items/weapons/swords/hq_broadsword.tres.remap
ERROR: No loader found for resource: res://game_data/items/weapons/swords/rapier.tres.remap.
at: _load (core/io/resource_loader.cpp:230)
FILE ERROR: cant load item resource res://game_data/items/weapons/swords/rapier.tres.remap
ERROR: No loader found for resource: res://game_data/items/weapons/swords/white_sw.tres.remap.
at: _load (core/io/resource_loader.cpp:230)
FILE ERROR: cant load item resource res://game_data/items/weapons/swords/white_sw.tres.remap
ERROR: No loader found for resource: res://game_data/items/weapons/fist.tres.remap.
Any idea about whats happening here?