Hi there! You are currently browsing as a guest. Why not create an account? Then you get less ads, can thank creators, post feedback, keep a list of your favourites, and more!
Field Researcher
Original Poster
#1 Old 8th Oct 2009 at 7:38 AM
Default Glass
I wonder if the glass may change color or if you can do more opaque

and can make a glass chair?
Advertisement
Forum Resident
#2 Old 9th Oct 2009 at 11:09 AM
There's 2 kinds, transparent and translucent. I didn't manage to change the color of the glass, and also couldn't add glass to any object that didn't have it before.
The other one
#3 Old 9th Oct 2009 at 4:17 PM
Quote: Originally posted by lemoncandy
There's 2 kinds, transparent and translucent. I didn't manage to change the color of the glass, and also couldn't add glass to any object that didn't have it before.


Does that mean you can replace one type of glass with another? For the longest time now I have wanted frosted glass windows and doors.

I've started looking into meshing etc but I'm at the very beginning of one massive learning curve so it will be a looooong time before I'm able to do anything like that (if it's even possible).
Forum Resident
#4 Old 9th Oct 2009 at 4:48 PM
It's probably possible to do any of that, I'm just saying that I didn't succeed so I don't know how :P
Alchemist
#5 Old 9th Oct 2009 at 5:11 PM
This is surprisingly easy to do... there are probably some pitfalls, but I replaced everything in the .mtlsrc for the cheap stereo body with this material data, which I copied from the CarPolice:

Code:
; decompiled with S3ModlD V1.00 - by Wesley Howe
MATD 0103
MtlName 0x920790DF
ShaderName GlassForObjects
MTNF 9
EdgeDarkening 1 1 0.000000000000
SpecularUVScale 1 2 1.000000000000 1.000000000000
Shininess 1 1 20.000000000000
DiffuseUVScale 1 2 1.000000000000 1.000000000000
Specular 1 3 0.495049506426 0.495049506426 0.495049506426
Transparency 1 1 1.000000000000
Diffuse 1 4 0.000000000000 0.000000000000 0.000000000000 0.750000000000
FresnelOffset 1 1 0.250000000000
UVScales 1 3 0.000030518509 0.000000000000 0.000000000000


I have attached the result below. A tinted-glass stereo, what every sim wants for their party needs.
Screenshots

If you like to say what you think, be sure you know which to do first.
Forum Resident
#6 Old 9th Oct 2009 at 5:57 PM
Ooh that's cool, I want to learn to do this!
I experimented with a door that was solid material, I regrouped the middle parts and changed the .mtlsrc of that group, to one taken (all just copy-pasted) from another door, glassy one. (it was "GlassForPortals") It didn't work, perhaps because of my regrouping.
Alchemist
#7 Old 9th Oct 2009 at 7:55 PM
This was a very simple thing. I opened the (previously decompiled) .mtlsrc from the CarPolice windows group, and pasted it into the main shader for the Cheap Stereo, recompiled, packaged and placed in game.

I know that I have about worn that poor stereo out, but I have a project folder setup with a .bat file that copies everything, packages it and places a copy in the mods folder. I would bet that technique would work well for your knick-knacks.

I left everything else in the stereo stock (except for the description and price). It would appear the glass color is coming from the texture map in the object itself. While it is a designable object, the design tool had no discernable effect on the stereo, so that shader must not be tied to the recolor code.

Anyway, it is easy and lots of fun. I know I posted the wiki page with the MATD definition, there is a list of the shaders there. You will have to hunt through different objects for examples.

If you like to say what you think, be sure you know which to do first.
Forum Resident
#8 Old 9th Oct 2009 at 9:46 PM
Thanks, so I actually didn't do it wrong, apart from that I made a group that shouldn't be there lol. (You can only assign materials to groups, right?) I'll experiment more with this then.

Quote:
I have a project folder setup with a .bat file that copies everything, packages it and places a copy in the mods folder. I would bet that technique would work well for your knick-knacks.

Do you mean I should write a .bat for automating my cluttermaking process? That would be awesome! but unfortunately I know nothing about coding :P
You have no idea how many times I clicketyclick through the export-import-compile-save-etc-etc a day
Alchemist
#9 Old 9th Oct 2009 at 10:51 PM
I use my S3Chop and S3Pack programs for unpacking and packing .package files. Here is one .bat file

Code:
"C:\Program Files\WesApps\s3pack.exe" WesHowe_StereoCheapContemporary WesHowe_StereoCheapContemporary.package
copy WesHowe_StereoCheapContemporary.package "C:\Program Files (x86)\Electronic Arts\The Sims 3\Mods\Test"


I also use commandline versions of the ObjTool decompiler and recompiler... while I quit distributing them when I made the GUI version, they still get made when I make the project. It is the same code, but without the shell. However, I continue to use those with file association from the Windows Explorer. Old dogs and all that.

If you like to say what you think, be sure you know which to do first.
Forum Resident
#10 Old 9th Oct 2009 at 11:30 PM
Very nice, that saves some precious time. I'll try to wrap my head around this stuff one day.
Alchemist
#11 Old 10th Oct 2009 at 12:06 AM
I have a couple of questions (as always).

If we wanted to make something that has two recolorable parts have one of those parts be glass and the other still recolorable how do we go about doing this? That is, how can we make an object like EA's dining table with glass top and recolorable bottom but instead have that object cloned on a deco item, chair, or what-have-you?

When you say, "I opened the (previously decompiled) .mtlsrc from the CarPolice windows group, and pasted it into the main shader for the Cheap Stereo, recompiled, packaged and placed in game."...how do we know which is the main shader for the object in question? If the item has two recolorable parts is there a main shader for each or a single main shader for both?

Sorry if these are stupid questions or answered already elsewhere. And thank you for any help with them.

OM
Lab Assistant
#12 Old 10th Oct 2009 at 12:44 AM
Hey Orangemittens based on what Wes said about glass earlier, I am trying it out right now. I will let you know the results in about five minutes. I have one of my ts2 tables that had a glass and wood part and I have been trying to convert it.
Alchemist
#13 Old 10th Oct 2009 at 12:59 AM
I'm looking forward to seeing it

OM
Lab Assistant
#14 Old 10th Oct 2009 at 1:15 AM Last edited by petallotus : 10th Oct 2009 at 1:45 AM. Reason: Added more results
Okay no luck. But I am going to try to rebuild my package and see what happens. I think my color groups are off for the green/red dds image file. One good thing it is really shiny. Again no luck. I am thinking it is because my table has two groups and most sims 3 tables only have one group. Oh well. I am sure pretty soon we will be able to make those glass tables we all want.
Alchemist
#15 Old 10th Oct 2009 at 2:24 AM
Quote: Originally posted by orangemittens
how do we know which is the main shader for the object in question? If the item has two recolorable parts is there a main shader for each or a single main shader for both?


Recolorable parts are defined by the colored map. Groups are defined in the mesh itself.

All the parts of one group share the same material. The recolorable business is a way to apply more than one pattern on the same group.

I added the whole "Info" button on the ObjTool to help figure out what materials are tied to what groups. Here is the Info dump for the CheapStereo:
Quote:
Group Count = 2
Group 0: Faces = 18, Vertices = 16, Matl_block = 1
Group 1: Faces = 354, Vertices = 489, Matl_block = 6
MTST: tag 0xF3A3C236, block 13
block 14, tag 0xC3867C32
block 13, tag 0x2EA8FB98
Total faces = 372, Total Vertices = 505

If you opened the mesh up in MilkShape, group00 is the dropshadow mesh. Looking at the Face count of 18 would suggest it is a simple mesh, and looking in the ~~~block01.mtlsrc file you will find that it is a Dropshadow material.

The rest of the mesh is in group01, as you can see, it has 354 faces. Here the "Matl_block" is 6, but the line underneath shows it is an MTST, which is a multi-state block. It points to two or more materials (the states can be tied to such things as dirty/clean and other changeable conditions). So then the Info shows the main material group is 13, and underneath that the total list is 2 (in this case) materials, 14 and 13.

So the ~~~block13.mtlsrc file is where I put the shader changes in this mod. I am not sure what the alternate state is on this object, perhaps broken, but I didn't change block14. That would be problematic if I was creating and sharing the object and it changed states during game play, however for a test it was fine, akin to just changing MLOD "00000000" (which is all I did) for a test before finalizing your package.

This is not a beginner level mod, although once you understand how the materials relate to the groups, it is easier than changing a mesh is. There are many objects that have multiple groups, and many have glass as one of the groups, while some have wood or stone or metal parts. By substituting the material definitions you want for the ones build into the object, you change the material type just as readily as the texture changes when you alter a DDS file.

If you like to say what you think, be sure you know which to do first.
Alchemist
#16 Old 10th Oct 2009 at 3:14 AM
Thank you Wes...that helps a lot. I'm starting to get a glimmer of an idea about what the info dump provides.

Why is the MATL block number for the second group 6? I would expect it to be two...counting 13 and 14. I can see why the MATL block number for the dropshadow is one...but 6 for the other is confusing.

OM
Alchemist
#17 Old 10th Oct 2009 at 6:22 AM
The blocks are all sorts of parts pieces, more than just MATD files... there is MLOD, MODL, VRTF, VBUF, IBUF, SKIN and some more types. In this case the order is MLOD, MATL, VBUF, IBUF, SKIN, MATD, MTST (block06), VRTF, VBUF, IBUF, SKIN, MATD, 0x01, MATD (block13), MATD (block14) and 0x01.

In this instance, the second group references block06. Block06, though, is a special material that references more than one MATL (so the object can have different materials based on a state, like dirty or clean or broken). It is called an MTST and it is mostly just a list of MATL blocks, in this instance 13 and 14.

If it didn't have the multistate, then the MATL would have been in block06, and 13 and 14 wouldn't be there. But I have little hope of making a tool that can be used without extensive training which can change the basic structuring of the object. Inserting and deleting requires more changes than just including or removing a block, or a group. Thus the restriction on keeping the same number of groups (and materials) in the recompiled files as in the original.

You don't need to know all of that, although it is no secret. Just complicated. So I made the Info button, which tells you which material blocks go with which group. If you do a dump on one of the rabbitholes that have 32 groups (or so) you will see many dozens of materials, but the same general structure is there, just a lot more of it.

If you like to say what you think, be sure you know which to do first.
In the Arena
retired moderator
#18 Old 10th Oct 2009 at 8:30 AM
Ah..thank you, Wes!
I was about quarter way through analyzing the dumped info and how it matches the files created at decompilation, and my head is already spinning...

Your explanation makes things so much clearer!

I've always liked this site for its users who are never stingy with knowledge and promotes the "open-source and knowledge-sharing philosophy will benefit the whole community" thing.

I'm sure, with this info, it won't be long before we see custom glass objects.
Might transparent floor tiles and walls be the next hurdle to be overcomed?
Alchemist
#19 Old 10th Oct 2009 at 1:45 PM
Thanks once again Wes. I gave it a try using the single tile Mission Coffee table. I replaced that with a block simply mapped by applying the IMG as a Material in MS.

I then used the info dump and found basically the same information that you showed above...same blocks involved.

I changed both block 13 and 14 and I did so in both MODL and MLOD with shadow. I simply copied and pasted the information you provided above that you used to make a glass stereo.

I got a weird sort of glass triangle in the game.



Any ideas on what I did incorrectly?

OM
Alchemist
#20 Old 10th Oct 2009 at 2:37 PM
I don't know for sure, but I wouldn't think 13 and 14 were the right numbers for the MODL chunk. It has an extra block at the start (a MODL block), and usually would not have a dropshadow mesh or materials.

But maybe you meant the corresponding two on the MODL file.

What is that triangle? Is it the top of the table, or a surplus piece? I see legs nearby, but maybe they belong to another item.

If you like to say what you think, be sure you know which to do first.
Alchemist
#21 Old 10th Oct 2009 at 2:57 PM Last edited by orangemittens : 10th Oct 2009 at 4:22 PM. Reason: progress update
No...I didn't mean the corresponding two on the MODL file...I didn't know they would be different so I handled both using the information in the MLOD group...ack. This is what it means to be blonde. At the very least when you attempt to teach me you know you're covering every idiot-mistake someone could possibly make...because I can almost guarantee you I *will* make them all.

I'm not sure what the triangle is...some valiant attempt by the Sims 3 engine to deal with my amateur coding job I'm sure. The legs you're seeing belong to some other item.

Anyway, I'll try again and this time I won't use the information from the MLOD to guide the changes I make to the MODL.

OM

Edited to add:

Ok, I tried this. Created new clone and used my own 6 sided box mapped onto the EA grey IMG. Changed the entire red/green IMG to all red. Changed 13 only for the MLOD with shadow and 7 only for the MODL. Made no changes to the other two MLODs.

This time the object is completely invisible except for its shadow.

Sigh...this isn't going well

OM
Alchemist
#22 Old 10th Oct 2009 at 4:22 PM
The whole standard is a chain of blocks that point to each other. When links are taken out, the chain is shorter and the end pieces would be fewer links from teh start, hence lower numbers.

And make sure you leave the filenames the same, just open them in NotePad and paste the lines overtop of (replacing) the original contents, then save.

Note that I didn't make very many changes at all. I didn't change the mesh, or the texture, or the color map, just the material. You won't find what is wrong if you change more than one thing at a time. Work like a turtle, not a hare.

If you like to say what you think, be sure you know which to do first.
Alchemist
#23 Old 10th Oct 2009 at 7:53 PM
Not a day for me it would seem.

I cloned EA's pedestal cube thing and all I changed was the material definition code.



Now I plan to work on changing the shape of the cube along with the material. Thanks for your help Wes.

OM
Forum Resident
#24 Old 10th Oct 2009 at 10:11 PM
Nice cube Orangemittens, please share what you find in your experiments

I'm curious, is the color of the glass determined by the grayscale map image, or is it in some data in the .mtlsrc
Field Researcher
#25 Old 10th Oct 2009 at 10:28 PM
Nice cube, OM !!
I have the same question as Lemon concerning the color of the glass.
Turning my deco objects into glass ones would be interesting
Page 1 of 3
Back to top