Replies: 3 (Who?), Viewed: 280 times.
Instructor
Original Poster
#1 Old 26th Mar 2021 at 3:42 PM
Default Buffs that increase motive decay
I want to create a couple of buffs that increase decay of fatigue and hunger. I can see buffs that add skill gain multipliers, but there doesn't seem to be a Motive/Commodity Manager the way there is BuffManager and SkillManager.

I see a buff class BuffCommodityDecayModifier, which LOOKS like a base class from which one would declare buffs as subclasses. I see some other buffs declared from other buff classes, like BuffAlienBoostDrain (base class for BuffBioDrainAnother, BuffBioBoostAnother, etc.) and BuffTransformation, which is the base class for some werewolf buffs and what looks like the ITF dew color buffs.

However, I haven't actually found any buff classes that build on BuffCommodityDecayModifier. I may try it anyway, but I don't have a guarantee that anything makes use of its functionality or that I've correctly guessed how it works. o.O

In sim.Motives, I see that I can set the value and turn decay on and off, and I can get, but not set, the commodity decay multiplier. Is there a way to increase and decrease the decay rate?

Echo Weaver's Simblr: http://echoweaver.tumblr.com/
A portrait in stubbornness - Playing the same legacy since 2009
Sample a Brave Legacy: http://sims3sample.illation.net
Advertisement
Instructor
Original Poster
#2 Old 31st Mar 2021 at 1:45 PM
Haha. So I think this was my java background leading me to the wrong assumptions. A long chat with Battery on Discord led me to realize that everything is public anyway, even attributes that would normally be private. I don't NEED a setter method to change the decay rate of a motive.

That does make me a bit nervous about the moodlet being removed in a way that doesn't revert the changes and then sending my sims into a hangry spiral. I have a sense that BuffCommodityDecayModifier would be what I want to do this in tidier way, but if I can't find an example of it being used, I doubt I'd be able to guess, and I also can't be sure it was ever fully implemented.

Echo Weaver's Simblr: http://echoweaver.tumblr.com/
A portrait in stubbornness - Playing the same legacy since 2009
Sample a Brave Legacy: http://sims3sample.illation.net
Instructor
Original Poster
#3 Old 21st Sep 2021 at 4:08 PM Last edited by echoweaver : 21st Sep 2021 at 4:25 PM.
Following up on my own post now that I'm getting into the weeds of doing this.

As far as I can tell, you can set the decay value on a motive to your heart's content and it won't have much effect. The EA code recalculates motive decay regularly based on the modifiers that it knows about. Unfortunately, it looks like all the modifiers in the game have been hard coded. If you look at
Code:
Motive.UpdateMotiveWithDecay
, it will make your eyes bleed. Screens full of if-then calculations.

HOWEVER, I found a buff class BuffCommodityDecayModifier (CommodityType CommodityDecayModifier), which can be placed on a sim and hold motive decay multipliers until either the multiplier is removed from the moodlet or the moodlet is removed from the sim. The moodlet is not stackable, but it seems to be able to contain any number of multipliers for any commodity.

The downside is that the moodlet appears on the sim. You can provide a Thumb and text in the code, but without that, it appears with ugly PLACEHOLDER DO NOT TRANSLATE defaults. Also, the moodlet doesn't really know if modifiers have been removed -- it just keeps a running total of decay modifiers by commodity, and that total can be 1. Therefore, it takes some finagling to figure out when to remove the moodlet.

Ideally, I'd either one to keep one of these moodlets on affected sims all the time or I'd want to place a separate moodlet for each modifier I'm using so they can be easily tracked. Unfortunately, the code that calculates commodity decay only seems to look for one moodlet of that CommodityType per sim. And since the moodlet has to appear with some kind of image and text, I don't really want it to hang around on a sim forever.

I'm using this stuff on my pets mods, and they're doing exactly what I want. I'm concerned about clashing with other mods that may use this mechanism.

Does this make sense to anyone? Is there some easier way to get where I'm going?

Echo Weaver's Simblr: http://echoweaver.tumblr.com/
A portrait in stubbornness - Playing the same legacy since 2009
Sample a Brave Legacy: http://sims3sample.illation.net
Instructor
Original Poster
#4 Old 21st Sep 2021 at 4:21 PM
To try to give some idea what I'm talking about, here is an instance of BuffCommodityDecayModifier added to my test sim.

It contains modifiers accelerating Hunger and Energy decay associated with the red wound moodlet.

I updated the text and thumbnail so it reads:


When all the wounds or diseases from my mods are gone from the sim, I'd want to get rid of that thing. OR it would be nice to make it invisible, but if that can be done I don't know how.

However, if there are any OTHER mods mucking with this moodlet, I have to be careful how I deal with it so that we don't clash with each other.
Screenshots

Echo Weaver's Simblr: http://echoweaver.tumblr.com/
A portrait in stubbornness - Playing the same legacy since 2009
Sample a Brave Legacy: http://sims3sample.illation.net
Back to top