• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Help automatically extracting files from maps

Status
Not open for further replies.
Level 19
Joined
Jul 2, 2011
Messages
2,162
if it is even possible I would like to know if you could show me how to automatically extract files from a warcraft map

if you would be willing to demonstration it it or point me in the right direction I would greatly appreciate it
 
Last edited:
Level 22
Joined
Sep 24, 2005
Messages
4,821
Can't you call that program from your application? I never got to advanced past basic noob level programming but I remember you can call programs within a program if you use a system call or something.
 
Level 19
Joined
Jul 2, 2011
Messages
2,162
Can't you call that program from your application? I never got to advanced past basic noob level programming but I remember you can call programs within a program if you use a system call or something.
All that will do is open the correct program, it will not allow me to gain access to files inside a map

though that might be leading on to the correct place, there could be MPQ converters that allow other programs to access and run their functions

but it is unlikely

thanks though, you've done more than most
 
Level 22
Joined
Sep 24, 2005
Messages
4,821
Try this one, the author says it's a command line tool.

EDIT: I've seen some applications using external command line applications before, I think you can make that work.

EDIT2: You might need to convert that to windows lol
 
Last edited:
Level 19
Joined
Jul 2, 2011
Messages
2,162
Well if he meant programming wise then he should have said so. He didn't even mention a programming language.

Anyway, look at StormLib. There are bindings for most languages.
Just to clarify

there is actually a way to use a program to automatically extract files from an MPQ?

Like say asking java to extract the maps text, imports, models...etc

HMMMM?????????????????????????????
 
Just to clarify

there is actually a way to use a program to automatically extract files from an MPQ?

Like say asking java to extract the maps text, imports, models...etc

HMMMM?????????????????????????????

Of course there is, that's what Warcraft III is doing after all. If you are going to code in Java take a look at JMPQ3. If you need to process MPQ files on a web backend you can use PHP-MPQ.
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,188
Additionally there is also a third, and rather crappy, approach of getting an application to run another application to extract the files. MPQEdit and such tools should have command line support to extract individual files. Java and such languages allow one to run other applications and block until the application finishes execution. One can thus order another application to extract the files, wait until it is finished and then load up the extracted files for further processing.

That said it is likely far more efficient to use a library like JMPQ3 directly.
 
Level 19
Joined
Jul 2, 2011
Messages
2,162
Of course there is, that's what Warcraft III is doing after all. If you are going to code in Java take a look at JMPQ3. If you need to process MPQ files on a web backend you can use PHP-MPQ.
Question

how do I import this file?

It is in a zip file so I assume you change it to a jar, since all imports should be jar...

but then after that... what is the import function?????

I'm talking about accessing the code from inside java, once you have imported it into the lib file
 
Last edited:
Level 19
Joined
Jul 2, 2011
Messages
2,162
From what I can tell JMPQ3 is available for automatic pulldown using the gradle build method so does not need to be imported at all, rather just referenced appropriately in the build script. In other words gradle will manage deploying it.
I found a work around without gradle

the problem with gradle is that it slows doing your programs start up. where as a library should only be loaded when requested, gradle loads all the components whether needed or not.

but I'm fully satisfied with all the help you guys have offered. my program is working great now and I see a lot of potential for it I'm future
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,188
the problem with gradle is that it slows doing your programs start up.
It does? As far as I am aware gradle is just a build system so has no effect at all on the performance of the resulting build. I do agree that it is quite slow to build, but then again only developers and build servers build so normal users do not care.

A program built with gradle will start up as quickly as one built with ant, with Eclipse's internal build system or built manually from the command line.
where as a library should only be loaded when requested, gradle loads all the components whether needed or not
Which does not matter at compile/build time.

Even if unused components end up residing in the resulting build it makes no difference. Java will only load and compile class files that are requested at run time, reducing the overhead of any class file that are not used to nothing more than the extra complexity scaling of the underlying file system or JAR archive.
 
Level 19
Joined
Jul 2, 2011
Messages
2,162
It does? As far as I am aware gradle is just a build system so has no effect at all on the performance of the resulting build. I do agree that it is quite slow to build, but then again only developers and build servers build so normal users do not care.

A program built with gradle will start up as quickly as one built with ant, with Eclipse's internal build system or built manually from the command line.
Which does not matter at compile/build time.

Even if unused components end up residing in the resulting build it makes no difference. Java will only load and compile class files that are requested at run time, reducing the overhead of any class file that are not used to nothing more than the extra complexity scaling of the underlying file system or JAR archive.
import system.mpq3.*;

the wild card imports the whole library. meaning unused portions will slow down some processes

but I'm not concerned anymore. I got something that works and I'm happy ^-^

I don't actually know all that much about gradle.

thanks again for the help
 
Status
Not open for further replies.
Top