Hi there! You are currently browsing as a guest. Why not create an account? Then you get less ads, can thank creators, post feedback, keep a list of your favourites, and more!
Scholar
Original Poster
#1 Old 10th Jun 2017 at 4:00 PM
Default Interactions are getting added multiple times
So I've been practicing how to add interactions. They've been going well except for one problem. The interaction gets added multiple times on NPCs like the Mascot or Resort attendant or any other NPCs. I'm using this very useful tutorial to learn http://modthesims.info/t/491875
I'm sure the solution is probably not too complex, I'm just really tired right now. I flexed the brain muscle a lot today in adding animations and figuring out certain problems so it'll really help me out if someone here can tell me something about this problem.
I guess I need to somehow check if the interaction is already added right? But how do I do that?
And to clarify one more time the interaction is added multiple times only in an NPC; for the rest it works fine.
Advertisement
Inventor
#2 Old 10th Jun 2017 at 4:31 PM
Instead of
Code:
sim.AddInteraction(ShowNotification.Singleton);

Use
Code:
sim.AddInteraction(ShowNotification.Singleton, true);


AddInventoryInteraction doesn't support that second parameter
(check for duplicates), so, if you have to make sure, write your
own check before calling it.
Scholar
Original Poster
#3 Old 10th Jun 2017 at 4:35 PM
Quote: Originally posted by Arsil
Instead of
Code:
sim.AddInteraction(ShowNotification.Singleton);

Use
Code:
sim.AddInteraction(ShowNotification.Singleton, true);


AddInventoryInteraction doesn't support that second parameter
(check for duplicates), so, if you have to make sure, write your
own check before calling it.


Thank you for such a quick reply. It turns out there was already a solution to this in that tutorial lol. I'll try out your method too tho, yours looks more simpler and easier to implement.
Back to top