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 Feb 2015 at 7:50 AM Last edited by plasticbox : 5th Feb 2015 at 12:00 PM. Reason: Added spoiler tags
Default Replace Sleep Animation by Nap Animation
Hey, it's me!

As the title says, I'd like to replace the Sleep animation by the Nap animation. I thought it would be very straightforward. But for some reason it doesn't work.

So, I'll post the bed_sleep interaction XML file content below. But first let me explain what I've tried already.

There's something called "canonical_animation" in this file and its number (11280) took me directly to the "Bed_Sleep_InteractionIdle_Idle" animation. So I figured if I changed that number to the "Bed_Nap_InteractionIdle_Idle" animation number it would work. Annnnddd... no. There are no other animations with "sleep" or "nap" in their names. Only Bathtub_Nap and so on. Nothing related to Sleep/Nap and Bed.

There's one mod here called "Friendlier Ask To Leave" by ReubenHood that replaces the Ask To Leave animation by the Goodbye (wave) animation. I checked what he did and it's similar. He changed the "animation_ref" number. As you'll see, there's one "animation_ref" in the Bed_Sleep interaction file too, but I see no animation reference numbers to change

This is the first part of the mod - replace the Sleep animation by the Nap animation. The second part will be creating a new pie menu to choose between sleeping with blanket (Sleep animation) or sleeping without blanket (Nap animation), but that's something for later.

So here's the bed_sleep interaction file content. I hope this helps:

Advertisement
Test Subject
Original Poster
#2 Old 5th Feb 2015 at 7:52 AM
How do I hide the code using that "spoiler" button or something? It's really long
Mad Poster
#3 Old 5th Feb 2015 at 9:34 AM
It's likely that you can't do it the way that mod was done, but could do this by swapping out the sleep clips in the Jazz file with the nap clips. The Jazz files can be found by looking in the XML folder called animation, the two files called Bed Nap and Bed Sleep have an Instance ID for the Jazz files (the StateMachine part). The Jazz files can be found in the SimulationFullBuild0 file.

The spoiler thing is done by typing it in before and after your text:
[spoiler]
And the ending one needs to be written /spoiler inside those brackets.

MedievalMods and Sims3mods: Dive Cave Reset Fix, Resort Revamp, Industrial Oven Revamp, Will O' Wisp fix, UI Sounds Disabled, No Cars, Gnome Family Planner, Townies Out on the Town, No Martial Arts Clothes, Fast Skilling, etc. http://simsasylum.com/tfm/
Pettifogging Legalist!
retired moderator
#4 Old 5th Feb 2015 at 11:59 AM
@MaximiliumM I amended your post for you, so 1. you can see how spoilers work and 2. everybody else won’t have to scroll so much. =)

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.
Deceased
#5 Old 5th Feb 2015 at 4:14 PM
Quote: Originally posted by MaximiliumM
As the title says, I'd like to replace the Sleep animation by the Nap animation. I thought it would be very straightforward. But for some reason it doesn't work.


I'm no animation expert at all, but I think the likely culprit is the _provided_posture_type which, to my limited understanding, controls the starting state of the animations. The sleep and nap interactions both reference a different posture type, and in those posture files a different animation state machine and animations are also referenced.

There are also two staging_content affordances referenced in the sleep interaction. I'm not sure what the disabled animation_ref has on those, perhaps that makes the animations in those not matter, not sure and don't have time to reference the tdesc files at the moment, but these thoughts might get you started.
Test Subject
Original Poster
#6 Old 5th Feb 2015 at 4:40 PM
Hmm! That posture thing I also tried changing it, but then the Sim couldn't even start the animation hehe.

Shimrod! Thanks. I'll try something with that when I have time today.

And thanks for fixing my post, plasticbox.
Test Subject
Original Poster
#7 Old 5th Feb 2015 at 7:06 PM
So, I did what Shimrod101 said: swapping out the sleep clips in the Jazz file with the nap clips. And it worked... kinda. The Sim still goes under the blanket (as a transition), then the blanket is gone when they're actually sleeping. Now I'm trying to understand why this transition is still happening and what I can do to fix it.
Mad Poster
#8 Old 6th Feb 2015 at 2:30 AM
There is a Jazz file named Bed_Undercovers_Posture which has some transition clips included. The ID on this file is 63FC366DE170xxxx.

MedievalMods and Sims3mods: Dive Cave Reset Fix, Resort Revamp, Industrial Oven Revamp, Will O' Wisp fix, UI Sounds Disabled, No Cars, Gnome Family Planner, Townies Out on the Town, No Martial Arts Clothes, Fast Skilling, etc. http://simsasylum.com/tfm/
Test Subject
Original Poster
#9 Old 6th Feb 2015 at 3:38 AM
Hey, Shimrod Thanks for pointing that out. I'm going to check that.

Today, while I was taking a shower to go to work, I actually thought about that - the blanket must have its own animation. So next time I had time to mess with it, I would try to find it. I think it might be easier to just remove the blanket animation and keep the Sleep animations intact, because there are many Sleep animations based on mood, it seems. If I'm able to just make the Sim transition to the Sleep Idle animation without using the blanket, it might be better.

Anyways, thanks for your information again. I'm going to look into it right now I'll keep posting my findings.
Test Subject
Original Poster
#10 Old 6th Feb 2015 at 4:14 AM
That's it. It works.

This is the transition animation: Bed_Sleep_Posture. And this is the same animation for Nap: Bed_Nap_Posture.

I swapped out the clips and now the Sim doesn't go under the blankets. But when they finish transitioning from Bed_Nap_Posture to Bed_Sleep_InteractionIdle, the blanket is over them, hehe. But that I had already solved. Now everything is working.

Next, create a new pie category to choose between sleeping with or without blankets
Test Subject
Original Poster
#11 Old 6th Feb 2015 at 5:51 AM
Here I am again.

I wasn't able to make my "No Blanket" option appears when selecting a bed

I tried using the injector method; I tried adding my new interaction ID directly to the super_affordance list; Nothing worked.

Do I need an associated SimData file to make the interaction appears? Because, as far as I understand, this interaction is not a pie menu category, but I might be wrong.
Deceased
#12 Old 6th Feb 2015 at 6:12 AM
Quote: Originally posted by MaximiliumM
Do I need an associated SimData file to make the interaction appears? Because, as far as I understand, this interaction is not a pie menu category, but I might be wrong.


Only the pie menu category (if you created a new one) would require a SimData file. I'm not sure how you're wanting to set it up, so basically if you're creating a new submenu "Sleep..." with selections "Covers" and "No Covers", then you would need a new pie menu category for the Sleep menu and the two interactions would point to that category. But if you're wanting to make where you just click on the bed object and there's a "Sleep No Covers" selection along with Sleep without a submenu choice, then you don't need a category.

In both cases, the interaction needs to be added to the SA list of the bed object, whether by injection or directly editing the object XML.

HTH!
Test Subject
Original Poster
#13 Old 6th Feb 2015 at 6:17 AM
Quote: Originally posted by scumbumbo
Only the pie menu category (if you created a new one) would require a SimData file. I'm not sure how you're wanting to set it up, so basically if you're creating a new submenu "Sleep..." with selections "Covers" and "No Covers", then you would need a new pie menu category for the Sleep menu and the two interactions would point to that category. But if you're wanting to make where you just click on the bed object and there's a "Sleep No Covers" selection along with Sleep without a submenu choice, then you don't need a category.

In both cases, the interaction needs to be added to the SA list of the bed object, whether by injection or directly editing the object XML.

HTH!


Thanks for clearing that out. I might try to create a new category later. But for now I just want it to appear along with the Sleep choice.

I added to the SA list of the bed object. I tried adding by injection and directly editing the object XML, none worked

This is the code for the interaction. It's exactly the same as the bed_sleep interaction, but different calls for Posture and Animation.
Deceased
#14 Old 6th Feb 2015 at 6:59 AM
Quote: Originally posted by MaximiliumM
This is the code for the interaction. It's exactly the same as the bed_sleep interaction, but different calls for Posture and Animation.


If you could attach a zip of your package file, with the string table and new posture type, that would be much easier to check out.

Also, check your lastException.txt file, sometimes some bad XML will trigger an exception in there that can help track down what the problem is.
Test Subject
Original Poster
#15 Old 6th Feb 2015 at 8:35 AM
Oh, sure.

I've attached my package. I've included the object XML in this one. But before publishing I wanna use the injection method.

Thanks :D
Attached files:
File Type: zip  MaximiliumM_NoBlanketMod_Package.zip (8.8 KB, 86 downloads) - View custom content
Deceased
#16 Old 6th Feb 2015 at 4:20 PM Last edited by scumbumbo : 7th Feb 2015 at 7:19 AM.
Quote: Originally posted by MaximiliumM
I've attached my package. I've included the object XML in this one. But before publishing I wanna use the injection method.


OK, I got the menu item to appear - you need to add the SA to all the beds. However, it doesn't appear to be working. The sim will get in a bed, under covers, lie there for a few sim minutes, then get back out of bed. Here's the variables I used for the SAs in script, might be easier to just use this than edit all the bed XML files:
Code:
beds_sa_instance_ids = (13719376076563101143, )
beds_object_ids = (14833, 14834, 36211, 36212, 36213, 36214, 36215, 36216, 36217, 36218, 36220, 36221, 36222, 36223, 36224, 36225, 36226, 36227, 36228, 38249, 38283, 77150, 77153, 77156)
My guess is that I got some of the wrong object ids in there though, as I'm seeing a weird error in my lastException.txt file that I'd never seen until I ran this referencing GetPut_Fridge_Get. I generated the list of object instance numbers pretty quick and dirty and typed them in from another window, but I did get at least the two beds that were on the that lot correct. No time to look further into it now as I gotta get to work, but hopefully this can help you out in the meantime.

EDIT: The GetPut_Fridge_Get exception I was seeing wasn't related to your package or wrong object IDs, it's a known fridge bug. Looks like I have to do a game repair from what I'm reading.
Test Subject
Original Poster
#17 Old 6th Feb 2015 at 4:34 PM
Quote: Originally posted by scumbumbo
OK, I got the menu item to appear - you need to add the SA to all the beds. However, it doesn't appear to be working. The sim will get in a bed, under covers, lie there for a few sim minutes, then get back out of bed. Here's the variables I used for the SAs in script, might be easier to just use this than edit all the bed XML files:
Code:
beds_sa_instance_ids = (13719376076563101143, )
beds_object_ids = (14833, 14834, 36211, 36212, 36213, 36214, 36215, 36216, 36217, 36218, 36220, 36221, 36222, 36223, 36224, 36225, 36226, 36227, 36228, 38249, 38283, 77150, 77153, 77156)
My guess is that I got some of the wrong object ids in there though, as I'm seeing a weird error in my lastException.txt file that I'd never seen until I ran this referencing GetPut_Fridge_Get. I generated the list of object instance numbers pretty quick and dirty and typed them in from another window, but I did get at least the two beds that were on the that lot correct. No time to look further into it now as I gotta get to work, but hopefully this can help you out in the meantime.


Hmm! Ok, thanks. I'll look into it.

The weird thing is: I did exactly what you did. I added the SA to all the beds, but using the injection method. One thing I got wrong though is I put one last comma after all beds IDs.

Like (14833, 14844,)

Maybe that's why it wasn't working.

I'm gonna try more later today. Thanks for now :D
Test Subject
Original Poster
#18 Old 7th Feb 2015 at 9:01 PM
Quote: Originally posted by scumbumbo
OK, I got the menu item to appear - you need to add the SA to all the beds. However, it doesn't appear to be working. The sim will get in a bed, under covers, lie there for a few sim minutes, then get back out of bed. Here's the variables I used for the SAs in script, might be easier to just use this than edit all the bed XML files:
Code:
beds_sa_instance_ids = (13719376076563101143, )
beds_object_ids = (14833, 14834, 36211, 36212, 36213, 36214, 36215, 36216, 36217, 36218, 36220, 36221, 36222, 36223, 36224, 36225, 36226, 36227, 36228, 38249, 38283, 77150, 77153, 77156)
My guess is that I got some of the wrong object ids in there though, as I'm seeing a weird error in my lastException.txt file that I'd never seen until I ran this referencing GetPut_Fridge_Get. I generated the list of object instance numbers pretty quick and dirty and typed them in from another window, but I did get at least the two beds that were on the that lot correct. No time to look further into it now as I gotta get to work, but hopefully this can help you out in the meantime.

EDIT: The GetPut_Fridge_Get exception I was seeing wasn't related to your package or wrong object IDs, it's a known fridge bug. Looks like I have to do a game repair from what I'm reading.


Hmm. I see.

Unfortunately I didn't have the time to try to fix my mod. Actually, I got sick and ended up in the hospital

But it's ok. I'll be back soon hehe.
Deceased
#19 Old 8th Feb 2015 at 3:53 AM
Quote: Originally posted by MaximiliumM
Unfortunately I didn't have the time to try to fix my mod. Actually, I got sick and ended up in the hospital

But it's ok. I'll be back soon hehe.


Oh my, hope you get well and back on your feet soon
Test Subject
Original Poster
#20 Old 28th Feb 2015 at 12:40 AM
So, I'm back. Sorry if you were worried. One week coming and going to the hospital and then I get laid off I'm still recovering from all that. Anyways...

About the mod! I was able to make the pie menu work, but as you said they lie there for a few seconds and then get up, haha. I'll check that now Also, the animation should be working

Thanks for your help :D
Test Subject
Original Poster
#21 Old 28th Feb 2015 at 1:39 AM Last edited by MaximiliumM : 28th Feb 2015 at 2:03 AM.
Ok... reporting.

I was unable to fix that issue And now I have to do some other stuff, so I will report everything I tried and I'll attach the current state of my mod so if you or anyone else want to play with it, I'd appreciate.

First, if I simply replace the animation clips of both Jazz files (Bed_Sleep_Posture and Bed_Sleep_InteractionIdle) and use the "Sleep" interaction, it works. But that's not what I want to do, right? So now I have another interaction called (for now) "No Blanket" when you click on a bed. This new interaction can't simply call the same Jazz files as "bed_sleep" interaction, so I created new Jazz files.

My first question is - Should I name this new interaction something else rather than "bed_sleep"? Right now, it's like this: n="bed_sleep_noBlanket"

Also, in this same file, there is this line: <T n="_affordance_key_override_for_autonomy">bed_sleep</T>. Should I change it here too?

Ok, next. The new animation and posture files. The animation is called "Bed_Sleep_InteractionIdle_Idle" and this is the file that calls one of the Jazz files. Let me post the full code of this one:

Code:
<?xml version="1.0" encoding="UTF-8"?>
<I c="AnimationElement" i="animation" m="interactions.utils.animation" n="Bed_SleepNoBlanket_InteractionIdle_Idle" s="11764788461978548158">
   <T n="asm_key" p="InGame\StateMachines\Bed_SleepNoBlanket_InteractionIdle.statemachine">02d5df13:00000000:8941e4667f143adb</T>
   <L n="begin_states">
      <T>Bed_SleepNoBlanket_InteractionIdle</T>
   </L>
   <T n="target_name">bedIKRef</T>
</I>


As you can see, I also changed the name here "Bed_Sleep_InteractionIdle_Idle" to "Bed_SleepNoBlanket_InteractionIdle_Idle". Should I really do that? The Jazz file is called from that "asm_key" line. So, here's my second question:

Should I really change that "p" from that line?

Also, there's the posture file that I created.

Code:
<?xml version="1.0" encoding="UTF-8"?>
<I c="Posture" i="posture" m="postures.posture" n="posture_BedSleepNoBlanket" s="13916760318181898376">
   <T n="_asm_key" p="InGame\StateMachines\Bed_SleepNoBlanket_Posture.statemachine">02d5df13:00000000:9528daf75d21b5f4</T>
   <T n="_enter_state_name">get_in</T>
   <T n="_state_name">Bed_SleepNoBlanket_Posture</T>
   <L n="_supported_postures">


As you can see, I also changed the "n" of this file.

Then we have the Jazz files.

Code:
<ASM name="Bed_SleepNoBlanket_InteractionIdle">

and
Code:
<ASM name="Bed_SleepNoBlanket_Posture">


I tried running the mod without any name modifications, only changing the IDs etc, but it had the same effect. The Sim would get in bed then get out after some seconds. Oh, and the using the sleep animation rather than the nap animation.

So what's the proper way of creating new Jazz files?
Attached files:
File Type: zip  MaximiliumM_NoBlanketMod_Script&Package.zip (9.9 KB, 59 downloads) - View custom content
Deceased
#22 Old 28th Feb 2015 at 3:15 AM
Quote: Originally posted by MaximiliumM
My first question is - Should I name this new interaction something else rather than "bed_sleep"? Right now, it's like this: n="bed_sleep_noBlanket"
The name should be unique, the "standard" is to use your authoring name in the name to try to make it as unique as possible, so I would use something like "MTS_Scumbumbo_bed_sleep_noBlanket" and then use that string to generate the 64-bit instance ID. That number is what is actually important, but using a good name will help you keep those numbers unique.
Quote: Originally posted by MaximiliumM
Also, in this same file, there is this line: <T n="_affordance_key_override_for_autonomy">bed_sleep</T>. Should I change it here too?
That string is used to help the autonomy routines know what's going on and should be kept the same. You can read the tuning description for interactions to see what all that affects, it describes it much better than I could.

As for the Jazz questions, I know diddly-squat about all that Jazz. Hopefully someone who knows their animation will chime in on that.
Test Subject
Original Poster
#23 Old 28th Feb 2015 at 3:50 AM
Oh, wait. Does the name have to be the same as the instance ID?

I mean, I called it "bed_sleep_noBlanket", but my instance ID was generated from some string like "maximiliumm:noblanketmod_posture" or something like that (I don't remember anymore, sorry )
Back to top