Home | Download | Discussion | Help | Site Map | New Posts | Sign in

Latest Site News

Nysha's New Creators for July - posted on 1st Aug 2018 at 5:00 PM
Replies: 1 (Who?), Viewed: 593 times.
Test Subject
Original Poster
#1 Old 18th Jul 2018 at 2:57 PM Last edited by Renha : 18th Jul 2018 at 10:33 PM.
Default Detect moodlet in script
Hi. I want to make a mod where when certain moodlet appears, some scripted function runs once. Any idea how to set up this kind of trigger?
Advertisement
Theorist
#2 Old 24th Jul 2018 at 5:36 AM
There is a _send_mood_changed_event as part of the buff component that calls the event manager to process events of type test_events.TestEvent.MoodChange - presumably you could register an event callback for this type and this would make that get a call when any mood changes. I haven't played with this myself, so no clue exactly how well that might work. You'd have to do some hunting around the game scripts, likely searching the sources for mentions of "TestEvent.MoodChange" as that should show you something which registers one of those events.

If that's too much of a pain to figure out perhaps it might be easier to append your own simple basic callback to the buff component's on_mood_changed list (that's what triggers the call the send mood changed event I mention above).

Not sure if registering that test event would be on a per-sim basis or not, but the latter one is definitely tied to a specific Sim's buff component so it would have to be set for each Sim.
Back to top