Home | Download | Discussion | Help | Site Map | New Posts | Sign in

Latest Site News

Nysha's New Creators for March - posted on 1st Apr 2018 at 9:00 AM
Replies: 1 (Who?), Viewed: 14588 times.
Miss BHAVing
staff: retired moderator
Original Poster
#1 Old 12th May 2009 at 9:55 AM
Default Tutorial on Custom Thumbnails for Objects
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:As custom thumbnail icons are not a beginner topic, I will be assuming a certain level of knowledge of SimPE and ability to clone objects and will not be explaining those steps in much detail. Screenshots are taken from SimPE v0.72.1.33855


*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 could find a small, one tile, recolourable item to clone and then edit it as you normally would, to make the mesh look the way you want your thumbnail to look, be that changing the mesh completely, colours etc. This is the one I used. In fact my icon object is very simple - it is a square the size of a 1x1 tile, with a picture on it.
  • Equally you could clone your main object that requires the thumbnail and then change the clone to get round whatever problems mean you need a custom thumbnail, be that size, or transparent colours, etc.
You will do all this in a separate package, thus not interacting in anyway with your main object. In a later step we will then put the two together. You must use the same texture files as in your main object though, perhaps just utilising a little portion in the corner for your thumbnail though. I also advise keeping the subset names in both objects the same (and indeed the number of subsets the same too so that your thumbnails represent the colour choices of your object) as this will mean you don't have as many things to update after you put everything together. If your objects have multiple colours, MMATs and TXMTs, you should build the icon object to match. You will ultimately use the MMATs and TXMTs from the main object.

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:-
  • GMDC
  • GMND
  • CRES - remember there will be two of these if you have a custom camera
  • SHPE
and extract them all to files on your computer.

Open up your main package in SimPE 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 SimPE 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:
[prim 0x0002] Expression (My graphic := Literal 0x0001)
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.
Code:
[prim 0x0007] Refresh (my graphic)
Credits
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.
9 users say thanks for this. (Who?)
Advertisement
The ModFather
staff: retired moderator
#2 Old 18th May 2009 at 12:06 PM Last edited by Numenor : 18th May 2009 at 12:33 PM.
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.
Back to top