Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers AppGameKit Corner / [SOLVED] Know how to use LZMA Plugin?

Author
Message
ando
4
Years of Service
User Offline
Joined: 21st Feb 2020
Location: Australia
Posted: 12th Nov 2021 22:23 Edited at: 12th Nov 2021 22:44
Does anyone know how to use the LZMA Plugin for loading an animated 3D model directly from a password protected zip or 7z?

I'm still trying but I am having trouble understanding it, plus the GetItemAsMeshObject and SetItemFromObjectMesh parts are not demonstrated.

I think I have the plugin in the right place. And I think the plugin has to first save a loaded model using memblocks in order for the plugin to be able to load it directly to memory without having to extract the model to a file so should be better protected.

I guess I better study memblocks.
BASIC appeared in May 1964. Lightning flashed, the wind roared and the Earth moved.
And nine months later I was born.
So here I am.
I am Basic.
Code is in my genes.

The author of this post has marked a post as an answer.

Go to answer

PartTimeCoder
AGK Tool Maker
9
Years of Service
User Offline
Joined: 9th Mar 2015
Location: London UK
Posted: 12th Nov 2021 22:52 Edited at: 12th Nov 2021 23:02
This post has been marked by the post author as the answer.
It looks fairly self expletory to me, make a small app to pack your resources and then use the resulting file in your game, no need to study memblocks (altho it cant hurt)

I would have thought, just replace the function names, tag name and file path to suit your project, all the functions look the same the source code is there if in doubt

Untested!


Edit:

Yup, just look at the function headers

extern "C" DLL_EXPORT int GetItemAsMeshObject(int archiveID, char *itemName)
extern "C" DLL_EXPORT int SetItemFromObjectMesh(int archiveID, char *itemName, const unsigned int objectID, const unsigned int meshIndex)

this would be
archive.SetItemFromObjectMesh (archiveID, "object.mesh", myObjectID, MeshIndex)
Open Source plugins
Cl - DnD Plugin
Buy Me A Coffee
ando
4
Years of Service
User Offline
Joined: 21st Feb 2020
Location: Australia
Posted: 13th Nov 2021 00:44
Thanks for your help PartTimeCoder.
The model on the right is the copy using memblocks. I could not see the saved archive anywhere but
that doesn't matter because it looks like the memblocks method does not retain the anim stuff.

So it should be fine for static models.
I'll have to look for another way to (reasonably) protect animated models.

Thanks again, cheers.
BASIC appeared in May 1964. Lightning flashed, the wind roared and the Earth moved.
And nine months later I was born.
So here I am.
I am Basic.
Code is in my genes.
PartTimeCoder
AGK Tool Maker
9
Years of Service
User Offline
Joined: 9th Mar 2015
Location: London UK
Posted: 13th Nov 2021 01:34
Ah, cant help with that one, I don't do much stuff with memblocks in AppGameKit, try nz0's WadPacker
Open Source plugins
Cl - DnD Plugin
Buy Me A Coffee
adambiser
AGK Developer
8
Years of Service
User Offline
Joined: 16th Sep 2015
Location: US
Posted: 20th Nov 2021 03:05
@ando:
You can use ExtractItemToFile to a temp folder with deleteOnExit set to 1 so that the temp file is deleted when the app is closed (not when the archive itself is closed!). Then you can load the temp files using AGK's file-based commands.

This is there for all the file types that AppGameKit can't load from memblocks.

I think WadPacker and anything else out there will have a similar limitation.

Login to post a reply

Server time is: 2024-04-23 22:36:14
Your offset time is: 2024-04-23 22:36:14