Skip to content

Simple and ready to use GameMaker functions for saving/loading structs into binary-like files using buffers

License

Notifications You must be signed in to change notification settings

AntikoreDev/file-compressed

Repository files navigation

FileCompressed

Repo size Stars GitHub all releases GitHub

Simple and ready to use GameMaker functions for saving/loading structs into binary-like files using buffers. Released for public domain under the Unlicense, credit is good but not mandatory :)

How to install

Functions

This extension includes the following functions

file_compressed_save(filename, data)

Saves the struct data into the chosen filename.

file_compressed_load(filename, default = undefined)

Loads and returns the data from filename as a struct, if any errors ocurr returns default.

file_compressed_save_async(filename, data)

Asynchronously saves the struct data into the chosen filename/path, returns the event_id for the async event call or -1 if any errors where caught. Take in account for GameMaker reasons, filename will include into a default/ folder, thus it may not be used outside console exports

file_compressed_load_async(filename)

Asynchronously loads data from filename and returns an struct with the event_id and the buffer that will be populated with the data loaded. Take in account for GameMaker reasons, filename will include into a default/ folder, thus it may not be used outside console exports

file_compressed_load_parse(buffer, default = undefined)

Using a previously loaded buffer created with file_compressed_load_async, convert it and return the resulting struct or default if errors ocurr

Contributing

Feel free to open pull requests to improve the functions, however I'm not planning doing any big additions soon. Commit names should be using Gitmoji emoji standard

Donating

If you want to support me, you can just buy me a coffee

ko-fi