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 22nd Jan 2022 at 7:00 PM
Default How can you add an interaction to an object with an animation?
So, i was messing a little bit with Zerbu Mod Constructor, and I maded a couple of minimods for my game, and, i can't find how to make an interaction with an object that have an animation, sure, you can do instant actions with objects, but i want for example, that my sim could examinate a stone of the mod before picking it up, with a loop animation

Is there any way of doing so?
Advertisement
Test Subject
#2 Old 2nd Sep 2023 at 4:08 AM
I would love to earn that too but sadly no one has responded.
Instructor
#3 Old 6th Sep 2023 at 9:37 AM
Quote: Originally posted by hockeystarlet
I would love to earn that too but sadly no one has responded.

You can reverse-engineer pretty much anything that already exists in the game with relative ease.

I'm not familiar with Mod Constructor because Sims 4 Studio is already such a powerful tool for anything related to tuning files. Open the tuning for any animated interaction and you will see the portions of XML related to how it includes animations. Even if you are more comfortable doing the main work in Zerbu's program, it is very useful to familiarise yourself with S4S and the TDESC browser so that you have the knowledge to manually add functionality to the package that you create.
Test Subject
#4 Old 10th Sep 2023 at 5:38 AM
Quote: Originally posted by CardinalSims
You can reverse-engineer pretty much anything that already exists in the game with relative ease.

I'm not familiar with Mod Constructor because Sims 4 Studio is already such a powerful tool for anything related to tuning files. Open the tuning for any animated interaction and you will see the portions of XML related to how it includes animations. Even if you are more comfortable doing the main work in Zerbu's program, it is very useful to familiarise yourself with S4S and the TDESC browser so that you have the knowledge to manually add functionality to the package that you create.


I want to make all the cribs and toddler beds upgradeable like the blandco one. I started by experimenting with the tuning file. I apply it to a different bed. When I go in game the interaction is available however once my sim is done with the upgrade, the crib does not appear. I am not sure what I am doing wrong. Once I am able to get this to work I'd like to have the matching crib/toddler bed appear for each one. However I can't begin to figure out how to do that until I get the interaction to work.
Instructor
#5 Old 10th Sep 2023 at 7:28 AM
Quote: Originally posted by hockeystarlet
I want to make all the cribs and toddler beds upgradeable like the blandco one. I started by experimenting with the tuning file. I apply it to a different bed. When I go in game the interaction is available however once my sim is done with the upgrade, the crib does not appear. I am not sure what I am doing wrong. Once I am able to get this to work I'd like to have the matching crib/toddler bed appear for each one. However I can't begin to figure out how to do that until I get the interaction to work.


The interaction likely is working, but the tuning also tests the identity of the starting object and has nothing to swap it with.
crib_Upgrade_ConvertToBed defines a list of objects by their instance ID and then the object state to give them. Then the crib tuning itself (object_Crib_EF48GEN) has a matching set where the object states are linked to the bed, and vice versa in the bed tuning. You can sample each of these to make your own custom tuning where the cribs and beds of your choice are defined or add them to the existing state_change and client_state sections of XML

Though all quite unrelated to anything to do with adding an animated interaction as described in the original post here. Just to clear any confusion for anyone looking into that, the first response still applies for that. The relevant parts in that case are to find the snippet an existing interaction is accomplished with and either re-use it or use it as reference for a custom animation.
Test Subject
#6 Old 11th Sep 2023 at 1:20 AM
Quote: Originally posted by CardinalSims
The interaction likely is working, but the tuning also tests the identity of the starting object and has nothing to swap it with.
crib_Upgrade_ConvertToBed defines a list of objects by their instance ID and then the object state to give them. Then the crib tuning itself (object_Crib_EF48GEN) has a matching set where the object states are linked to the bed, and vice versa in the bed tuning. You can sample each of these to make your own custom tuning where the cribs and beds of your choice are defined or add them to the existing state_change and client_state sections of XML

Though all quite unrelated to anything to do with adding an animated interaction as described in the original post here. Just to clear any confusion for anyone looking into that, the first response still applies for that. The relevant parts in that case are to find the snippet an existing interaction is accomplished with and either re-use it or use it as reference for a custom animation.


Let me see if I understand. Essentially the 2 objects the crib and matching bed have their own tunings. However the tunings are linked to each other. So when I modify one objects tuning I have to also modify the others. That's the thing. I have narrowed down the sections of xml in both tunings to that specific action. However I am not sure what I need to change. I have tried to change the name of the tuning for both objects in the same manner that other modders swap tunning to make sims able to pee on plants. As far as changing thing within the code I am a bit confused on how to do that. I know the things listed in the code are specific to objects and interactions in the game. However how do you know which objects and actions they are linked to and how to find the correct replacement codes to change those objects and interactions. I have been playing around with the tuning and am able to add and remove the things. However a lot of that was from process of elimination and comparing tuning file to other similar objects in the game.

<L n="client_states">
<U>
<T n="key">275005<!--upgrade_Completed_Generic_Slot1--></T>
</U>
<U>
<T n="key">275012<!--upgrade_NotStarted_Generic_Slot1--></T>
</U>
<U>
<T n="key">275015<!--upgrade_Partial_Generic_Slot1--></T>
</U>
</L>
<V n="default_value" t="reference">
<T n="reference">275012<!--upgrade_NotStarted_Generic_Slot1--></T>
</V>
</U>
<U>
<L n="client_states">
<U>
<T n="key">323883<!--genericVariant_Values_1--></T>
<U n="value">
<V n="replace_object" t="enabled">
<U n="enabled">
<V n="new_object" t="enabled">
<T n="enabled">293880</T>
</V>
</U>
</V>
</U>
</U>
<U>
<T n="key">323884<!--genericVariant_Values_2--></T>
<U n="value">
<V n="replace_object" t="enabled">
<U n="enabled">
<V n="new_object" t="enabled">
<T n="enabled">311234</T>
</V>
</U>
</V>
</U>
</U>
<U>
<T n="key">323885<!--genericVariant_Values_3--></T>
<U n="value">
<V n="replace_object" t="enabled">
<U n="enabled">
<V n="new_object" t="enabled">
<T n="enabled">311235</T>
</V>
</U>
</V>
</U>
</U>
<U>
<T n="key">323886<!--genericVariant_Values_4--></T>
<U n="value">
<V n="replace_object" t="enabled">
<U n="enabled">
<V n="new_object" t="enabled">
<T n="enabled">311236</T>
</V>
</U>
</V>
</U>
</U>
<U>
<T n="key">323887<!--genericVariant_Values_5--></T>
<U n="value">
<V n="replace_object" t="enabled">
<U n="enabled">
<V n="new_object" t="enabled">
<T n="enabled">311237</T>
</V>
</U>
</V>
</U>
</U>
<U>
<T n="key">323888<!--genericVariant_Values_6--></T>
<U n="value">
<V n="replace_object" t="enabled">
<U n="enabled">
<V n="new_object" t="enabled">
<T n="enabled">311238</T>
</V>
</U>
</V>
</U>
</U>
<U>
<T n="key">323889<!--genericVariant_Values_7--></T>
<U n="value">
<V n="replace_object" t="enabled">
<U n="enabled">
<V n="new_object" t="enabled">
<T n="enabled">311239</T>
</V>
</U>
</V>
</U>
</U>
<U>
<T n="key">323890<!--genericVariant_Values_8--></T>
<U n="value">
<V n="replace_object" t="enabled">
<U n="enabled">
<V n="new_object" t="enabled">
<T n="enabled">311240</T>
</V>
</U>
</V>
</U>
</U>
<U>
<T n="key">323891<!--genericVariant_Values_9--></T>
<U n="value">
<V n="replace_object" t="enabled">
<U n="enabled">
<V n="new_object" t="enabled">
<T n="enabled">311241</T>
</V>
</U>
</V>
</U>
</U>
</L>
<V n="default_value" t="reference">
<T n="reference">323882<!--genericVariant_Values_0--></T>
</V>
</U>
<U>

I have figured out that this relates to the action:

<L n="client_states">
<U>
<T n="key">275005<!--upgrade_Completed_Generic_Slot1--></T>
</U>
<U>
<T n="key">275012<!--upgrade_NotStarted_Generic_Slot1--></T>
</U>
<U>
<T n="key">275015<!--upgrade_Partial_Generic_Slot1--></T>
</U>
</L>
<V n="default_value" t="reference">
<T n="reference">275012<!--upgrade_NotStarted_Generic_Slot1--></T>
</V>
</U>
<U>


I also know the following is related to the object. This is just one and each is related to the different swatches of the object. I am assuming the key is what narrows down which crib pops up. However where do you look that information up so you can swap objects?:

<L n="client_states">
<U>
<T n="key">323883<!--genericVariant_Values_1--></T>
<U n="value">
<V n="replace_object" t="enabled">
<U n="enabled">
<V n="new_object" t="enabled">
<T n="enabled">293880</T>
Instructor
#7 Old 11th Sep 2023 at 3:20 AM
Quote: Originally posted by hockeystarlet
However where do you look that information up so you can swap objects?

Quite a few guides skip over this detail, so I'm not surprised it's the part catching you off guard

The way I worked my way through how it works was to start with opening the crib as an 'Override' so S4S wouldn't renumber anything.

In the Warehouse tab, you will see an Object Definition for every swatch. In the Data tab of each one, there is an Instance ID that is usually a large sequence of numbers and letters (0000000000047BF8 for the first swatch of this crib). This value is the key to referencing the object anywhere else, but the sneaky part is that it won't be in the same format. The definitions usually use the decimal value. You can find this from Tools > Hash Generator and pasting the long ID into the 'Hexadecimal' space. The number that appears in 'Decimal' is the number you will find inside the tuning (293880). It also works the same in reverse.
If you see a 6-digit number that came out of nowhere/doesn't belong to a tuning file, it's probably an instance ID.

The tuning for the crib, object_Crib_EF48GEN, has some important things as you've seen under client_states, but 293880 isn't here so we'll come back to it.
What we do find here is the name of the upgrade, crib_Upgrade_ConvertToBed, as the next file to add to the project.

This one has the state_change section, and a familiar number under the test for actual_object
Code:
<T n="actual_object">293880</T>
</U>
</V>
</U>
</V>
<T n="value">323883<!--genericVariant_Values_1--></T>

This is testing that if the object being upgraded is 293880, genericVariant_Values_1 is the Object State to change it to. The latter doesn't actually have any important info inside it, it just exists to connect the values.

Back to the crib tuning and its client_states, we can see that each one has two mystery numbers.
One under Key, which we can now see is the tuning ID for genericVariant_Values_1.
And one under new_object, which is an instance ID.
Code:
<T n="key">323883<!--genericVariant_Values_1--></T>
<U n="value">
<V n="replace_object" t="enabled">
<U n="enabled">
<V n="new_object" t="enabled">
<T n="enabled">295572</T>


295572 is another instance ID, which Hash Generator can translate to 0000000000048294 for us.

Taking a peek at the matching bed in the same way, one can see that this is the instance ID of the first swatch.
Then the matching tuning (object_bedSingle_Toddler_EF48GENbabyCrib) and (crib_Upgrade_ConvertToCrib) have them in reverse- a new_object definition for the crib an actual_object test for the bed.

To boil it down into what's relevant for your purposes, either on the existing files or copies of the tuning that you rename and renumber (ie. CreatorName_UpgradeableCrib1, so on), you need to-
  • Make new Object State tuning for each swatch of the new crib. You can duplicate genericVariant_Values_1 and rename/renumber it.
  • Add a section under state_change in the upgrade Interaction tuning, with the decimal ID of the crib as the actual_object and the decimal ID of the new state as the 'value'.
  • Repeat on the upgrade Interaction for the bed, same state value but the ID of the matching crib.
  • Add a section under client_states in the crib tuning, with the object state as the Key and the decimal ID of the matching bed as the new_object.
  • Repeat on the bed tuning, same key but the ID of the crib.

Hopefully I didn't write any of those backwards, it does get a little disorienting what points to what. Ahem... anyway...

Best of luck to your project!
Test Subject
#8 Old 13th Sep 2023 at 2:00 PM
Thank so much for taking the time to provide all that information. I very much appreciate it. I have had a hard time getting responses to my questions. So I am very grateful. I am going to start messing around with it. I'm pretty sure I'll be able to figure it out with the information you provided. The numbers are what were tripping me up. I was going nuts because I couldn't find anything that matched. No amount of googling tutorials helped either. I also want to separate the mattress from the frame and make the frame what gets upgraded. I have figured out the separation process. However I'm not happy with the footprints or lack there of. I downloaded a few other creators versions to see what they did but they just eliminate the footprints and the sims walk through the item. I don't like that. I'm trying to figure out a way for both items to have footprints and not conflict. Kind of how clutter snaps onto a table. I want the mattress to snap onto the bed frame and still be functional. However I keep getting an error from my sim saying there is something in the way. I know people have done the whole mattress separation thing but it isn't satisfactory for the way I want to play my game. I want to take it to the next level. If you can point me in the right direction regaurding that. I should have everything I need to complete my project.
Test Subject
#9 Old 13th Sep 2023 at 5:48 PM
I got it to work! All my toddler beds and matching cribs are now upgradable. I knew it was as simple as copy and paste. I just had no idea how to go about finding what I needed to paste. Now that I know how to do this with this particular tuning. I can most likely apply the knowledge to different objects and interactions to create a custom tuning file. It opens up so many more possibilities for things I may want to tweak on items in my game. Next step is mastering Blender.
Instructor
#10 Old 14th Sep 2023 at 4:50 AM
Quote: Originally posted by hockeystarlet
I got it to work! All my toddler beds and matching cribs are now upgradable. I knew it was as simple as copy and paste. I just had no idea how to go about finding what I needed to paste. Now that I know how to do this with this particular tuning. I can most likely apply the knowledge to different objects and interactions to create a custom tuning file. It opens up so many more possibilities for things I may want to tweak on items in my game. Next step is mastering Blender.

I'm so glad it worked out for you! The amount that can be done with pure tuning is near limitless, you will certainly find that the more you recognise the contents of the XML the more could be repurposed into new things.

I know that the snap function of objects is related to slots, which is more in the object creation side of things and so a little outside of my TS4 knowledge so far. There are some basics on using the S4S Slot Editor, which may be a good place to start. I'm not entirely sure if there's a way to get sims to ignore an object conditionally, but you may be able to resize the footprint of the bed in a way that allows them to get close enough to the mattress to use it but not walk through when a mattress isn't present.

My actual tutorials are all for TS3 so far, but you may still get some use out of the Blender prep- from the video linked and if you skip to the green header, most of the tools and shortcuts are the same in older/newer versions of Blender and there's a lot of tricks there I wish I'd known from the start. You may just find that the locations of some buttons or their names will vary depending on which version of Blender you decide to work with (I believe the release version of S4S uses 2.7, while the beta can use 3.0+).
Test Subject
#11 Old 14th Sep 2023 at 5:37 PM
I'm just excited I was able to get my idea to become a reality. I thought it was so stupid that only one bed and crib have the upgrade option. It just makes the game seem so unfinished. There are also so many debug houses that can't be recreated because the game doesn't have the content or the swatches. I have been messing around in blender with the beds because 1. I like having them separate. and 2. I want to get better at using the app to eventually create the missing build mode items in order to recreate every single debug house accurately. I am a bit mad because I almost had all the debug buildings uploaded to the gallery but for some reason half ended up getting removed, so I have to rebuild them. However This time I plan to rebuild them with my custom content. Anyway, Thank you for all the help!
Test Subject
#12 Old 16th Sep 2023 at 6:56 PM
I hate to bug you again however I ran into a problem with my second toddler bed and crib. It contains more swatches then the original tuning file. So I have to add more keys under the client states. I tried to do that but the new additions do not function in game. I am stuck as to how to go about doing that. I am assuming I need to extract a file that contains that information and to be tweek it. The genericVariant_Values_ only go up to 9. Those swatches work fine however 10 through 16 won't. I tried to just copy paste and then change 323891 to 323892 and changed <T n="key">323891<!--genericVariant_Values_9--></T> to <T n="key">323891<!--genericVariant_Values_10--></T>. However I don't think it is that simple. The
following is an example of the line of code I am referring to. If you can help that would be awesome. If not that is okay too. I don't want to become a nuisance.

<T n="key">323891<!--genericVariant_Values_9--></T>
<U n="value">
<V n="replace_object" t="enabled">
<U n="enabled">
<V n="new_object" t="enabled">
<T n="enabled">311739</T>
</V>
<T n="use_fgl">False</T>
Instructor
#13 Old 17th Sep 2023 at 1:53 AM
Quote: Originally posted by hockeystarlet
I hate to bug you again however I ran into a problem with my second toddler bed and crib. It contains more swatches then the original tuning file. So I have to add more keys under the client states. I tried to do that but the new additions do not function in game. I am stuck as to how to go about doing that. I am assuming I need to extract a file that contains that information and to be tweek it. The genericVariant_Values_ only go up to 9. Those swatches work fine however 10 through 16 won't. I tried to just copy paste and then change 323891 to 323892 and changed <T n="key">323891<!--genericVariant_Values_9--></T> to <T n="key">323891<!--genericVariant_Values_10--></T>. However I don't think it is that simple. The
following is an example of the line of code I am referring to. If you can help that would be awesome. If not that is okay too. I don't want to become a nuisance.


No worries, that's what I'm here for
Technically these are listed in a file called GenericVariant, an Object State Tuning file you can find by typing that name into the Export Tuning of S4S.

As mentioned on the first bullet point, the genericVariant_Values are also real files that exist for each state- the Key they're referred to by is their TuningID. You can duplicate one of the existing ones for each missing swatch and rename/renumber them. If you add your creator name followed by a : symbol in the new names, S4S should auto-renumber it for you. Then the new TuningID will be both what you add to the list and what is used as the Key.

To expand on that first step from the previous post, you can also make an entirely unique set to avoid overwriting the EA files.
You can do that by adding GenericVariant to your project, then changing the name in the Data tab to something like Hockeystarlet:ObjectVariants. S4S will automatically renumber it to match.
Then you can add genericVariant_Values_1 and do the same, but this time renaming it to something like Hockeystarlet:CribA_Swatch1. Then you can press Duplicate (when it prompts for a new instance ID just put a 0, as the real one will be generated when you rename it), and call that one CribA_Swatch2. So on, through to Swatch10 and beyond. Then you can copy the TuningID of each one and add it to the list in your ObjectVariants.

If you haven't had any issues with reusing the variants for different objects, either method you prefer will work just fine. I originally wasn't sure if they would overwrite one another, which would make the second method a requirement.
Test Subject
#14 Old 19th Sep 2023 at 7:47 PM
Thank you for all the information I didn't realize a tuning file has more tuning files withing it. For some reason I assumed it was an instance that was just assigned to the swatch which needed to be changed. I didn't even think of looking for more tuning files. I did run into an issue though. When I changed GenericVariant to Hockeystarlet:ObjectVariants, it changed the tuning ID which ended up breaking the interaction in game. I assume it is because I am supposed to replace the old ID, 323880, with the new one. However I searched everywhere and can't find where that number is in order to replace it. If I leave the tuning file alone and just add the new swatch variants to the existing list, it works. I'm not sure if it is okay to leave it that way or if doing so will cause problems in the game down the road.
Instructor
#15 Old 20th Sep 2023 at 2:24 AM
Quote: Originally posted by hockeystarlet
Thank you for all the information I didn't realize a tuning file has more tuning files withing it. For some reason I assumed it was an instance that was just assigned to the swatch which needed to be changed. I didn't even think of looking for more tuning files. I did run into an issue though. When I changed GenericVariant to Hockeystarlet:ObjectVariants, it changed the tuning ID which ended up breaking the interaction in game. I assume it is because I am supposed to replace the old ID, 323880, with the new one. However I searched everywhere and can't find where that number is in order to replace it. If I leave the tuning file alone and just add the new swatch variants to the existing list, it works. I'm not sure if it is okay to leave it that way or if doing so will cause problems in the game down the road.

Using the existing list should be fine, the only thing to keep in mind would be to check the original after major patches just in case Maxis make a change to it themselves.

I'm sorry to hear that making your own variant list didn't work as thought! Likely my own fault, it's possible there's an earlier link in the chain that I overlooked. It sounds like GenericVariant also gets referenced somewhere, but it's that kind of backwards step that is hard to do when we don't know where that might occur. I'll make some edits to my comments to trim out the parts we know are redundant now, and if I ever find where variant lists need to go I'll come back and add that too
Test Subject
#16 Old 23rd Sep 2023 at 2:05 PM
Quote: Originally posted by CardinalSims
Using the existing list should be fine, the only thing to keep in mind would be to check the original after major patches just in case Maxis make a change to it themselves.

I'm sorry to hear that making your own variant list didn't work as thought! Likely my own fault, it's possible there's an earlier link in the chain that I overlooked. It sounds like GenericVariant also gets referenced somewhere, but it's that kind of backwards step that is hard to do when we don't know where that might occur. I'll make some edits to my comments to trim out the parts we know are redundant now, and if I ever find where variant lists need to go I'll come back and add that too


Crap it does affect the original object. I didn't think to check before uploading my object. I was just excited it worked. lol. Oh well I scanned the original tuning file for the key in order to swap it out for my custom one and can't find it. I tried. I'll mess around with it from time to time. Maybe eventually I'll figure it out.
Test Subject
#17 Old 23rd Sep 2023 at 3:31 PM Last edited by hockeystarlet : 23rd Sep 2023 at 11:57 PM.
I got the modded objects and the original object all working within the game without breaking each other. I never renamed the Interaction tunings. Oops. Also, no apologies needed about the variants. You gave me enough information to where I was able to figure out the issue through process of elimination. The variants don't seem to matter at the moment. If you figure out where that gets plugged in let me know. There is a possibility that I may eventually figure it out on my own. I have learned more from you in the past week then I have in 4 years of googling and posting to forums and never getting responses. Periodically I'd repost and then just walk away from trying to learn to mod. Tweaking this tuning file and getting it to work has made me a bit more ambitious. Having the toddler bed upgrade to a crib doesn't make much sense. I consider it a downgrade. Upgrading it to a single bed makes way more sense. However, I still want to keep the option of downgrading in the pie menu. Swapping out the object that gets spit out from a crib to bed is easy. Adding a downgrade option has me a little stumped though. As always, any advice is appreciated and thank you very much for the time you have taken to point me in the right direction.
Back to top