buffer_decompress

This function returns a new buffer with the decompressed data of a buffer that stores data using zlib compression.

You supply the buffer to decompress, and the function will return a new buffer that contains the uncompressed data. If the decompression failed (for example, you supplied a buffer that wasn't compressed) then the function will instead return -1.

 

Syntax:

buffer_decompress(buffer);

ArgumentTypeDescription
bufferBufferThe index of the buffer to decompress.

 

Returns:

Buffer or -1 in case the buffer couldn't be decompressed

 

Example:

var _cmpBuff = buffer_load("Player_Save.sav");
var _srcBuff = buffer_decompress(_cmpBuff);
global.DataString = buffer_read(_srcBuff, buffer_string);

The above code first loads a saved buffer, then decompresses it and finally reads the string data from the decompressed buffer into a global variable.