un-wasm

General Mech2 related Developments go here. Discussions welcome!

Moderator: Skyfaller

Forum rules
If you are writing a guide please do not post it here! Post in the Dev FAQ section please.
User avatar
Col.Kell
House Steiner Archon
House Steiner Archon
Posts: 868
Joined: Sat Sep 27, 2008 7:44 am
Location: An Isolated Tennessee Valley.

Re: un-wasm

Post by Col.Kell »

Back!

I got the chance to try unwasm and re-wasm on the following:
  • decompiling both Mercs and 31stCC mech BWDs. Mercs and 31stCC decompiled and Mercs recompiled back normaly, however, 31stCC mechs would not go back into BWD form.
  • decompiling both Mercs and 31stCC scenario file BWDs. Mercs and (few) 31stCC decompiled correctly, but only the Mercs BWDs could be reasembled.
This tool has certainly proven to be very valuble, even if there are some bugs.
This has given me the oppertunity to look into uncompiled mech files and scenario files, so I can better view how these work (which will mean more effective mech BWD hex modding).

Two questions now, what do I type in to decompile the "brain" of the AI? Or the AIT?
And what do I type in if I just want to decompile just one BWD and not all of them?

Nice work, quota! :D
MechWarrior 2: 31stCC
Image
User avatar
quota4stupid
House Steiner Private First Class
House Steiner Private First Class
Posts: 81
Joined: Mon Dec 29, 2008 7:40 am
Location: Australia

Re: un-wasm

Post by quota4stupid »

Col.Kell wrote: Two questions now, what do I type in to decompile the "brain" of the AI? Or the AIT?

Code: Select all

java -jar jmw2.jar ait list -project c:\mercs\mw2.prj
Will list all of the AI tables in the given project file.

Code: Select all

java -jar jmw2.jar ait export -project c:\mercs\mw2.prj -name deflt -out deflt.txt
Will export the named AI table to file (exporting the default table in the above example).
Col.Kell wrote: And what do I type in if I just want to decompile just one BWD and not all of them?

Code: Select all

java -jar jmw2.jar bwd export -source c:\mercs\mw2.prj -bwd BET1SCN1
Will export only the BET1SCN1.BWD from Mercs to the current directory. You can also give a directory as the source to dump a BWD from the local file system instead of the project file.
Col.Kell wrote: Nice work, quota! :D
Thankyou :-)

At some point I will probably wrap this up in a nice GUI instead of the messy CLI... maybe ;-)
User avatar
Col.Kell
House Steiner Archon
House Steiner Archon
Posts: 868
Joined: Sat Sep 27, 2008 7:44 am
Location: An Isolated Tennessee Valley.

Re: un-wasm

Post by Col.Kell »

quota4stupid wrote:

Code: Select all

java -jar jmw2.jar ait list -project c:\mercs\mw2.prj

Code: Select all

java -jar jmw2.jar ait export -project c:\mercs\mw2.prj -name deflt -out deflt.txt
I am getting an error message that says "'ait' is not a known command", any reason?
MechWarrior 2: 31stCC
Image
User avatar
quota4stupid
House Steiner Private First Class
House Steiner Private First Class
Posts: 81
Joined: Mon Dec 29, 2008 7:40 am
Location: Australia

Re: un-wasm

Post by quota4stupid »

Col.Kell wrote:
quota4stupid wrote: I am getting an error message that says "'ait' is not a known command", any reason?
I uploaded a new version a few days after the original post that included the AIT code in it - I thought I uploaded it before you managed to get it, but I guess I didn't, sorry. Try downloading it again, you should get the current version. Again, sorry about that.
User avatar
Col.Kell
House Steiner Archon
House Steiner Archon
Posts: 868
Joined: Sat Sep 27, 2008 7:44 am
Location: An Isolated Tennessee Valley.

Re: un-wasm

Post by Col.Kell »

Okay, one more question about the AIT extraction command;
quota4stupid wrote:

Code: Select all

java -jar jmw2.jar ait export -project c:\mercs\mw2.prj -name deflt -out deflt.txt
I am typing this command in, after I hit "enter", it prints off an empty AIT file. Whats the reason? (I am trying other AITs too, like FDESTROY or FDEFEND)
MechWarrior 2: 31stCC
Image
User avatar
quota4stupid
House Steiner Private First Class
House Steiner Private First Class
Posts: 81
Joined: Mon Dec 29, 2008 7:40 am
Location: Australia

Re: un-wasm

Post by quota4stupid »

Col.Kell wrote:I am typing this command in, after I hit "enter", it prints off an empty AIT file. Whats the reason? (I am trying other AITs too, like FDESTROY or FDEFEND)
Well, as it turns out, I'm an idiot :-P Just double checked the code and found that even when an file output is specified, the AIT exporter just ignored it and wrote to stdout anyway :-P I've corrected the error and uploaded an updated copy to the original link.
User avatar
Col.Kell
House Steiner Archon
House Steiner Archon
Posts: 868
Joined: Sat Sep 27, 2008 7:44 am
Location: An Isolated Tennessee Valley.

Re: un-wasm

Post by Col.Kell »

Yet another new version? hehe... :P
quota4stupid wrote: Well, as it turns out, I'm an idiot :-P
don't feel bad, I know what its like... when I made KAM 1.0, many of the enemies wouldn't attack because I told them (in the mission tables) to attack a star that didn't exist. ;)
Anyway, I'll give this new version a go!
MechWarrior 2: 31stCC
Image
User avatar
Col.Kell
House Steiner Archon
House Steiner Archon
Posts: 868
Joined: Sat Sep 27, 2008 7:44 am
Location: An Isolated Tennessee Valley.

Re: un-wasm

Post by Col.Kell »

Hey quota, is the SCN1 mission table format in 31stCC different from Mercs? Because I have made a .wld mission (quite well thanks to unwasm :) ) and compiled it into BWD form. I hex edited and inserted my new mission tables into an existing 31stCC mission, making sure that all the BWD and INCL tags were fixed. But I'm getting some message saying from the sim after I hit Launch, that there is an error loading the SCN1 file. Any idea? :?

I also think I should mention that in your most recent version of jmw2.jar, the "unwasm" command appears to be broken.

Thanks for your time.
MechWarrior 2: 31stCC
Image
User avatar
quota4stupid
House Steiner Private First Class
House Steiner Private First Class
Posts: 81
Joined: Mon Dec 29, 2008 7:40 am
Location: Australia

Re: un-wasm

Post by quota4stupid »

Col.Kell wrote:But I'm getting some message saying from the sim after I hit Launch, that there is an error loading the SCN1 file. Any idea? :?
Dunno, send me a copy of the broken BWD and I'll have a look.
Col.Kell wrote:I also think I should mention that in your most recent version of jmw2.jar, the "unwasm" command appears to be broken.
In what way?
User avatar
Col.Kell
House Steiner Archon
House Steiner Archon
Posts: 868
Joined: Sat Sep 27, 2008 7:44 am
Location: An Isolated Tennessee Valley.

Re: un-wasm

Post by Col.Kell »

sorry for the late reply. Had some things going on.
The "unwasm" command thing, I must have confused it with "export". I made a mistake. :mrgreen:

Now here is my custom mission in WLD and BWD form:
KELLSCN2.zip
(2.37 KiB) Downloaded 613 times
I can't figure out whats wrong with it. :?

Thanks.
MechWarrior 2: 31stCC
Image
Post Reply