|The full path and filename of the archive to create
|The full path and filename of a file to add to the archive, or array of file paths
|Optional: Additional files to add to the archive (arrays not accepted)
Adds one or more files to an archive previously created with
xzip_create. Also returns
false to indicate if the operation succeeded or failed. Note that this includes failure to overwrite an existing file flagged as read-only. (This can be determined with
If multiple files are input, even a single error will return
false even though other files succeeded. In this scenario, use
xzip_report to retrieve a list of failed files.
Input files should be written as a string containing the full path of the file to add, including drive letter. If a path points to a folder, the contents of the folder will be added, preserving the relative path of files and subfolders inside.
At present, Xzip requires all files to have an extension. Also, although folders are supported, no two files can have the exact same file name even if they are separated by different folders!
Due to GameMaker's string handling, slashes in paths should be escaped (i.e.
\). Do not add a final slash to directories!
Instead of listing individual files in the
xzip_add command, an array of file paths can be passed into the
file1 argument instead. Only the first file argument will accept an array as input, and once detected, no further file arguments will be processed. You cannot combine array and string inputs in a single command.
Be warned that adding files takes time, and archiving many files at once can cause the game to temporarily appear frozen.