HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Read trigger with java

06-07-2008, 12:19 PM#1
spong3bob
Hello!

I'd like to write a java programm with which i can read the trigger of a map..

i want to use it to list the changes, which arelisted in a trigger-comment (i hope thats the right name as i have a german version :D )

Does anyone have an idea how i can do that, or if this is possible at all...

Spong3
06-07-2008, 12:26 PM#2
Vexorian
this should be useful : http://www.wc3campaigns.net/tools/specs/index.html

BTW there's a giantic design flaw in the wtg format that makes reading GUI triggers horribly overcomplicated.
06-07-2008, 03:40 PM#3
spong3bob
ok, now i now i can handle the file as an mpq ^^
do you know an mpq-API for java?

i found jlibmpq but i just cant get it to run as i have never used something like that before :( (i don't really care wether my program only works on windows or not...) what do i have to do to make it run?? (i copied the dll file into my system32 - folder) but i cant even compile the .java files from the library (some problems with the packages) so i tried to remove the packages and just compile it without them.. that worked after some tries, but when i want to make a MPQ-Object there comes an exception saying: UnsatisfiedLinkError at the first native method...
06-07-2008, 04:32 PM#4
Vexorian
Quote:
do you know an mpq-API for java?
If I did I would begin work in the cross platform vJass compiler already. jlibmpq requires a dll so it is windows-only and therefore as worthless as a sfmpq wrapper.
06-12-2008, 12:36 PM#5
spong3bob
well, i want to make a program just for windows, if it isn't possible to work in cross platform... i downloaded the sfmpq api, but now im stuck.. i rly don't know what i have to do ..
06-12-2008, 12:55 PM#6
PandaMine
You can only use windows because sfmpq dll has been specifically compiled for the windows 32 bit platform (I believe). If you want to make it cross platform you would need to make you're own mpq library that works under osx/linux/windows and then just dynamically (or statically on linux since most programs are compiled instead of being downloaded as binaries) and link them with java
06-12-2008, 01:12 PM#7
spong3bob
well, i want to make a program just for windows,

i think you don't read properly...

my problem is, that i don't know how to get the name and parameters of the natives...
06-12-2008, 01:32 PM#8
Vexorian
It doesn't make a lot of sense to use Java to make something that runs just in windows.
06-12-2008, 01:52 PM#9
spong3bob
id make it in another language if id be able to program in other languages :D
but java is the only programming language i can cope with :D and the rest of the programm is made in java... the users of this program only use windows so i don't it doesn't really matter if it only works on windows either it's not very intelligent or not ^^
06-14-2008, 05:03 AM#10
PandaMine
Well if you know Java, C++ isn't that much harder, you just need to know the concept of pointers and such

Vex is right in the fact that Java is not the smartest language to use in your case. The problem is not that it will work or not, it will most likely be how slow its going to be especially when dealing with larger apps

And java is just clumsy for desktop use
06-14-2008, 08:37 AM#11
PitzerMike
Quote:
Originally Posted by Vexorian
this should be useful : http://www.wc3campaigns.net/tools/specs/index.html

BTW there's a giantic design flaw in the wtg format that makes reading GUI triggers horribly overcomplicated.

I have a more up-to-date version in the svn repository here (use save as)
I have fixed the wtg specs somewhere around last summer.
06-14-2008, 08:42 AM#12
midiway
So, someone wanna start coding a java library do read the mpq format? Is it so hard?
06-14-2008, 11:43 AM#13
PandaMine
Quote:
Originally Posted by midiway
So, someone wanna start coding a java library do read the mpq format? Is it so hard?

Its not hard, just stupid
06-14-2008, 02:15 PM#14
Dr.Willy
Quote:
Originally Posted by Vexorian
jlibmpq requires a dll so it is windows-only and therefore as worthless as a sfmpq wrapper.
Java's System.loadLibrary works just fine on dlls, jnilibs and sos - we'd have to compile the native code for each platform though.
06-14-2008, 06:18 PM#15
spong3bob
I finally did it event its not sensefull ^^

i think im going to learn a new language..
can u tell me which language is best if i want to programm computer games (3d etc..)?