Read Commands - adambiser/agk-lzma-plugin GitHub Wiki
GetItemAsMemblock
Syntax:
GetItemAsMemblock(archiveID as integer, itemName as string) as integer
Description:
Get an item from the archive as a memblock.
Returns:
The ID of the memblock that contains the extracted data if the operation succeeds. Otherwise 0.
PluginError:
- If given an invalid archive ID.
- If an item with the given name does not exist in the archive.
- If there is an error extracting the data.
ExtractItemToFile
Syntax:
ExtractItemToFile(archiveID as integer, itemName as string, fileName as string, deleteOnExit as integer) as integer
Description:
Extracts an item from the archive to the given file name in the game's write folder. The raw file name prefix is supported.
Setting deleteOnExit to 1 tells the plugin to attempt to delete the extracted file when the game closes and the plugin is unloaded. Note that this is not when the archive is closed.
Returns:
1 if the operation succeeds. Otherwise 0.
PluginError:
- If given an invalid archive ID.
- If an item with the given name does not exist in the archive.
- If there is an error extracting the data.
- If there is an error writing the file.
GetItemAsImage
Syntax:
GetItemAsImage(archiveID as integer, itemName as string) as integer
Description:
Get an item from the archive as an image.
Returns:
The ID of the image created from the extracted data if the operation succeeds. Otherwise 0.
PluginError:
- If given an invalid archive ID.
- If an item with the given name does not exist in the archive.
- If there is an error extracting the data.
- If an image cannot be created from the memblock data.
GetItemAsImageAtlas
Syntax:
GetItemAsImageAtlas(archiveID as integer, imageItemName as string, subImagesItemName as string) as integer
Description:
Generates an image atlas from an image item and a subimages item.
NOTE: Currently both items are extracted as files into the write folder, the image is loaded from these files, and the files are deleted.
Returns:
The ID of the atlas image created from the extracted data if the operation succeeds. Otherwise 0.
PluginError:
- If given an invalid archive ID.
- If an item with either given name does not exist in the archive.
- If there is an error extracting the data.
- If an image cannot be created from the memblock data.
- If there is an error writing the temporary files.
GetItemAsMeshObject
Syntax:
GetItemAsMeshObject(archiveID as integer, itemName as string) as integer
Description:
Get an item from the archive as a mesh object.
Returns:
The ID of the mesh object created from the extracted data if the operation succeeds. Otherwise 0.
PluginError:
- If given an invalid archive ID.
- If an item with the given name does not exist in the archive.
- If there is an error extracting the data.
- If a mesh object cannot be created from the memblock data.
GetItemAsSound
Syntax:
GetItemAsSound(archiveID as integer, itemName as string) as integer
Description:
Get an item from the archive as a sound.
Returns:
The ID of the sound created from the extracted data if the operation succeeds. Otherwise 0.
PluginError:
- If given an invalid archive ID.
- If an item with the given name does not exist in the archive.
- If there is an error extracting the data.
- If a sound cannot be created from the memblock data.
GetItemAsString
Syntax:
GetItemAsString(archiveID as integer, itemName as string) as integer
Description:
Get an item from the archive as a string text.
Returns:
The ID of the string text created from the extracted data if the operation succeeds. Otherwise 0.
PluginError:
- If given an invalid archive ID.
- If an item with the given name does not exist in the archive.
- If there is an error extracting the data.
- If string text cannot be created from the memblock data.