[SOLVED] Creating a directory similar to Unity's StreamingAssets?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By lee1121

In Unity you can create a directory called StreamingAssets. When exporting it will just copy-paste this directory, without packaging/serializing it, allowing XML-files to remain readable and editable in the exported game. I wish to do the same thing in Godot, but have been unable to find an option to do so.

So my question is: is it possible to create the same functionality of Unity’s StreamingAssets in Godot?


SOLUTION: Unfortunately I haven’t found a way to do this using Godot. However I did find a way to emulate it using a batch file.

For reference, I have my bat-file located on D:\Godot_v3.1-stable_mono_win64\Projects\Wargame, my game project is in D:\Godot_v3.1-stable_mono_win64\Projects\Wargame\Wargame.

This is the content of my bat-file:

set mypath=%~dp0
set godot=D:\\Godot_v3.1-stable_mono_win64\\Godot_v3.1-stable_mono_win64.exe
set exportsDir=D:\\Godot_v3.1-stable_mono_win64\\Projects\\Wargame\\Exports
set windowsDir=%exportsDir%\\Windows
set linuxDir=%exportsDir%\\Linux

cd Wargame
%godot% --export "Windows Desktop"  %windowsDir%\\Wargame.exe
%godot% --export "Linux/X11"  %linuxDir%\\Wargame.exe

rmdir /Q /S %windowsDir%\\StreamingAssets
rmdir /Q /S %linuxDir%\\StreamingAssets

xcopy StreamingAssets %windowsDir%\\StreamingAssets /I /Y /E /H
xcopy StreamingAssets %linuxDir%\\StreamingAssets /I /Y /E /H

cd %mypath%
:bust_in_silhouette: Reply From: MmTtDeveloper

Just exclude the XML files during export in the export settings and then include the XML files in the directory of your exported project.

Also, if those files are for saving the game state, take a look at this: ConfigFile — Godot Engine (3.1) documentation in English

EDIT: In the export settings you can also choose to include .XML files even though they aren’t resources.

Thank you very much. Is there a way to automate the inclusion of the XML files in the exported project?

Also the XML files are not for saving game states, but thanks for the extra tip regardless.

lee1121 | 2019-04-20 16:30

Just tried it and the XML files are nowhere to be seen. When exporting non-resources, do they not get packaged into the exe (or pck)? I want them to remain editable by the players after exporting and the file structure of the “StreamingAssets” directory to remain as-is.

Also some screenshots in case I misunderstood something.
Godot StreamingAssets - Album on Imgur

lee1121 | 2019-04-21 12:44

Problem is, the files are packaged in the .pck file, making them inaccessible. I don’t know a good workaround.

MmTtDeveloper | 2020-01-02 00:52