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!
Test Subject
Original Poster
#1 Old 23rd Apr 2017 at 4:58 PM
Default MilkTypes (Cow Pasture Store) objects IDs - can anyone help me with understanding?
I wanted to find out if the milk types from the CowPasture could be made available in any other way. After looking into every file and into the script (I just can grasp the main functions of scripts but am in no way a scripter myself) I stumbled on something I do not understand:

The main object is the accessory.milkbottle, which can be made buyable and placeable easily and then acts as white milk.
Assigning the special milk types is done in the script - so no way for an ITUN and XML modder like me.
There are lots of different material informations in the package seemingly related to different geostates (I hope I am using the right terminolgy).
But:
In game I can get information on the different milk types with Debug Enabler and I DO get different Object IDs although the resource is always the same (pointing to the accessory.milkbottle again). These individual objects even have foreign language strings hidden somewhere.
I also can clone the milk types in game and although doing that their optics are reverted to a base object (not the accessory.milkbottle but an empty glass) they still are useable by the sims and work as the special milk types.

Although I have now read some tutorials on object modding and materials I am not really deep enough into that matter to grasp much about it. And most probably I am just too naive and any good scripter or object modder will think my enterprise futile from the beginning and laugh at me ...
I did some really stupid tests like assigning nmgp names and hashes to these Object IDs to test what I get in game - at the grocery store f.i. it was a buyable but priceless, invisible and nonfunctional object, but at least it did not crash my game and could be deleted from the inventory of my test sim using a cheat.

But I really would like to get an explanation where these mysterious Object IDs do come from an how they are linked to the base object as well as to the specific milk types.
Even if I will not achieve my original goal I might at least learn a little bit more about how these things are connected.

So perhaps someone knowledgeable who has a little bit of time to spare can help me with finding an answer?

One flap of a butterfly´s wing could change the course of weather forever (chaos theory)
Advertisement
Virtual gardener
staff: administrator
#2 Old 24th Apr 2017 at 6:41 PM
Helloes

I have been looking around in the store objects.DLL thingy (cuz I don't have the store item myself) though sadly I couldn't find it. However, I've come across a few scripts which I thought only had one objects (And we're talking about accessory meshes, like... well a glass of water! :D) But it seems like the game basically 'breaks' those meshes and replaces them with different ones. I guess you could see them as 'geostates'. Not sure if you're familiar with those? if not, remember how bookcases will look emptier the more books you take away from it? Those are geostates. The game switches to a different mesh due to certain situations and this miiight be the reasson why? But if you could leave the code under a spoiler, that would be awesome! so i can take a look at it, only if you want me to of course
Test Subject
Original Poster
#3 Old 24th Apr 2017 at 8:13 PM
Quote: Originally posted by Greenplumbbob
But if you could leave the code under a spoiler, that would be awesome! so i can take a look at it, only if you want me to of course


This would be a great favour!
I am just not sure which code you mean - the script? Because there is so much about material and states in the package too.
By the way the Cowpasture is one of the store items I could not locate files of anywhere in any games folder (like the teatimeset). When I try to mod store stuff of that kind I always have to decrap the original pack to get a look at it.

Just to start with here is the script (done with ILSpy)
I have copied everything although only some parts refer to the milktypes - I have mainly looked into Cowpasture.Milk, Cowpasture.MilkDrinkInfo and Cowpasture.MilkType


I am at my PC only in the evenings for some time, so if you are so kind to help me it will be a little bit of a slow discussion

EDIT: Attached the milkbottle:package
Attached files:
File Type: rar  acessorymilkbottle_Complete.rar (50.2 KB, 4 downloads) - View custom content

One flap of a butterfly´s wing could change the course of weather forever (chaos theory)
Virtual gardener
staff: administrator
#4 Old 24th Apr 2017 at 9:53 PM
Ahh called for it! It seems like they are geostates:

public enum MilkType
{
White,
Chocolate,
Soy,
Shake,
ChocolateShake
}

public string mGeometryFullName;

public string mGeometryEmptyName;

So the white, chocolate, etc are basically changed (the color) By the materials/ shaders. Which sounds like a reasonable thing to do when creating stuff like that. Luckily for you, this doesn't seem to be happening in the script
the accessory.milkbottle you're reffering to, would be the original glass in this case, and would be affected by those changing materials. So, let's just say the glass is linked to the milk types.

What I would do is to follow this entire tutorial but extract the glass with S3OC: http://modthesims.info/showthread.php?t=474083
this one would be pretty interesting to check out too! http://modthesims.info/t/540902
although don't go as far as putting your milk glasses on a bunch of trees XD
Test Subject
Original Poster
#5 Old 25th Apr 2017 at 10:22 PM Last edited by Nadira : 25th Apr 2017 at 10:55 PM.
Just exactly what I thought - you make me feeling not so completely dumb - thanks a lot! :lovestruc

I had been through both tutorials already prior to my first post and had already been experimenting with adding the milktypes as recepies or ingredients but always with a failure
Sorry I did not mention this to start with, for once I tried to do a short posting (usually having a tendency to write whole novels )

I probably failed because I am completely new to this field, so I will reread everything and do some more tests.
I think one of my problems is to identify the correct hashes. accessory.milkbottle has one in the package, but I am not sure what name was hashed - really accessory.milkbottle ?? I don´t know if there is a way to decode hashes from the number to the name? I tried to hash the other milktype names to the object numbers given with DebugEnabler, but that did not work either when trying to make a new recepy.
My second problem is that there are two sections of geostates in the MLOD. I suspect the second is the one needed for the glasses, but until now had a failure there too when trying to enter them into the recepy, either related to me not correctly identifying the geostates or again to the fact that accessory.milkbottle is not the correct name for the first part of the geostate reference in the recepy file. I did not experience any game lags or even crashes, the sim simply fell out of the action before starting to walk to the fridge.
Concerning my ingredient test I had a good laugh when reading about sims eating sponges but failed to make them eat milkbottles (why not grow these on trees in simlish land of milk and honey ?). Problem is: (citation from the discussion thread) "It's important to make your CC Ingredient inherits from the default ingredient" - but when doing that the milkbottle just will behave as the default plant ingredient and looses the ability to be used as drink And additionally everything referring to the original accessory.milkbottle.OBJD will not pick up the attributes of the other milktypes (which can be tuned in the XML) and just remains white milk
So this means - ??? - scratching her head - that I have to try again to create a non edible non plantable non functional ingredient and IF that works try to use it in a custom recipy which refers to the same object and its geostates as outcome of the recipy hopefully picking up its original attributes and animations??? Getting confused Just cannot imagine how I should get that working at the moment!

But since I now know - thanks to your help - that I was not completely on the wrong track I will give it a try and do some more test. I will report in case I get any usable results but currently not having much spare time to do the testing it will take a while.
In case anyone else is doing tests of his/her own please let me know your results - I really would love to understand this tricky little problem of mine and two or more heads are usually better than one!

Greenplumbbob -I am really VERY VERY thankful for your help and - by the way - I immediately fell in love with those boots you did, all of EA´s are so ugly, and having the Sim2Bughouse back is so cute !

One flap of a butterfly´s wing could change the course of weather forever (chaos theory)
Virtual gardener
staff: administrator
#6 Old 26th Apr 2017 at 12:11 PM
lol well you're not the only one writing entire novels when trying to explain them, I do the same so I don't mind reading them either I guess that's also required when reading mod downloads.

I think I will go over the tutorial again, see if there's somehow a way to skip the ingredient thing. I think I do need to take a look at noma's edible food tutorial as well, if not, see if there's some way to get the drinking option or at least making it possible with a script. So I'll take a look at it as well. I only know how to make custom foods and stuff though so it's always fun to discover something else

Unless our great script modders on here sees this thread

And thanks! I really appreciate it! ^-^ I really should go back to meshing stuff though! I love doing conversions but I guess I should also turn some of my non-sims related meshes to the sims. And maybe give interactionable (if that's even a word lol) a try as well
Back to top