Shell-based mech selections

A section featuring all of Kell's projects and files.
Come and check it out!

Moderators: Skyfaller, Col.Kell

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

Shell-based mech selections

Post by quota4stupid » Mon Jun 15, 2009 9:52 am

Col.Kell wrote:Hmm... I never thought of the in-game-lab thing. But I am mainly the guy who mods the PRJ, not the Shell. I am learning a little bit, but I'd like to do something like that. Hopefully if I can figure things out I can add KAM chassis selection into the shell.
As best I can tell, this information is hard coded into the shell executable (MW2SHELL.EXE), which will make altering it a major pain :-( I've tested this in DOS Mercs 1.06 by blanking out an entry in the mech table (located at offset 0xda13f) - when the game is running, the mech name & video disappear from the mech lab (although the tonnage still appears, which means there is additional information elsewhere in the EXE) and attempting to launch the sim with the blanked out mech will cause the game to crash. You could probably replace existing entries without much trouble, but adding extra entries would require some serious EXE hacking :-(

The bit that really confuses me though is that most of this data also occurs in the MTAB/MECH.MTB entry of the MW2.PRJ file - why the shell doesn't use this is beyond me :?

User avatar
Skyfaller
Clan 2nd MechWarrior
Clan 2nd MechWarrior
Posts: 991
Joined: Sat Apr 12, 2008 2:58 am
Location: Germany
Contact:

Re: KAM 1.2 - Fully automated batch files, new mech!

Post by Skyfaller » Mon Jun 15, 2009 10:26 pm

The shell might take the mech tonnage from byte 0 in the MEK files.
Download MechVM

If you have problems with MechVM, please attach the files MechVM.cfg and install-report.txt from the folder where MechVM installed your game.

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: KAM 1.2 - Fully automated batch files, new mech!

Post by quota4stupid » Tue Jun 16, 2009 12:50 am

Skyfaller wrote:The shell might take the mech tonnage from byte 0 in the MEK files.
For the actual mech editor portion I would say you're right, but for the mech selection screen I think it's in the EXE. Check these out:
warhawk00.jpg
warhawk00.jpg (61.39 KiB) Viewed 6364 times
warhawk01.jpg
warhawk01.jpg (60.93 KiB) Viewed 6363 times
The table I mentioned before (very similar to MECH.MTB) contains four names for the mech: one is 2 characters long, one is 3 characters long, one is up to 8 characters and the fourth is the full name. Not sure what the 2char name is for, but the 3char one seems to choose the SMK video & MEK files, the 8char name chooses the BWD for the mech and the full name is displayed to the user. In the first screen shot I've erased the 3char name (hence the missing video) - I've also removed all of the Warhawk MEK files from the project file. In the second shot I've erased the whole record (all four names) - the tonnage still appears.

I'm guessing there's some other table elsewhere in the EXE with mech records, each with the tonnage, a pointer to the name table, and probably other details :?:

User avatar
Skyfaller
Clan 2nd MechWarrior
Clan 2nd MechWarrior
Posts: 991
Joined: Sat Apr 12, 2008 2:58 am
Location: Germany
Contact:

Re: KAM 1.2 - Fully automated batch files, new mech!

Post by Skyfaller » Tue Jun 16, 2009 4:05 am

Col.Kell wrote:So far I have made 6 mechs: I call them "Boro", "Correr", "Ghast", "Sirus", "Katana", and "Auger".
Please give us some pix and specs!
Download MechVM

If you have problems with MechVM, please attach the files MechVM.cfg and install-report.txt from the folder where MechVM installed your game.

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: KAM 1.2 - Fully automated batch files, new mech!

Post by Col.Kell » Tue Jun 16, 2009 9:09 am

quota4stupid wrote:As best I can tell, this information is hard coded into the shell executable (MW2SHELL.EXE), which will make altering it a major pain :-(
So you are saying that the information the DOS shell .exe (or .dll for Windows) uses to point to a mech BWD and MEK file is made up of all that jibberish hex garble? :?
I have been trying to see if I can FE-FF-up the "pointers" in the shell, but so far I have found nothing that suggests referancing to BWDs in the PRJ.
Although, I was able to change a number of other things in the shell. Such as these:
scenario.jpg
scenario.jpg (73.48 KiB) Viewed 6354 times
weapontable.jpg
weapontable.jpg (20.01 KiB) Viewed 6355 times
mechlab.jpg
mechlab.jpg (54.93 KiB) Viewed 6356 times

Skyfaller wrote:
Col.Kell wrote:So far I have made 6 mechs: I call them "Boro", "Correr", "Ghast", "Sirus", "Katana", and "Auger".
Please give us some pix and specs!
Added one more mech; "Morbit". And there ya have specs for at least the Boro ;) The only things I need left to do are to make MEK files for all the mechs, and fix the insignia on two of the mechs, and then they will be released.
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: KAM 1.2 - Fully automated batch files, new mech!

Post by quota4stupid » Tue Jun 16, 2009 10:14 pm

Col.Kell wrote:
quota4stupid wrote:As best I can tell, this information is hard coded into the shell executable (MW2SHELL.EXE), which will make altering it a major pain :-(
So you are saying that the information the DOS shell .exe (or .dll for Windows) uses to point to a mech BWD and MEK file is made up of all that jibberish hex garble? :?
I have been trying to see if I can FE-FF-up the "pointers" in the shell, but so far I have found nothing that suggests referancing to BWDs in the PRJ.
What are you talking about? It's ALL hex gibberish! :lol:

Like I said before, I think you could probably replace entries without too much trouble (except the tonnage - I would suggest replacing a mech with equivalent tonnage to your new mech).

I don't think the shell ever accesses the Mech BWD files in the project file - I would say the eight character version of the name is just written verbatim into the userstar.bwd file (I think this is supported by the fact that the GPS chunk is one of the only BWD chunks that refers to a project file entry by name only, rather than as an ID/name pair?).

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: KAM 1.2 - Fully automated batch files, new mech!

Post by Col.Kell » Wed Jun 17, 2009 7:53 pm

An interesting discovery relevent to shell-chosen mechs:
shellmechs.png
shellmechs.png (2.38 KiB) Viewed 6333 times
In the red box is the name of the mech as it appears in the mechlab. It has no effect on the MEK or BWD.
In the Blue is important; this is the referance to the mech BWD file in the PRJ that the shell searches for. I was able to switch it to "dropa" to fly a dropship, and "tankb" to be an MBT :)
in the green box is the MEK file prefix the shell searches for. For example, if I have DRW as that value, the shell will come up with the direwolf configs.
And lastly, the two letters in the orange box gives out what mechlab SHP animation is to be played. Oddly, it uses two letters from their inner sphere names mostly. Like the name for the Timberwolf is "MC" (Mad Cat), and "BH" (Black Hawk) for the nova.

You can see for yourself these instances, just look at the hex address and go to there in the mw2shell.dll. I have yet to reveil how to use external-prj BWDs. I tried "C:\1.BWD" (keeping the 8-character limit) instead of "firemoth", but no luck.
Last edited by Col.Kell on Wed Jun 17, 2009 7:56 pm, edited 1 time in total.
Reason: misleading sentance
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: KAM 1.2 - Fully automated batch files, new mech!

Post by quota4stupid » Thu Jun 18, 2009 1:44 am

Col.Kell wrote:An interesting discovery relevent to shell-chosen mechs:
You can see for yourself these instances, just look at the hex address and go to there in the mw2shell.dll. I have yet to reveil how to use external-prj BWDs. I tried "C:\1.BWD" (keeping the 8-character limit) instead of "firemoth", but no luck.
That looks like that table I was talking about. The two-char names also seem to match up with some of the SMK videos for 31cc (for the Mercs mech lab they appear to use the 3 char name instead).

Remember, when you launch the sim, the shell writes the name of the chosen mech BWD (ie: "TIMBRWLF") and the chosen config (ie: "TBR00STD") into a GPS chunk, and then that gets written into the USERSTAR.BWD file in the main mechwarrior directory for the sim to use for the players star. Other BWD files get written into the main MW2 directory if you launch an instant action mission (this observation is based on mercs). My money says that if you put your custom mech BWD file in the main directory and then put it's name (minus extension) in the name table in MW2SHELL.DLL, you could call it out that way maybe?

I'm itching to try this out myself, but I don't have a copy of 31cc installed at the moment (I've temporarily misplaced my 31cc DOS install disk when I moved house 8 months ago - I do have a Windows copy, but I don't feel like stuffing around trying to get it working). If you try this out, let us know if it works :-)

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: KAM 1.2 - Fully automated batch files, new mech!

Post by Col.Kell » Thu Jun 18, 2009 12:51 pm

quota4stupid wrote:The two-char names also seem to match up with some of the SMK videos for 31cc
uhh.. I just said that. Only 31stCC and GBL uses SHP files for mechlab wireframes, Mercs uses SMK video :)
quota4stupid wrote:My money says that if you put your custom mech BWD file in the main directory and then put it's name (minus extension) in the name table in MW2SHELL.DLL, you could call it out that way maybe?
nah. I tried all kinds of things for the 8-char BWD link. For address specific, I used "C:\1.BWD", "C:\MECH1", and to assume that it would search the main install directory, I tried the regular name of the mech BWD. And then shortened it and tried adding the extension. Nothing. The shell is just assuming that all BWDs are being called out within the PRJ. :(
But then I get to thinking; why does it look only in the PRJ for BWD files, but yet when it comes to MEK files, it will search BOTH the PRJ file and MEK folder? :?

I'm itching to try this out myself, but I don't have a copy of 31cc installed at the moment [/quote]
I'll tell ya what; when I'm done with mowing and weed-eating today, I'll mod the DOS version of the Mercs shell to where a number of mechs will be rereferanced to aircrafts and vehicles. just for you. :)
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: KAM 1.2 - Fully automated batch files, new mech!

Post by quota4stupid » Thu Jun 18, 2009 4:19 pm

Col.Kell wrote:
quota4stupid wrote:The two-char names also seem to match up with some of the SMK videos for 31cc
uhh.. I just said that. Only 31stCC and GBL uses SHP files for mechlab wireframes, Mercs uses SMK video :)
I think you'll find you said it calls out the SHP files, not SMK files ;-) ** Three cheers for being a pedantic nit-picking git! ;-) *** As I mentioned, I haven't been able to play 31cc for a while and can't remember the shell that well, but I do know there's a bunch of mech lab related SMK videos (ie: "AJFDS.SMK" and "AWFDS.SMK" - from what I can recall of the 31cc shell, I think they're used to transition from the mission screen into the mech lab, you know, when the mech comes out of the table?)
Col.Kell wrote: nah. I tried all kinds of things for the 8-char BWD link. For address specific, I used "C:\1.BWD", "C:\MECH1", and to assume that it would search the main install directory, I tried the regular name of the mech BWD. And then shortened it and tried adding the extension. Nothing. The shell is just assuming that all BWDs are being called out within the PRJ. :(
But then I get to thinking; why does it look only in the PRJ for BWD files, but yet when it comes to MEK files, it will search BOTH the PRJ file and MEK folder? :?
Bugger, I really had hoped that would work :-( The MEK thing is probably hard-coded into the shell?
Col.Kell wrote: I'll tell ya what; when I'm done with mowing and weed-eating today, I'll mod the DOS version of the Mercs shell to where a number of mechs will be rereferanced to aircrafts and vehicles. just for you. :)
Much obliged squire - don't suppose you could roll me a mercs specific version of one of your custom mechs? Just the one to experiment with shell mech selection in mercs? We'll get this figured out eventually :-D

Post Reply