I am trying to create a custom level which requires moving the song file to a final level folder. This is a VR game and read/write permissions are on. I am very confused why the code below isn’t copying.
var song_copy_error = DirAccess.copy_absolute(“res://Levels/draft/%s/song.ogg” % original_level_name, “user://Levels/complete/%s/song.ogg” % level_name)
I know user://Level/complete/%s exists and the saving the level with the line below works fine. Song_copy_error returns 12, and any attempts to open “res://Levels/draft/%s/song.ogg” with diraccess or fileaccess fail. This could be because I already loaded the file to help in making the level but I don’t know how that would affect anything.
When you export the game the original files (png, tscn, wav, ogg,…) aren’t exported directly but only the .remap (in the case of text resources that get compressed to binary: tscn, tres,…) or the .import files are (which point to the correct remapped/imported file inside the .godot folder).
DirAccess and FileAccess just read the directory/file directly and don’t take those files into account (it won’t follow the remap or import target file)
When running form the editor it’s looks fine because both files are present (the .import and the original file) But when running it in a exported project it won’t work.
This solution works for me but I did some digging into these .oggvorbisstr files and they seem to be how Godot compresses .ogg file during export.
I also found a third-party tool to convert .oggvorbisstr files back to .ogg files at Release v0.6.0 · bruvzg/gdsdecomp (github.com)
It’s a reverse-engineering toolset that has the function and I heard it worked for someone else.