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 13th Oct 2021 at 6:49 AM
How do I Modify the TunableTuple of the "fruit_component", & the "crop_fruit_component" Thing?
I don't know if I phrased the Title right, since I'm still learning Modding, lol, but I wanted help, please? Thanks in advance

So I was trying to make it so that the "Base Game" Produce is able to Spoil, just like how the "Cottage Living" Produce from the Oversized Crops are able to Spoil, but I'm having an issue while trying to do it? So in S4S, I was using the Object Tuning File of "object_GiantCrops_Fruit_Lettuce" as a reference for the "Produce Spoil" Mod that I'm trying to make, so the next thing I did was that I did a bunch of testing, which was pretty much trial and error type of things? Then I found out "<T n="key">15189<!--Freshness_Fresh--></T>" and the rest that's below it, is some "<L n="client_states">" thing, which I don't know exactly what it does yet, but I know that this probably affects the "Freshness" and whatnot to allow it to Spoil? Either way, I was basing it off of that, and I did kind of get it to work? I added it as a "Client State" to "object_GardeningFruit_Mushroom" as a Test to figure out how it worked? Nothing happened, so I messed around some more, and I found out that if I changed the "fruit_component" to "crop_fruit_component", it actually showed the "Spoil Date", so I thought it was working fine? But then I noticed that I couldn't Plant the Seed because it wouldn't Germinate, or it would be stuck doing the "Planting" Animation over and over instead? I realized that what I wanna change has to be something with that, since I reverted back to using "fruit_component" instead, and everything worked fine, but I didn't see the "Spoil Date" for some reason? So is there something more in depth here I'm not getting? I even used TDESC Browser to find out some info, and it told me some things, but it wasn't really helpful for what I want it to do? Is there a way for me to make my own "TDESC", for a lack of a better term? Since I don't know what they're specifically called? I guess is there a way to make my own "fruit_component", or a way to Override what it does? So it could do the things "fruit_component" does, while showing the "Spoil Date" from "crop_fruit_component"? I'm kind of stumped here, lol.

I'm kind of new to Modding, since I took a break from it, so any Info you could give me would be great! Thanks!
Also, let me know if I explained or did anything wrong? Or if you need more Info or anything from me to help you figure out my issue?
Advertisement
Test Subject
Original Poster
#2 Old 22nd Oct 2021 at 9:09 AM
Eh, I still haven't figured this out, lol, I'm just saying this just in case no one is responding cause they assume that I did? Any help would be nice, especially since I haven't really had the time to figure it out myself. Thanks!
Field Researcher
#3 Old 30th Oct 2021 at 12:35 AM
Client states are hard to describe and can be used for many purposes. I would say the best description I can think of is on/off switches that do different things when chosen, but only one state in a client state can be used at a time, and that's when multiple client states come in handy.
TDESCs (Tuning Descriptions) are just the files EA provides that describe what this or that does in the Sims tuning, so the closest word to what you were describing in this situation is custom tuning (which can also be used to refer to regular custom tuning, lol), but that requires knowledge of Python.

Unfortunately, I took a look around and even if you made custom tuning it would likely be ignored still, as this spoiler timer seems to be handled by the UI. Whenever the string can't be found in the scripts or the tuning, it means the UI handles that data. You can't clone the UI in this case and editing the UI is generally difficult (among other reasons), so that path isn't really one I'd recommend pursuing.
I did fiddle with the object tuning though and created a semi-spoiler timer, but it doesn't act the way the EA one does. But if you still wanted any sort of timer, it can be done.

What I did was add the client states as you did, I then went down to the "tooltip_component" and added a new section. I then chose the key "subtext", used the string EA uses 0x036E079E<!--{0.TimespanShort} until spoiled. --> and then set the "text_tokens" to "statistic_value" and referenced the freshness commodity the big crops and food use 16591<!--Commodity: commodity_freshness-->. It looks like this:
Code:
    
             <U>
                <E n="key">subtext</E>
                <U n="value">
                  <V n="text" t="single">
                    <T n="single">0x036E079E<!--{0.TimespanShort} until spoiled. --></T>
                  </V>
                  <V n="text_tokens" t="enabled">
                    <U n="enabled">
                      <L n="tokens">
                        <V t="statistic_value">
                          <U n="statistic_value">
                            <E n="participant">Object</E>
                            <T n="statistic">16591<!--Commodity: commodity_freshness--></T>
                          </U>
                        </V>
                      </L>
                    </U>
                  </V>
                </U>
              </U>

I also added <T n="update_if_stat_or_buck_changes">True</T> and <T n="update_on_game_option_changed">True</T> to the tooltip section to encourage updating without the user having to do anything, but it still doesn't work as efficiently as EA's regular timer.
It looks like this in-game, unfortunately, but it's the closest I can get. I tried some other things and it either stopped working or made no difference. Strangely enough the key "spoiled_time_text" did not work and nothing in-game uses it, so I'm curious what it's purpose is.

Creator Musings is a Sims 4 modder, poser/animator, and CC creator hangout server (though everyone is allowed) with a tutorial/resource directory, help channels, and mod/cc/sims 4 news channels!
My Discord | Twitter | Tumblr | Patreon
Back to top