**This is an old revision of the document!**

File system extension

This extension gives you access to the file system of the pc the game is running on.

This only works on Windows, Linux and MacOS. Mobile games and web games are currently not supported.

File system versus Storage extension

pass

Asynchronous execution

pass

Conditions

File or directory exists

This condition checks if the given file or directory exists on the file system.

Parameters

Path to file or directory: The absolute path to the file or directory which shall be checked.

Actions

Create a directory

This action creates a new folder at the given file path.

Parameters

Directory: The absolute file path to the directory which should be created. It is advised to use the expressions for special folders (see below) to keep you game platform independent.

(Optional) result variable: Variable to store the result. It can either hold the value 'ok': task was successful or 'error': an error occurred.

Save a text into a file

This action saves the given text (string) into a file on the file system synchronously.

Parameters

String (text): The text that will be saved to the file.

Save path: The path on the file system where the file should be saved. It is advised to use the expressions for special folders (see below) to keep your game platform independent.

(Optional) result variable: Variable to store the result. It can either hold the value 'ok': task was successful or 'error': an error occurred.

Save a text into a file (async)

This action saves the given text (string) into a file on the file system asynchronously.

Parameters

String (text): The text that will be saved to the file.

Save path: The path on the file system where the file should be saved. It is advised to use the expressions for special folders (see below) to keep your game platform independent.

(Optional) result variable: Variable to store the result. It can either hold the value 'ok': task was successful or 'error': an error occurred. The variable will be updated in the moment, the file operation has finished.

Save a scene variable into a JSON file

This action saves the given scene variable into a file on the file system in JSON format synchronously.

Parameters

Scene variable: The scene variable to save into the file. This can be a number-, text variable or a structure with children.

Save path: The path on the file system where the file should be saved. It is advised to use the expressions for special folders (see below) to keep your game platform independent.

(Optional) result variable: Variable to store the result. It can either hold the value 'ok': task was successful or 'error': an error occurred.

Save a scene variable into a JSON file (async)

This action saves the given scene variable into a file on the file system in JSON format asynchronously.

Parameters

Scene variable: The scene variable to save into the file. This can be a number-, text variable or a structure with children.

Save path: The path on the file system where the file should be saved. It is advised to use the expressions for special folders (see below) to keep your game platform independent.

(Optional) result variable: Variable to store the result. It can either hold the value 'ok': task was successful or 'error': an error occurred. The variable will be updated in the moment, the file operation has finished.

Load a text from a JSON file

This action loads the JSON formatted text from a file and converts it into a scene variable structure. synchronously.

Parameters

Scene variable: The name of the scene variable to which the loaded structure will be added.

Load path: The path on the file system where the file should be saved. It is advised to use the expressions for special folders (see below) to keep your game platform independent.

(Optional) result variable: Variable to store the result. It can either hold the value 'ok': task was successful or 'error': an error occurred.

Load a text from a JSON file (async)

This action loads the JSON formatted text from a file and converts it into a scene variable structure. asynchronously.

Parameters

Scene variable: The name of the scene variable to which the loaded structure will be added.

Load path: The path on the file system where the file should be saved. It is advised to use the expressions for special folders (see below) to keep your game platform independent.

(Optional) result variable: Variable to store the result. It can either hold the value 'ok': task was successful or 'error': an error occurred. The variable will be updated in the moment, the file operation has finished.

Load a text from a file

This action loads the text from a file into the given scene variable. synchronously.

Parameters

Scene variable: The scene variable to store the text.

Load path: The path on the file system where the file is located. It is advised to use the expressions for special folders (see below) to keep your game platform independent.

(Optional) result variable: Variable to store the result. It can either hold the value 'ok': task was successful or 'error': an error occurred.

Load a text from a file (async)

This action loads the text from a file into the given scene variable. asynchronously.

Parameters

Scene variable: The scene variable to store the text.

Load path: The path on the file system where the file is located. It is advised to use the expressions for special folders (see below) to keep your game platform independent.

(Optional) result variable: Variable to store the result. It can either hold the value 'ok': task was successful or 'error': an error occurred. The variable will be updated in the moment, the file operation has finished.

Delete a file

This action deletes the file at the given file path synchronously.

Parameters

File path: The path on the file system where the file is located. It is advised to use the expressions for special folders (see below) to keep your game platform independent.

(Optional) result variable: Variable to store the result. It can either hold the value 'ok': task was successful or 'error': an error occurred.

Delete a file

This action deletes the file at the given file path asynchronously.

Parameters

File path: The path on the file system where the file is located. It is advised to use the expressions for special folders (see below) to keep your game platform independent.

(Optional) result variable: Variable to store the result. It can either hold the value 'ok': task was successful or 'error': an error occurred. The variable will be updated in the moment, the file operation has finished.

Expressions

These expressions return the path to special folders on the users operating system. If you use these expressions for loading and saving files it will be guaranteed to work on all supported operating systems. (Currently Windows, Linux and MacOS)

Desktop folder

This expression returns the operating system independent path to the Desktop folder of the user that runs your game.

Documents folder

This expression returns the operating system independent path to the Documents folder of the user that runs your game. This is the standard folder for storing documents.

This games executable folder

This expression returns the operating system independent path to the folder where your game is being executed from.

Pictures folder

This expression returns the operating system independent path to the Pictures folder of the user that runs your game. This is the standard folder for storing images.

Temp folder

This expression returns the operating system independent path to the Temp folder of the user that runs your game. This folder is used for temporary files that your operating system can delete any time.

Userdata folder

This expression returns the operating system independent path to the UserData folder of the user that runs your game. This folder is used for storing application settings.

Path delimiter

This expression returns the operating system independent path delimiter character. (“\” on Windows and “/” on Linux and MacOS). Use this expression to build cross platform file paths that can be accessed on all supported operating systems.

Example

In order to save a screen shot to the Pictures directory you could write:

FileSystem::PicturesPath() + FileSystem::PathDelimiter() + "my_screenshot.png"

This will work on Windows, Linux and MacOS.