#3
21st Sep 2021 at 4:08 PM
Last edited by echoweaver : 21st Sep 2021 at
4:25 PM.
Posts: 973
Thanks: 1897 in 12 Posts
12 Achievements
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