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!
Quick Reply
Search this Thread
Field Researcher
Original Poster
#1 Old 8th Sep 2022 at 9:53 PM
Default How could I implement a method which returns a notification style with a sims(Target) face that is not in the active household.
I was made aware of a bug in my Virginity script mod. Where the "ask if Virgin" interaction does not show a notification when the target is not a part of the active household. I tested it and it turned out to be true. I then went back to my code and messed around with it and I believe that the reason for the bug is the fact that I used this line

Code:
base.Target.ShowTNSIfSelectable(NonVirgin, StyledNotification.NotificationStyle.kSimTalking);


Because the target sim is not in the household, the target sim is therefore not selectable/playable. Therefore, the notification does not show up after the "Ask if Virgin" interaction. I initionally thought this code meant if they were just selectable.

I really want the picture of the sims face to show up when they answer this question in the notification pop up. Is there an alternative to "ShowTNSIfSelectable" that works for non household sims? I know it is possible, because the "ask for sign" interaction shows the targets face picture in the notification when they are not even in the same household. As of this moment I did not find anything significant in ILSpy, but if I do I will come back and report on the alternative.

Again any help would be appreciated. Thank you!
Advertisement
Space Pony
#2 Old 8th Sep 2022 at 10:33 PM
Generally, unless you use NRaas PortraitPanel, "selectable" means that a Sim can be, well, selected and fully controlled via the Sim skewer in the bottom left. In other words, a Sim is selectable if they are a member of the active household and are not a roommate.

Assuming this is in the interaction's Run method, you can use this instead:

Code:
if (!Autonomous)
{
    StyledNotification.Show(new StyledNotification.Format(NonVirgin, Target.ObjectId, StyledNotification.NotificationStyle.kSimTalking));
}


This will show the same notification with the same style and thumbnail, regardless of whether or not the target is selectable, as long as the interaction itself was user-directed (i.e. you started it by clicking on it in the pie menu). The latter check is necessary in case you make the interaction usable autonomously, to prevent getting random notifications from townies halfway across town.

"The Internet is the first thing that humanity has built that humanity doesn't understand, the largest experiment in anarchy that we have ever had." - Eric Schmidt

If you enjoy the mods I put out, consider supporting me on patreon: www.patreon.com/Gamefreak130
Field Researcher
Original Poster
#3 Old 9th Sep 2022 at 12:55 AM
This worked, thank you so much! Also it was in the run method. I should have mentioned that.
Back to top