View Full Version : Manually finding an OBJd's MMATs?
7th Feb 2009, 06:03 AM
I'm going to abuse the definition of R&D slightly, since what I'm asking is something which has, evidently, been solved already. I just can't find much in the way of documentation on it, and figure those in the know would be hanging out in here. :)
I know that the MMAT includes the GUID of the OBJd it is attached to. I was wondering though, is there any way of either:
- Finding MMATs based on the tgi of their OBJDs, or
- Finding OBJDs based on the tgi of their MMATs?
To put it in context...
If I were trying to construct a Maxis recolour package by hand, and I had the OBJD available, could I filter straight to the MMATs that I should grab, or would I have to parse all the MMATs to get the ones with the matching GUIDs?
Inversely, if I had an MMAT handy, could I filter straight to the OBJD it belonsg to without parsing every OBJDs in the game for a matching GUID?
If the answer to both of these is "no", then is there any more elegant way of linking the two up than simply parsing all MMATs, then all OBJDs, then pairing them up by GUID?
7th Feb 2009, 09:28 AM
You can use the Group number of the OBJD to find the matching STR#0x85
In line 1 of that is the model name (CRES). I don't know what you'd do next but that is at least the beginning of the journey in the other direction.
7th Feb 2009, 09:55 AM
I have a feeling that gets me access to pretty much everything in the scenegraph *except* the MMATs. ;) The cres points to the SHPE, which points to the GMNDs and TXMTs, which in turn point to the GMDCs and TXTRs respectively...
The problem is that the MMATs are meant as an alternative access path, so that a recolour doesn't need to have a copy of the SHPE or CRES in order to link with it.
That said, parsing short STR# files is less complex and intensive than parsing OBJD files, so I suppose I could join them to the modelName field in the MMATs for a bit of an improvement. Plus, there's only one STR# 85 per object, as opposed to multiple OBJDs, so that's a plus! :)
7th Feb 2009, 11:59 AM
Well the MMAT does have a subset name in it, but that is not very definitive as you get the same subset name used over and over in different objects.
With my current knowledge the way I would do it is probably just open every package looking for MMATs with the right GUID in - but hopefully someone will come along who knows the missing link :D
7th Feb 2009, 12:15 PM
The MMAT has a "modelName" in it too, which is its CRES name, so it's doable. :)
Edit: Hmm... Yeah, that does work.
7th Feb 2009, 12:30 PM
Though more than one object might use the same model. I do sometimes for my hacked objects when I want to keep them small I don't actually clone the scenegraph part, just the simantics. I call the model just from the STR#0x85. Then if I want to allow designmode colour changing, I take a copy of the original MMATs and give them my new GUID.
However, I don't think many people do that, so there would be no huge call for your tool to accommodate that way, I shouldn't think.
NB the model name doesn't appear to interfere with this, as I was able to use MMATs from say the 4-panel door with the flat door, as long as they had the right GUIDs.
7th Feb 2009, 12:49 PM
Fair point though. I think I'll just write the OBJD guid option. I get catalogue placement info as a bonus that way. :)
7th Feb 2009, 02:15 PM
The way I do it in the unreleased DDO is to do what you said originally - get a list of all possible OBJD guids and link from there - but I do it ina huge long list of stuff (aka maxisinfo.xml) so it's already pre-gotten from the various package files.
That file, btw, contains all the guid information for every object in every game, ep and sp.
Have a look at the 3d render menu on the DDO form - you'll see it calls a routine which searches for the mesh itself.
If you find a way to streamline this though, let me know. :)
vBulletin v3.0.14, Copyright ©2000-2013, Jelsoft Enterprises Ltd.