Editing Material Flags of Munged Models

In this forum you will find and post information regarding the modding of Star Wars Battlefront 2. DO NOT POST MOD IDEAS/REQUESTS.

Moderator: Moderators

Post Reply
SleepKiller
Corporal
Corporal
Posts: 143
Joined: Thu Mar 03, 2011 5:08 pm
xbox live or psn: N/A

Editing Material Flags of Munged Models

Post by SleepKiller »

There is a very useful topic on this site discussing editing of the material flags and render types of .msh files. However there are some things the game's material system is capable of that are not exposed (as far as I have been able to tell at least) through .msh files or .msh.option files. These are things like combining normal maps with scrolling or animated textures. I am unsure how much use this will be to anyone but there are definitely some cool effects you could make using it, so I've written up what I know about the MTRL chunk in munged models and documented it's flags as best I can.

I wrote it up late at night so expect mistakes, and some things I say in it may be outright false. If do spot a mistake be sure to tell me about it so I can fix it.

You can find what I've written up over here https://gist.github.com/SleepKiller/6fb ... 8989231226. I used markdown to write it up so I unfortunately can not post it directly here. If you're unfamiliar with SWBF's file system below is a crash course on it.

Every piece of data in SWBF is stored within a chunk. Chunks can be data chunks or parent chunks. (A chunk that contains other chunks.) A chunk might look like this in your favourite hex editor.
4D 54 52 4C 17 00 00 00 *chunk data* MTRL . . . . *chunk data*
Where the four bytes coloured dark pink are the chunk's identifier and the four coloured orange are the chunk's size. So when I give a description of a chunk it excludes the identifier and size. And the first member I describe would come right after the size field. Which is where you would want to start editing.

If you wanted to keep a munged model around after you have hex edited it you would copy it into the munged folder (the one next to odf/msh/world/etc) and then either rename the original one or add "-ignore" to it's .option file.

As I said I have no idea if this information will come in handy for anyone, but I figured I would post it just so it was out there.
Post Reply