"Hadron1776;c-15824120" wrote:
Idea: You probably won't be able to tie it directly in with 'statistic_in_category', you might be able to rig it in 'operation_actions' under periodic_stat_change', where you add a buff to the Sim once all the happy moodlets go away. Then you key the interaction to end as soon as said buff is added. Might that work? :)
Hmm. Not sure I'm totally following what your idea is.
Here's a sample of how the code can look so we're working with a more concrete example:
Buff ID Here
ON_ADD
EXIT_NATURALLY
True
14640
TargetSim
15
EXIT_NATURALLY
False
Happy_Buffs
5
TargetSim
As far as what you're saying, I'm not sure how you'd get it to add a buff based on the stat changes.
Something that I've done in other interactions (based on some of the Vampire Mind Control interactions) is use a buff_based, but that's a setup where it's a buff that is triggered by a player interaction; in the Vampire case, dispelling some kind of control, which frees the target from the interaction.
In other words, there's a separate interaction (Dispel) and when the player uses it, its loot includes a buff (the same buff that is inside the ON_ADD exit condition for the "mind control" interaction), if that makes sense.
What I'm currently thinking is maybe it'd be best to, rather than attempt to test precisely for buff existence, make the interaction purely time-based, with the ability for the player to cancel out of it. For example, make an interaction that drains Happy and it just goes for something like 15 seconds, whether the target still has Happy buffs or not. The player can then choose to let it run its length or cancel it out early.
A more involved way to play for the player, but at least it would be less jerky in terms of ending early.
The other approach I'm considering for one of my planned interactions is to do a set duration (ex: 15 seconds) like the other example, but with one addition: At the end of the interaction, it does a loot that instantly removes all moods of a type. So it reduces duration over time and if any are left over at the end, it removes them instantly. Bit of a... I don't know... weak design?, I think, as the player would be able to cancel the interaction early with an ON_ADD Dispel kind of thing, giving them a much quicker removal of the relevant mood than waiting out any of the interaction's timer. And yet, it may not be entirely arbitrary; I intend to have periodic skill gain as part of the interaction, so if the player is trying to gain points in the skill, that would give them a reason to let the interaction play out its length, rather than canceling it early.