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!
Test Subject
Original Poster
#1 Old 5th Mar 2016 at 8:24 AM
Default Adding a custom interaction to an object?
I have no idea if this could be done or how to do it, but here's what my idea is:

I'm converting and creating a bunch of Harry Potter-themed objects. I'm making the sorting hat and thought it would be fun if it could be functional/interactive. My idea would simply be for the user to be able to click on the hat, and then a pop-up box to appear and randomly sort them into one of the four Hogwarts houses.

Alternatively, if I couldn't do that, maybe I could have a little script mod which does a similar thing; maybe using the cheat menu, you could type in "GetSorted" (or something) and one of the four houses could randomly be chosen for the user?

As I said, I have no idea if such a thing is even possible, and definitely don't know how to do it. I am not a complete newbie to modding/CC creation, but I don't have a lot of experience with xml files or python or the like.

Sorry if I've explained this odd or overlooked some obvious tutorial which will explain how to do this! Thanks in advance.
Advertisement
Pettifogging Legalist!
retired moderator
#2 Old 5th Mar 2016 at 12:42 PM Last edited by plasticbox : 5th Mar 2016 at 12:56 PM.
Re. how to add custom interactions to existing objects, see the the sticky in this forum. If your object is a custom object, you can simply add the interaction to its super_affordances list though, you wouldn't need a script.

Re. this particular interaction, you would need to be a bit more specific as to what you want it to do. People who aren't familiar with the book/movie/whatever don't know what's meant by "sorting hat" or "sorting". Do you want it to set a trait on a sim or something like that? Or do you want the sim to actually move into a household? To get started you should look at existing interactions that do something similar to what you want to do, but right now I can't tell what that would be.

For basic info on how to deal with XML tuning see the walkthrough in Tutorials.

Stuff for TS2 · TS3 · TS4 | Please do not PM me with technical questions – we have Create forums for that.

In the kingdom of the blind, do as the Romans do.
Test Subject
Original Poster
#3 Old 5th Mar 2016 at 1:27 PM
Quote: Originally posted by plasticbox
Re. this particular interaction, you would need to be a bit more specific as to what you want it to do. People who aren't familiar with the book/movie/whatever don't know what's meant by "sorting hat" or "sorting". Do you want it to set a trait on a sim or something like that? Or do you want the sim to actually move into a household? To get started you should look at existing interactions that do something similar to what you want to do, but right now I can't tell what that would be.


Sorry for not explaining it well!

Is it possible to set a trait to a Sim by using an object? Because that would be very cool.

But really, I just wanted a pop up screen for the player to read. i.e. You select the Sorting Hat, the interaction is "get sorted", a pop up screen (like on the notification window) comes up and says, "You were sorted into Gryffindor." Is there a way to do this? Is there a way to do this randomly? (sometimes, it'll say Gryffindor, the next time Hufflepuff, the next Slytherin, another time Hufflepuff, etc).

Hope that makes sense.
Pettifogging Legalist!
retired moderator
#4 Old 5th Mar 2016 at 2:37 PM
Again, take a look at existing interactions that result in notifications. Please see this post: http://modthesims.info/showthread.php?t=537976 (the XML tutorial I mentioned above) for how to get started. Off the top of my head I guess you could use the dig sites -- they also have the sim do an animation and put reward objects in their inventory, but that wouldn't be hard to remove (so basically all that is left would be the notification). There might be other, simpler things you can copy from.

Re. adding traits please see the LootActions tuning description, or search your XML folder for "trait_add" to see some examples.

Stuff for TS2 · TS3 · TS4 | Please do not PM me with technical questions – we have Create forums for that.

In the kingdom of the blind, do as the Romans do.
Test Subject
Original Poster
#5 Old 5th Mar 2016 at 2:39 PM
Quote: Originally posted by plasticbox
Again, take a look at existing interactions that result in notifications. Please see this post: http://modthesims.info/showthread.php?t=537976 (the XML tutorial I mentioned above) for how to get started. Off the top of my head I guess you could use the dig sites -- they also have the sim do an animation and put reward objects in their inventory, but that wouldn't be hard to remove (so basically all that is left would be the notification). There might be other, simpler things you can copy from.

Re. adding traits please see the LootActions tuning description, or search your XML folder for "trait_add" to see some examples.


Thank you for your help! I'll get started and check back in if I have any more questions :D
Test Subject
#6 Old 23rd Mar 2016 at 6:01 PM
There is a way to add a hidden interaction, something like when you enable cheats and have to be helding [shift] to show them?
Instructor
#7 Old 23rd Jul 2016 at 12:48 AM
Quote: Originally posted by LuizCristino
There is a way to add a hidden interaction, something like when you enable cheats and have to be helding [shift] to show them?


Yes: Like this >
Code:
<I c="SimPickerInteraction" i="interaction" m="interactions.base.picker_interaction" n="azoresman:si_SimPicker_Set_Sim_Significant_Other" s="13652543021943910601">
  <V t="disabled" n="_saveable" />
  <L n="actor_continuation">
    <U>
      <T n="affordance">10997549374066406014<!--azoresman:si_Immediate_Set_Sim_as_Significant_Other--></T>
      <E n="target">PickedSim</E>
    </U>
  </L>
  <T n="cheat">True</T>
Back to top