Jump to content


Photo

Gmz: Zip Archiver


  • Please log in to reply
75 replies to this topic

#1 Adventus

Adventus

    GMC Member

  • New Member
  • 516 posts

Posted 09 September 2007 - 02:41 AM

GMZ: Zip Archiver
By Adventus


Had this lying around on my comp for a while. Yeah hobbels Archiver is probably better, but someone might have a use. I havent done much testing, so remember to post any bugs etc. Also note, that you cannot add and extract from the same zip index.

Main Download: 64Digits: GMZ_v1.zip
Mirror:
Posted Image

Features:
  • Small: Less than 50Kb. No point in carrying around the other junk when you just need .zip support.
  • Non-Threaded For a Reason: So there isnt a delay between extracting the resource and being able to load it into GM and delete. Otherwise the user can see the resources being extracted and copy them before GM gets a chance to delete them. Yes I know theres such a thing as suspending threads....
  • Supports Compression: Could be useful for some GM apps who want to create .zips.
  • Supports Password protected zips: For those of us paranoid about resource extraction.
Cheers,

Edited by Adventus, 26 September 2007 - 08:37 AM.

  • 0

#2 necrotic

necrotic

    GMC Member

  • New Member
  • 238 posts

Posted 09 September 2007 - 05:12 PM

Finally!

If this works, It will be the first working zip dll!

Nothing else has been able to work for me >.>
  • 0

#3 the_doominator

the_doominator

    Eight Star

  • New Member
  • 925 posts

Posted 09 September 2007 - 10:10 PM

Nice!
  • 0

#4 gmjab

gmjab

    GMC Member

  • New Member
  • 784 posts

Posted 13 September 2007 - 12:07 AM

Very good work. Game Maker was in need of a simple and small zip DLL.
  • 0

#5 antidote

antidote

    GMC Member

  • New Member
  • 117 posts

Posted 13 September 2007 - 05:26 PM

One question: Can you extract from subdirs in a Zip file with this? if not it's kinda useless for me <.<

EDIT:
Yes it does =D

Pak like archives FTW =3

Edited by antidote, 13 September 2007 - 05:31 PM.

  • 0

#6 freko

freko

    The Professional

  • GMC Member
  • 504 posts
  • Version:GM8

Posted 15 September 2007 - 04:51 PM

Can it load stuff directly into GM from the archive without extracting it ?
This could take some time, but it would not give users a single chance to copy your resources.

Anyway its Nice, I like it.Good job with the password thing.
  • 0

#7 Revel

Revel

    ɹǝqɯǝɯ ɔɯƃ

  • GMC Member
  • 4935 posts
  • Version:GM8

Posted 23 September 2007 - 07:12 PM

I would say i love you, but im not gay.


Anyway. I love this. I will need it!
  • 0

#8 SLarouche

SLarouche

    GMC Member

  • GMC Member
  • 95 posts
  • Version:GM:Studio

Posted 24 September 2007 - 11:10 AM

www.64digits.com site seem dead :GM7:

Smon
  • 0

#9 Adventus

Adventus

    GMC Member

  • New Member
  • 516 posts

Posted 24 September 2007 - 10:41 PM

www.64digits.com site seem dead

Hmm sorry about that, 64Digits is having some serious downtime. I'll get a mirror up as soon as possible.

Can it load stuff directly into GM from the archive without extracting it ?

No, and without some serious hacking or Yoyogames have a change of faith GM will never support this type of functionality.

Can you extract from subdirs in a Zip file with this?

Yes. T'would be pretty pointless if you could create zips with subdirs and couldn't extract from them. XD.

Anyway, thanks all for your support.
  • 0

#10 zedman1000

zedman1000

    GMC Member

  • New Member
  • 715 posts

Posted 04 October 2007 - 10:14 AM

GMZ_Init();

global.resourcefile=GMZ_ZipOpen('resources.zip',"cool");
GMZ_ExtractName(global.resourcefile,"yay.jpg");

Thats the code i have and its not working, please help. Im sure there is a simple explanation. Thanks for making this dll too btw.

Im using gm6.

Edited by zedman1000, 04 October 2007 - 10:15 AM.

  • 0

#11 Adventus

Adventus

    GMC Member

  • New Member
  • 516 posts

Posted 05 October 2007 - 05:52 AM

Thats the code i have and its not working, please help. Im sure there is a simple explanation. Thanks for making this dll too btw.

Possibly the file doesnt exist at the specified location? Check it by testing if "global.resourcefile" >= 0. What errors, if any, are thrown?
  • 0

#12 zedman1000

zedman1000

    GMC Member

  • New Member
  • 715 posts

Posted 05 October 2007 - 07:22 AM

Sorry it will be awhile before i can check.
  • 0

#13 zedman1000

zedman1000

    GMC Member

  • New Member
  • 715 posts

Posted 07 October 2007 - 10:51 PM

Okay i got around to it. It gave me the error:
Unexpected End of Code Reached.

Could you maybe create an example in gm6, of just the most necessary code with a zip in it to test?
  • 0

#14 austin

austin

    GMC Member

  • New Member
  • 24 posts

Posted 10 October 2007 - 09:17 PM

Could you maybe create an example in gm6, of just the most necessary code with a zip in it to test?

Seriously. I need an example. ( ;) )
  • 0

#15 Rixeno

Rixeno

    The One 'n' Only

  • New Member
  • 513 posts

Posted 11 October 2007 - 08:36 PM

Goody! Goody! I L-O-V-E this DLL :GM023: , I tried others but couldn't really understand, I check the functions for this and it's as easy as BBQ :GM046: ... Can't wait to add it my program ;) ...

Thank you alot :GM044:
  • 0
Do you need an example? You can PM me a request and I'll try my best.
Creations:
- Extra String Functions - Sprite Chroma Key - String at Position - Word Censor - Draw_Line_Width (Unreg GM6-) - Shadowed Text - Draw N-Gon - PIXEL PERFECT COLLISION ENGINE-

#16 Obiki_San

Obiki_San

    GMC Member

  • New Member
  • 136 posts

Posted 12 October 2007 - 05:45 AM

I haven't tested this yet, but if all goes well I'll use this in replacing DTdragon's zip I've been using for a LOOONG time.

Thanks for the Dll. Ciao.

EDIT: Oh this saddens me. You can't set the location in which the files are extracted to. Perhaps you would consider this if there's going to be an update.

Edited by Obiki_San, 12 October 2007 - 07:14 AM.

  • 0

#17 Adventus

Adventus

    GMC Member

  • New Member
  • 516 posts

Posted 12 October 2007 - 08:38 AM

Just so u know, me and some other dude asked for an example for your zip dll. We could really use your help.  ;)

Sigh.... I was kind of hoping you guys were capable of converting .gm5's to .gm6.... considering that you can load a .gm5 into Gamemaker 6.1 (go file->open then change the filter to old gamemaker files).... there might be a few functions which have different arguments but its nigh on identical.

EDIT: Oh this saddens me. You can't set the location in which the files are extracted to. Perhaps you would consider this if there's going to be an update.

Yep, or you could just use the delete and copy functions provided by GM. I may consider adding support for setting the destination file.... but i wont be updating real soon, im really swamped at the moment.
  • 0

#18 Obiki_San

Obiki_San

    GMC Member

  • New Member
  • 136 posts

Posted 12 October 2007 - 10:09 PM

Yeah, I thought about the copy and delete method but wanted to avoid extra steps and possible speed lost.

Most of my projects uses a different zip dll that I set to extract to the games temp directory. So I've come up with a solution: If I "Include" the GMZ.dll into game maker and have it export to it's temporary folder all files extracted from my zip files will join the .dll (as you've stated in the comments). So no problemo :angry:... I'll just have to test it.

No rush with the DLL though.

BTW: Your other projects are great to. I'd use them once I find a good reason for them.
  • 0

#19 austin

austin

    GMC Member

  • New Member
  • 24 posts

Posted 05 November 2007 - 01:45 AM

Yeah, I thought about the copy and delete method but wanted to avoid extra steps and possible speed lost. 

Most of my projects uses a different zip dll that I set to extract to the games temp directory.  So I've come up with a solution:  If I "Include" the GMZ.dll into game maker and have it export to it's temporary folder all files extracted from my zip files will join the .dll (as you've stated in the comments).  So no problemo :)... I'll just have to test it.

No rush with the DLL though.

BTW: Your other projects are great to.  I'd use them once I find a good reason for them.

<{POST_SNAPBACK}>


I tried this, but For some odd reason, even though the dll was in the temp directory it still extracted to the working directory of the game. And yes, I set the game setings so it would include the dll into the temporary directory and not the working directory.
  • 0

#20 WadeMcGillis

WadeMcGillis

    wademcgillis.com

  • GMC Member
  • 971 posts

Posted 07 November 2007 - 01:06 AM

I have the same problem as austin. I tried this as a possible fix (didn't work, it still comes out in the working directory [a big problem if you try to run the game out of a zip])
var sprite_file;
gmz_init();
sprite_file = gmz_open(temp_directory+"\resources.dat","");
gmz_extractall(sprite_file);
I know... I renamed the scripts, and I know that I changed the extension from .zip to .dat

Oh yeah, resources.dat extracts to temp_directory when the game starts up, and so does gmz.dll
  • 0

#21 Adventus

Adventus

    GMC Member

  • New Member
  • 516 posts

Posted 09 November 2007 - 05:38 AM

Try manually moving the dll to another location, and extracting something. Your problems might be due to running your games from within the GM editor, apparantly the "temp_directory" can be a bit inconsistent.

Have you updated the location of the dll in GMZ_init()? You could still have gmz.dll in your working directory and be calling it accidently.
  • 0

#22 austin

austin

    GMC Member

  • New Member
  • 24 posts

Posted 13 November 2007 - 02:18 AM

Just so u know, me and some other dude asked for an example for your zip dll. We could really use your help.  :)

Sigh.... I was kind of hoping you guys were capable of converting .gm5's to .gm6.... considering that you can load a .gm5 into Gamemaker 6.1 (go file->open then change the filter to old gamemaker files).... there might be a few functions which have different arguments but its nigh on identical.

Sorry about that, I didn't start using Gamemaker until Version 6 and I did not know that you could do that. :)


Try manually moving the dll to another location, and extracting something. Your problems might be due to running your games from within the GM editor, apparantly the "temp_directory" can be a bit inconsistent.

Have you updated the location of the dll in GMZ_init()? You could still have gmz.dll in your working directory and be calling it accidently.

<{POST_SNAPBACK}>

I tried that and it still didn't work. :)
  • 0

#23 nano351

nano351

    GMC Member

  • New Member
  • 330 posts

Posted 25 November 2007 - 02:04 AM

This dll is great :) the only problem is it keeps extracting to the working directory when i have the dll in the temp directory... Maybe could you make it so we can specify a folder location. That'd be great ;)
  • 0

#24 austin

austin

    GMC Member

  • New Member
  • 24 posts

Posted 25 November 2007 - 10:43 PM

This dll is great :) the only problem is it keeps extracting to the working directory when i have the dll in the temp directory... Maybe could you make it so we can specify a folder location. That'd be great ;)

<{POST_SNAPBACK}>

That is exactly my point.
  • 0

#25 Adventus

Adventus

    GMC Member

  • New Member
  • 516 posts

Posted 26 November 2007 - 06:26 AM

This is really a non issue to me. You can use the provided GM copy & delete functions to achieve the exact same result. They're not slow, infact they're probably just a call to the same windows function (CopyFile) i would be calling anyway.

Ie, GMZ_ExtractName modified:
//argument0: zip index
//argument1: extract file with name.
//argument2: output file name

return external_call(global.GMZ_fileextractname,argument0,argument1);
file_copy(filename_dir(global.GMZ_dll) + "\" + argument1, argument2);
file_delete(filename_dir(global.GMZ_dll) + "\" + argument1);

Edited by Adventus, 27 November 2007 - 02:35 AM.

  • 0

#26 coolist

coolist

    The Coolist

  • New Member
  • 913 posts

Posted 28 November 2007 - 01:20 AM

Cool, but I don't think I got use for it :)
  • 0

#27 nano351

nano351

    GMC Member

  • New Member
  • 330 posts

Posted 28 November 2007 - 08:09 PM

This is really a non issue to me. You can use the provided GM copy & delete functions to achieve the exact same result. They're not slow, infact they're probably just a call to the same windows function (CopyFile) i would  be calling anyway.

Ie, GMZ_ExtractName modified:

//argument0: zip index
//argument1: extract file with name.
//argument2: output file name

return external_call(global.GMZ_fileextractname,argument0,argument1);
file_copy(filename_dir(global.GMZ_dll) + "\" + argument1, argument2);
file_delete(filename_dir(global.GMZ_dll) + "\" + argument1);

<{POST_SNAPBACK}>

forgot all about GM's file manipulation functions :). The only problem is I want to use the GMZ_ExtractAll and you can't find which files are the extracted ones as far as I know.

EDIT:
ok here's a new script I came up with. This one is to extract all files to a destination directory.
//argument0: the zip index
//argument1: the directory to extract to. Disclude the final backslash I.E. "C:\Program Files\My Awesome Game"
//returns nothing
var zip file name directory total i;
zip=argument0;
directory=argument1;
total=GMZ_GetCount(zip)-1
for (i=0; i<=total; i+=1){
    GMZ_ExtractPos(zip,i);
    name=GMZ_GetName(zip,i)
    file_copy(working_directory + "\" + name, directory + "\" + name);   
    file_delete(working_directory + "\" + name);
}

Edited by nano351, 28 November 2007 - 08:29 PM.

  • 0

#28 acrog2

acrog2

    average user

  • GMC Member
  • 1118 posts

Posted 05 December 2007 - 11:32 PM

I need some help with the GMZ_FileAdd function. I put in this code:
GMZ_FileAdd(global.zip,'Artho.ini','artho.ini')
it doesn't do anything. please help!
  • 0

#29 Adventus

Adventus

    GMC Member

  • New Member
  • 516 posts

Posted 06 December 2007 - 09:09 AM

I need some help with the GMZ_FileAdd function. I put in this code:
GMZ_FileAdd(global.zip,'Artho.ini','artho.ini')
it doesn't do anything. please help!

This is probably because your using GMZ_ZipOpen() to get a Zip Id. Unfortunately, the compression functions are only supported by the GMZ_ZipCreate() Zip ids.

I left this restraint in from when i initially made the DLL for a special purpose.
  • 0

#30 acrog2

acrog2

    average user

  • GMC Member
  • 1118 posts

Posted 07 December 2007 - 03:12 AM

That still didn't work, I get a 'error running game' message, and when I error check it in 7zip, it says that it is corrupted. any help?
  • 0

#31 Adventus

Adventus

    GMC Member

  • New Member
  • 516 posts

Posted 07 December 2007 - 05:20 AM

That still didn't work, I get a 'error running game' message, and when I error check it in 7zip, it says that it is corrupted. any help?

This error could be caused by many things. Without seeing any code its unlikely ill be abe to help.
  • 0

#32 IceMetalPunk

IceMetalPunk

    InfiniteIMPerfection

  • GMC Elder
  • 9603 posts
  • Version:GM:Studio

Posted 21 December 2007 - 06:58 AM

I see this is a bit old, but when I try to use the GMZ_AddFile function, nothing happens. It returns 1, but even after the ZIP is closed, as is my game, the ZIP file remains empty.

Any ideas?

-IMP :( :lol:
  • 0

:GM123: Are you an artist who likes creating original creature designs? Maybe you can help out with Elementa here! Give it a look; you might like the idea :)

:bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny:


#33 Mini

Mini

    GMC Member

  • New Member
  • 196 posts

Posted 28 January 2008 - 10:33 PM

Does using this require you to give credit? and if so, who too?
  • 0

#34 kake_fisk

kake_fisk

    GMC Member

  • GMC Member
  • 2392 posts
  • Version:GM7

Posted 21 April 2008 - 09:33 PM

The download will not start ;)

Edit:
Lol, didn't see the mirror :P

Edited by kake_fisk, 21 April 2008 - 09:34 PM.

  • 0

#35 ash47

ash47

    O_o

  • GMC Member
  • 1347 posts

Posted 22 April 2008 - 10:20 AM

it works!

;)

edit: i can now continue designing my extensions thingy. My maps can now be WAY more powerful!

:P:):GM072::):GM125:

edit: soz, i was wrong...

Edited by elite69, 25 April 2008 - 01:48 AM.

  • 0
Posted Image

Rate this topic: 0 | 1 | 2 | 3 | 4 | 5

PRESS IT
\/


#36 Adventus

Adventus

    GMC Member

  • New Member
  • 516 posts

Posted 25 April 2008 - 01:24 AM

Better late than never!

Does using this require you to give credit? and if so, who too?

I dont really mind, if you do feel like giving credit a simple "GMZ - Adventus" would be fine.

YOU CANT EXTRACT IF THE ZIP HAS A PASSWORD, FIX THIS OR THIS DLL IS ALMOST POINTLESS!

Worked for me. I used 7-zip to create a "ZipCrypto" password protected zip (it doesn't work with AES-256 encrypted zips). You must specify the password in the GMZ_ZipOpen(file, password). If you don't.... it will spit out the file but it will be 0 bytes.

NB: The louder you talk the less likely I am to help you.
  • 0

#37 ash47

ash47

    O_o

  • GMC Member
  • 1347 posts

Posted 25 April 2008 - 01:47 AM

ow, i thought that was for extracting, lol silly me
  • 0
Posted Image

Rate this topic: 0 | 1 | 2 | 3 | 4 | 5

PRESS IT
\/


#38 microbot

microbot

    Rating: Mostly Harmless

  • New Member
  • 151 posts

Posted 25 April 2008 - 02:12 AM

Very nice work, well done

will you be releasing the dll source code ?
  • 0

#39 ash47

ash47

    O_o

  • GMC Member
  • 1347 posts

Posted 25 April 2008 - 03:59 AM

i thought u could decompile dlls? someone told me u could, i dont know how or even if it's posible, just saying, also, i love your dll.

edit: i started using your dll and a problem came up, http://gmc.yoyogames...howtopic=372204 - as i call it, the unreadable gamemaker format. Can u tell me if i did something wrong? otherwise i invented the unreadable gamemaker format!!!

Edited by elite69, 25 April 2008 - 07:31 AM.

  • 0
Posted Image

Rate this topic: 0 | 1 | 2 | 3 | 4 | 5

PRESS IT
\/


#40 martin1990

martin1990

    GMC Member

  • New Member
  • 40 posts

Posted 26 May 2008 - 06:34 PM

can someone make me a guide on how to use it?
i see loads of code
and dont have a clue what to do to make this thing fit into my game
  • 0

#41 sugaraddict

sugaraddict

    GMC Member

  • New Member
  • 37 posts

Posted 03 June 2008 - 02:07 AM

This is GMD... I can't open it...
  • 0

#42 Adventus

Adventus

    GMC Member

  • New Member
  • 516 posts

Posted 04 June 2008 - 09:21 AM

will you be releasing the dll source code ?

My computer imploded (lightning strike). I no longer have the source code, hence my uselessness at answering questions (also partly due to the fact i haven't used GM for ~1 years).

i thought u could decompile dlls?

You sure can.... into X86 ASM. [/sarcasm] (NB: not really a decompile, more a direct translation). No you cannot "decompile" DLLs, even if you could it would spit out meaningless code anyway (no variables names, etc).

This is GMD... I can't open it...

Man how many times am i going to get this one.... i need to think up wittier comebacks. Go open, then change the drop down box to "old gamemaker files" (or something like that), It should show up. You'll have to change some draw_rectangle code before it will run.
  • 0

#43 kake_fisk

kake_fisk

    GMC Member

  • GMC Member
  • 2392 posts
  • Version:GM7

Posted 05 June 2008 - 07:09 PM

aww, i just get errors...

___________________________________________
FATAL ERROR in
action number 1
of Create Event
for object end:

COMPILATION ERROR in code action
Error in code at line 1:
zip = GMZ_ZipCreate(working_directory+string("/resources.zip),"reez");

at position 64: Symbol , or ) expected.


zip = GMZ_ZipCreate(working_directory+string("\resources.zip),"reez");
GMZ_FolderAdd(zip,working_directory+string("\resources"));
GMZ_ZipClose(zip);

  • 0

#44 WadeMcGillis

WadeMcGillis

    wademcgillis.com

  • GMC Member
  • 971 posts

Posted 18 June 2008 - 06:54 PM

zip = GMZ_ZipCreate(working_directory+string("\resources.zip),"reez");
GMZ_FolderAdd(zip,working_directory+string("\resources"));
GMZ_ZipClose(zip);


You forgot the " at the end of it.
  • 0

#45 fire_soul453

fire_soul453

    aarons video games

  • GMC Member
  • 542 posts

Posted 19 June 2008 - 12:47 AM

Is there a way to see what is currently being loaded or how far it is extracting? So you could make some cool loading screens.
  • 0
Game maker Top sites
I'm sick of paypal. From now on I'm not buying indie games unless I can use something else...

#46 Adventus

Adventus

    GMC Member

  • New Member
  • 516 posts

Posted 24 June 2008 - 07:40 AM

Is there a way to see what is currently being loaded or how far it is extracting? So you could make some cool loading screens.

Its non-threaded. When you start an extraction the program won't respond until its finished. Use Hobbel's archiver if you want threaded extraction.
  • 0

#47 kvadrat

kvadrat

    GMC Member

  • New Member
  • 2 posts

Posted 14 July 2008 - 01:49 PM

I noticed a wierd thing while trying to use the DLL when I start it from my C:\ hard Drive it works (no matter what folder) but when I move it to D:\ I can't load the files (actually in debug mode when I try "file_exists( <an extracted file> )" it returns 0). My C has FAT32 system and D uses NTFS. Any ideas how to fix it?

P.S. That's the greatest ZIP DLL! I LOVE it :3
  • 0

#48 IceMetalPunk

IceMetalPunk

    InfiniteIMPerfection

  • GMC Elder
  • 9603 posts
  • Version:GM:Studio

Posted 06 August 2008 - 08:35 AM

I'm now on a new laptop, which only has GM7. GM7, AFAIK, can only open .GMK and .GM6 files (and backups), not .GMD's. So I'd like to try this, but I have no idea what the functions are.

I'd use h0bbel's, but his does not support archive compression, only archive extraction and single-file compression.

-IMP :unsure: :P
  • 0

:GM123: Are you an artist who likes creating original creature designs? Maybe you can help out with Elementa here! Give it a look; you might like the idea :)

:bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny:


#49 paulman8888

paulman8888

    GMC Member

  • New Member
  • 140 posts

Posted 26 September 2008 - 04:04 PM

PLEASE FOR THE LOVE OF THIS DLL!
CAN SOMEONE MAKE A SIMPLE EXAMPLE (BAREBONES) FOR THIS DLL!
OR A STEP BY STEP GUIDE!

i find it hard to understand with all the extra code

Thankyou
Paul
  • 0
Love life!
You only get one chance!

------------------------------------------------
Its a funny old world!
Mans lucky if he gets out alive!

#50 rolyataylor2

rolyataylor2

    GMC Member

  • New Member
  • 35 posts

Posted 14 October 2008 - 09:30 PM

When adding a Bitmap file to the zip and then extracting it while on a NTFS file system you cannot import that bitmap into the game after wards. I found this out after programing a game and running it off of a jump drive the entire time (formatted as FAT), then when i moved my project to my desktop as a executable it no longer would accept the image as a background resource. the game still finds the image and will accept it before i compress it with GMZ but after it has been compressed and then uncompressed it will not accept it.
  • 0