|Search this Thread|
|12th May 2009, 09:55 AM||Tutorial on Custom Thumbnails for Objects #1|
In 99% of cases, an object modder will not worry about the thumbnails used for their object since the game will automatically create them. You may occaisionally go into the Thumbnails folder to delete them*, thus forcing the game to regenerate them for you but that's probably all that you ever do with Thumbnails. Sometimes, however, the icons generated by the game are not at all what you want and you want to provide completely different images than those generated off of your object.
There are some other tutorials about custom icons:
*When messing about with thumbnails it is also useful to know that holding down <CTRL> and right-mouse clicking on a thumbnail will refresh only that one - quicker than deleting the entire file of thumbnails and waiting for the game to regenerate them all.
Introduction to the Trick
This mechanism still uses the game to produce the thumbnail, it just uses a nifty trick to make the game think the object is one thing, when really it is another - so the game generates the thumbnail of one thing, and the object in the game looks like another thing. This is how the game produces thumbnails for foods - we've just stolen the trick.
This tutorial will therefore reference two objects, we will call the the icon object and the main object.
Step 1: Make an object that has the thumbnail you want
First we will create an entirely separate package, the icon object. What you will create this from rather depends on the reason why you are in need of a custom thumbnail. This package that you are creating will ultimately become the item that the Sims 2 Game automatically creates icons for. I deliberately omit the instructions for this - this tutorial is for advanced users, if you cannot yet clone an object, this tutorial is too advanced for you.
You may also want to get the correct camera angle set up on your icon object. If so, please also have a read of Tutorial on Custom Cameras for Thumbnails.
Step 2: Pull out the parts we need
Having finished your icon object and satisfied yourself that the icons generated for it are what you are after, we now need to pull the appropriate parts out of that package for use in your main object package.
In your icon object package, select all the following resources:-
Open up your main package in and drag the package.xml file that was created as part of the extract into the Resource List window. This will import all the extracted files.
Both CRESs will use the MMATs, TXMTs and TXTRs from the main object which is why you have designed the thumbnail to use the same texture.
Step 3: Tie together any MMATs
Open the SHPE from the newly imported icon object. Ensure that the parts reference TXMTs from your main object. This might not be the case if you started with a new object for your thumbnail. The Scenegrapher would also show up these missing links.
Go through all the MMATs and replace the modelName which currently contains the main object CRES, with the icon object CRES.
Step 4: Identify your newly added CRES as a model to use
Now find your Text List (STR#) with instance number 0x00000085 which should have an empty row 0 and a row 1 filled in with the model name for your main object's mesh. Add another row to this (row 0 must always remain unused) and in that put the name of your icon object mesh. I find the easiest way is to open up the CRES from the icon object and go to the cObjectGraphNode tab and copy everything up to (but not including) the _cres and paste that into the Text List.
Step 5: Set this new CRES so the thumbnail uses it
Now open your Object Data (OBJD) and switch to the RAW Data Tab. In section 07. Resource cross-refs look for the field "0x0048: default graphic" and set it to the number of the row you just added to the 0x00000085 STR, that is number 2. In some earlier versions of I believe this field was labeled as 'object model guid 1 - Read-Only' - the number 0x0048 is the way you will know you have the correct field for sure.
Also in Object Data (OBJD), in section 11. Miscellaneous look for the field "0x0037: Ignore Current Model Index In Icons" and set it to 1.
Step 6: Set the original CRES for the object to use in the game
Now open your Init BHAV and add the following two lines.
We must tell the game where the main object mesh is since we've changed the default graphic in the OBDJ to something else. This is row 1 in 0x00000085 STR.
Code:If you want the new mesh to be used immediately, you must also then refresh the object graphic. If you skip this, the mesh will change when you get into Live Mode.
I can claim no credit myself for discovering this behaviour. All the credit goes to Jasana_BugBreeder for setting me on the right tracks when I needed to do exactly this. My thanks to her, and I hope I have captured all her notes in this tutorial for future reference.
If there is anything that should be said about this, let me know and I'll add it here.
8 users say thanks for this.
[ Click here to view a longer list ]
|18th May 2009, 12:06 PM||#2|
Excellent tutorial! I had a general idea of the problem, but I didn't think it was necessary to edit the MMATs, STR# 0x85 etc. When I've come to the part about the OBJD, I knew that the next step had to be editing the Init BHAV, and I smiled like a child when I went on reading that part
[Thread moved the Tutorial section and added to the Wiki -> Modding Tutorials -> Advanced Level tutorials]
I've finally started my Journal. Information only, no questions.
My latest activity: CEP 9.2.0! - AnyGameStarter 2.1.1 (UPD) - Scriptorium v.2.2f - Photo & Plaques hide with walls - Magazine Rack (UPD) - Animated Windows Hack (UPD) - Custom Instrument Hack (UPD) - Drivable Cars Without Nightlife (UPD) - Courtesy Lights (FIX) - Custom Fence-Arches - Painting-TV - Smarter Lights (UPD)
I *DON'T* accept requests, sorry.