- Site Map >
- Modding and Creation >
- Sims 3 Creation >
- Modding Discussion >
- About Reaction Broadcasters
- Site Map >
- Modding and Creation >
- Sims 3 Creation >
- Modding Discussion >
- About Reaction Broadcasters
Replies: 6 (Who?), Viewed: 708 times.
#1
20th Jan 2021 at 3:04 PM
Posts: 175
Thanks: 174 in 1 Posts
About Reaction Broadcasters
I've looked around for some documentation on Reaction Broadcasters, mostly finding information on the TS4 ones. Do they work in a similar fashion in TS3? If not, where could I find some info on them?
Advertisement
#2
22nd Jan 2021 at 12:58 PM
Posts: 3,856
Thanks: 8449 in 67 Posts
Quote: Originally posted by CyrusBanefort
I've looked around for some documentation on Reaction Broadcasters, mostly finding information on the TS4 ones. Do they work in a similar fashion in TS3? If not, where could I find some info on them? |
It's funny that you asked, I too was looking into this yesterday :p but it's actually not that difficult.
A simple version of it would be:
Code:
And voila! You got yourself a simple reactionbroadcast
// Our reaction interaction class. Keep in mind that the previous interaction will get canceled and this one will be added to the queue. Sort of like 'react to fire' public class SeeingSomeoneJournalReaction : Interaction<Sim, LyraleiJournal> { public class Definition : InteractionDefinition<Sim, LyraleiJournal, SeeingSomeoneReadJournalReaction> { public override string GetInteractionName(Sim a, LyraleiJournal target, InteractionObjectPair interaction) { return "Journal Reaction seeing"; } // This part is super important! Here you check whether the ReactionBroadcast should be triggered for a particular sim. For sims giving birth, you wouldn't want them to react on themselves but sims that are not pregnant, then you'd want to have a special check like ' if(!a.SimDescription.IsPregnant), return true' or something like that public override bool Test(Sim a, LyraleiJournal target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback) { if (a.SimDescription.SimDescriptionId != target.mOwnerDescId.SimDescriptionId) { return true; } return false; //if (a.SimDescription.SimDescriptionId == target.mOwnerDescId.SimDescriptionId) //{ // return true; //} } } public static InteractionDefinition Singleton = new Definition(); public override bool Run() { print("Hey!! I'm writing in my journal!!"); string socialName = base.Actor.SimDescription.Teen ? "Teen Insult" : "Shoo"; Sim.ForceSocial(base.Actor, base.Target.CopyingSim, socialName, InteractionPriorityLevel.High, true); InteractionInstance entry = PickUpJournal.Singleton.CreateInstance(base.Target, base.Actor, new InteractionPriority(InteractionPriorityLevel.High), false, true); base.Actor.InteractionQueue.Add(entry); return true; } } public class WriteInJournal : Interaction<Sim, LyraleiJournal> { // Pretend everything a regular interaction needs is here.... public override bool Run() { base.StandardEntry(); base.BeginCommodityUpdates(); base.Target.SeeingBroadcasterCreate(base.Target); // When we get to the end of the interaction: base.Target.SeeingBroadcasterDestroy(); base.StandardExit(true); return true; } } [Tunable] // Depending on what you need, there are a few differnet ways to set the params, but most of the time this is enough. public static ReactionBroadcasterParams kCopyingBroadcasterParams = new ReactionBroadcasterParams(); [Tunable] public ReactionBroadcaster mCopyingBroadcaster; public void CopyingBroadcasterCreate(LyraleiJournal copiedHomework) { mCopyingBroadcaster = new ReactionBroadcaster(this, kCopyingBroadcasterParams, CopyingReactionCallback); } public void CopyingBroadcasterDestroy() { mCopyingBroadcaster.Dispose(); mCopyingBroadcaster = null; } public static void CopyingReactionCallback(Sim s, ReactionBroadcaster rb) { LyraleiJournal homework = rb.BroadcastingObject as LyraleiJournal; if (s.SimDescription.SimDescriptionId == homework.mOwnerDescId.SimDescriptionId && homework.CopyingSim != null) { InteractionInstance entry = SeeingSomeoneReadJournalReaction.Singleton.CreateInstance(homework, s, new InteractionPriority(InteractionPriorityLevel.High), false, true); s.InteractionQueue.AddNext(entry); } }
#3
24th Jan 2021 at 3:43 PM
Posts: 175
Thanks: 174 in 1 Posts
@Lyralei , thanks. Could you tell me where could I find the ghost and vampire reaction broadcasters, to get a sense of how I should do what I want to with the Reactions?
#4
25th Jan 2021 at 6:04 PM
Posts: 3,856
Thanks: 8449 in 67 Posts
Quote: Originally posted by CyrusBanefort
@Lyralei , thanks. Could you tell me where could I find the ghost and vampire reaction broadcasters, to get a sense of how I should do what I want to with the Reactions? |
For vampires thats: VampireOccult > kVampireReactionParams
#5
2nd Feb 2021 at 11:55 PM
Posts: 175
Thanks: 174 in 1 Posts
For loading reaction broadcasters, what could be done?
#6
3rd Feb 2021 at 10:10 AM
Posts: 3,856
Thanks: 8449 in 67 Posts
Quote: Originally posted by CyrusBanefort
For loading reaction broadcasters, what could be done? |
CopyingBroadcasterCreate(this);
Because we always need to create a broadcast. (Aka, instantiating it)
Now, if I'm assuming what you'd want a broadcast to be used for, I do get how interaction instantiating it won't do the trick. Instead, I'd then look at the TragicClown buff, which is a buff your sim has and if other sims are around them they'll start crying. In fact, I think you could even hide the moodlets and pull it off that way too.
Otherwise, you'll have to do some super intense programm-y things to get this to work globally, so this should do it!
#7
3rd Feb 2021 at 1:03 PM
Posts: 175
Thanks: 174 in 1 Posts
Good idea. I'll look into the buff.
Who Posted
|