Blitz3D Zip File Help

Blitz3D Forums/Blitz3D Programming/Blitz3D Zip File Help

Caton(Posted 2015) [#1]
post removed


Caton(Posted 2015) [#2]
How can I load blitz game files and use read\open file from zip file?
blitz game files like models,sounds,music,textures,images,xml,files
I want to do is when I run my blitz3d I want the files to load from zip files.
how would I do this?


Floyd(Posted 2015) [#3]
I want to do is when I run my blitz3d I want the files to load from zip files.
how would I do this?

Why would you do this? You seem determined to force Blitz3D to something it was not designed to do, i.e. load resources from a zip file.

The are two ways to proceed.

1. Use a dll that extracts files from a zip while your program is running. Save these temporarily, load them as usual (LoadImage etc.) then delete them.

That seems like a lot of work for very little ( no? ) benefit.

2. Put the files in an ordinary folder. Write your program to load resources from the folder, as Blitz3D does naturally. When development is done use an exe packer such as UPX (free) or MoleBox.


Caton(Posted 2015) [#4]
I want to protect my game assets.


Caton(Posted 2015) [#5]
I just try
===============
Include "WLD101_Lib\Blitz_Basic_Bank.bb"
Include "WLD101_Lib\Blitz_File_FileName.bb"
Include "WLD101_Lib\Blitz_File_ZipApi.bb"
zipIn = ZipApi_Open("pack.zip")
If Not Zipin Then Print "Can't Load Pack Data!"
filedata$ =ZipApi_ExtractFileAsBank(zipin,"pack\test.txt")
If FileType(filedata$)=0 Then Print "error"
ZipApi_Close(zipIn)
WaitKey
End
=======================
But It says the file doesn't exist, please help.


Floyd(Posted 2015) [#6]
No experience with ZipApi, however

filedata$ =ZipApi_ExtractFileAsBank(zipin,"pack\test.txt")
If FileType(filedata$)=0 Then Print "error"  

The name ExtractFileAsBank implies the result is a bank, not a file.


Yasha(Posted 2015) [#7]
I want to protect my game assets.


If this is really what you need to do, then so be it. But consider carefully whether this actually is something you need to do:

1) your assets are already protected by copyright

2) storing your assets in a zip file doesn't protect them in any way
2.5) storing your assets in any form on the user's machine doesn't protect them in any way, because they have total control

3) realistically, nobody is going to steal your assets (if they try to sell a game, you can crush them with copyright; if they keep everything for their own personal use, who cares?)

4) this is taking time and effort away from actually creating said assets

A lot of people have this concern. But it's very, very rarely a realistic one. No AAA game bothers with asset protection (if they use odd formats or archives, it's because they're optimized for loading by their engine).