Compressing RFA




From Battlefield 1942 modding wiki.

Editor.saveFolderToArchive string bool bool -> int

Saves a directory in the root game directory to an archive (rfa).

First argument is directory name to archive.

Second argument seems to deal with file paths. Works best set to 1, otherwise game may complain about not finding directory.

Third argument enables rfa compression when set to 1.

Compression rates vary depending on the type of data in the rfa file. Mostly text rfa's such as objects.rfa will compress very well (can get as small as %20 of original archive size). Texture and standardmesh will compress to around %50 of original size, while sound will barely compress at all (%90 of original size).

Compressing archives does not appear to affect loading times. (At least according to the debug loading profile. Maybe someone can do some accurate testing and update this.)

Returns 1 on success, 0 on failure.

Note: you may get an error like "Could not load archive" after archiving, this can be safely ignored.