Replies: 48 (Who?), Viewed: 1867 times.
Page 1 of 2
Lab Assistant
Original Poster
#1 Old 13th Dec 2020 at 1:49 AM Last edited by lizcandor : 13th Dec 2020 at 2:27 AM.
Default Toddler mobility
I'm slowly (as in, still-doing-the-tutorials slowly) branching out into animations as I try to make the early life stages less boring and burdensome to deal with, and I was wondering if anyone knows how far previous attempts to make toddlers climb stairs or let themselves out of cribs got? Those two restrictions on their mobility really just drive me nuts, I can't stand them, so I want to take a crack at that as a learning experience if nothing else; I know it's been attempted before with no luck, though, so I'm curious if that's because there's some insurmountable obstacle you run into if you go far enough.

For stairs at least, it seems like it's all the way in StairsPortalComponent.OnPortalStart that toddlers, puppies, and kittens get excluded, so I can see how there might be an issue.
Advertisement
Field Researcher
#2 Old 13th Dec 2020 at 2:25 AM
I know that @TheSweetToddler had managed to create animations to make toddler-sized sims use child-sized Generations EP slide (https://sims.fandom.com/wiki/Slide). I don't know of anyone who attempted or remotely succeeded to liberate toddlers stuck downstairs / upstairs and in high chairs, but I know a ton of TS3 players who'd rejoice if that was *finally* unlocked.
Lab Assistant
Original Poster
#3 Old 13th Dec 2020 at 2:36 AM Last edited by lizcandor : 13th Dec 2020 at 2:57 AM.
Hmmm, I will check that out!

At the moment my theory is that the ultimate reason toddlers can't use stairs may be just this tiny piece of code in Sims3.Gameplay.Core.Stairs.StairsPortalComponent.OnPortalStart, and if that turns out to be true I'm gonna be mad I don't know how I could change this but I will try
Code:
if (s.SimDescription.Age == CASAgeGenderFlags.Toddler || s.IsPuppy || s.IsKitten)
{
	FreeRoutingLane(s);
	return false;
}

Edit: I have found what I think may be a replaceable reference to the Stairs class: there's an object called StairHelper in FullBuild0 that's linked to it. If I put a custom class in the Sims3.Gameplay.Core namespace like you do for Sims3.Gameplay.Objects to do a default replacement of an object, could it work? I am about to find out
Test Subject
#4 Old 13th Dec 2020 at 8:44 AM
Quote:
Originally Posted by lizcandor
Hmmm, I will check that out!

At the moment my theory is that the ultimate reason toddlers can't use stairs may be just this tiny piece of code in Sims3.Gameplay.Core.Stairs.StairsPortalComponent.OnPortalStart, and if that turns out to be true I'm gonna be mad I don't know how I could change this but I will try
Code:
if (s.SimDescription.Age == CASAgeGenderFlags.Toddler || s.IsPuppy || s.IsKitten)
{
	FreeRoutingLane(s);
	return false;
}

Edit: I have found what I think may be a replaceable reference to the Stairs class: there's an object called StairHelper in FullBuild0 that's linked to it. If I put a custom class in the Sims3.Gameplay.Core namespace like you do for Sims3.Gameplay.Objects to do a default replacement of an object, could it work? I am about to find out

Wow, this is near perfect timing for what I was working on. I looked into the toddler stair animations for the Sims 4 to see if they could be converted, but it doesn't look like they can (though I'll do some more testing just to be sure).

However, adding on to what MissPat said, there was a brief discussion about toddler stair animations with The SweetToddler on MissyHissy's Job Centre discord recently and she mentioned that she had made some, but that to implement them it would require core modding. That seems to be in line with what you found in the code. I'm not sure if she's still actively creating, but it wouldn't hurt to reach out and see what info she may have on this.
Forum Resident
#5 Old 13th Dec 2020 at 2:02 PM
I did attempt to make this possible a couple years back, which it certainly is, but it requires a lot more coding stuff than I initially thought. About the animations, I think they'd work out by just giving them the same name as any other stairs animation if I'm not mistaken, but the only problem that we could encounter is the IK targets, which are basically markers for the position of the hands and feet, as well as the root. If they don't work out, the toddler might end up going nowhere during the animation, but when the animation finishes they teleport to where the route marker is on the stairs. I haven't had much success yet with IK on custom animations, but they have worked alright with EA ones (i.e. converted animations).

Anyways, if someone does manage to make toddlers able to climb stairs, I would probably like to help out with the animations, if school doesn't get in the way though.

- When one gets inspired by the other, the one inspires another - Anything is Possible.

My Discord server (mainly Sims but other games are welcome too) ---> https://discord.gg/tvrTafF
You can download a lot of my custom animations (for TS3) on my Twitter ---> https://twitter.com/SweetSavanita
Lab Assistant
Original Poster
#6 Old 13th Dec 2020 at 3:17 PM Last edited by lizcandor : 13th Dec 2020 at 4:37 PM.
Thanks for the information! That you were able to get them to traverse the stairs at all is awesome even though they didn't do the animation correctly - was it by editing the Stairs class that you did that?

Edit: Some encouraging news, for the record - doing a default replacement of the StairHelper object, with its OBJK now referring to a custom class placed in the Sims3.Gameplay.Core namespace, is doing something! Not the correct thing, but something. I made some changes to the Stairs class and now the "Use Stairs" interaction is available to toddlers on newly-placed staircases; the toddler resets when they try to actually do the Use Stairs interaction, but it generates a script error to read, so I'm checking that out.

Edit 2: Previous error is fixed! Toddler now walks up the stairs (stretched). You still can't use Go Here on levels of a house where the toddler isn't currently located, so that must be blocked somewhere else, but I think this is a decent start.
Field Researcher
#7 Old 13th Dec 2020 at 8:52 PM
Quote:
Originally Posted by lizcandor
Edit 2: Previous error is fixed! Toddler now walks up the stairs (stretched). You still can't use Go Here on levels of a house where the toddler isn't currently located, so that must be blocked somewhere else, but I think this is a decent start.


Wow, I'm hoarding pop corn for this thread, this is so exciting!
Lab Assistant
Original Poster
#8 Old 13th Dec 2020 at 9:02 PM Last edited by lizcandor : 14th Dec 2020 at 1:48 AM.
A toddler stretched to do an adult animation is a pretty frightening sight New problem is that no one is able to complete the stair ascent action and move along once they're done, now - sims go up, get off the stairs, get into their idle posture, and then just stand there with whatever interaction they were doing stuck in their queue. From what I can tell, I think what that means is that PortalComponent.OnPortalCompleted isn't getting called, so I'm trying to figure out why that is.

Edit: It seems like OnPortalCompleted isn't called because OnPortalStart never finishes, and OnPortalStart never finishes because the first while loop never stops. I'm not sure why that would be, though, since that loop is the same as in the normal Stairs class and there isn't any problem there?

Edit 2: I gave up on figuring out why the code being written that way works for normal Stairs, and just told the while loop to break if PushSims returns true; with that, the problem is solved and this works fine except for the stretchy animations. Would definitely like to know if anyone else has some idea of why that while loop is written the way it is, though. That's all from me for this week!
Screenshots
Virtual gardener
staff: administrator
#9 Old 14th Dec 2020 at 12:34 PM Last edited by Lyralei : 16th Dec 2020 at 12:23 PM. Reason: Fixing the weird commenting
Quote:
Originally Posted by lizcandor
A toddler stretched to do an adult animation is a pretty frightening sight New problem is that no one is able to complete the stair ascent action and move along once they're done, now - sims go up, get off the stairs, get into their idle posture, and then just stand there with whatever interaction they were doing stuck in their queue. From what I can tell, I think what that means is that PortalComponent.OnPortalCompleted isn't getting called, so I'm trying to figure out why that is.

Edit: It seems like OnPortalCompleted isn't called because OnPortalStart never finishes, and OnPortalStart never finishes because the first while loop never stops. I'm not sure why that would be, though, since that loop is the same as in the normal Stairs class and there isn't any problem there?

Edit 2: I gave up on figuring out why the code being written that way works for normal Stairs, and just told the while loop to break if PushSims returns true; with that, the problem is solved and this works fine except for the stretchy animations. Would definitely like to know if anyone else has some idea of why that while loop is written the way it is, though. That's all from me for this week!
It seems that the Push Sims code is actually what it needs anyway if you look at the 'Stairs' code

(here's a small snippet)
Code:
                         try
                        {
                     // If mbSleeping is true, then do this while. This seems to be already hardcoded in, so i wouldn't worry about this one
                            while (activeUserEntry.mbSleeping)
                            {
                        // IIRC this makes it so that the task is asleep for 10 ticks? (Hence why the sims wait for 10 seconds to use the stairs )
                                Simulator.Sleep(10u);
                        // Get end slot for sims to be at once they finish using the stairs. the () entries are basically for where it animates to from the looks of it. But not sure.
                                List<Sim> list = new List<Sim>(Sims3.Gameplay.Queries.GetObjects<Sim>(positionOfSlot2, 0.6f));
                        // If there are stairs & Sims 
                                if (list.Count > 0)
                                {
                                    int num = 0;
                           // While there are still sims left that want to use the stairs
                                    while (num < list.Count)
                                    {
                              
                                        Sim sim = list[num];
                              // Send the sim to the stairs!
                                        if (sim == s || RoutingComponent.GetPushRelevantInteractionForSim(sim) != null)
                                        {   
                           //   Remove the sim from the 'list of sims that need to use the stairs' so the while can check again whether it's good to go or not
                                            list.RemoveAt(num);
                                        }
                                        else
                                        {
                              // Add another sim to the list of sims that need to use the stairs
                                            num++;
                                        }
                                    }
                        // When that's done, push all sims on doing so. (true would indicate that they needed to wait)
                                    s.RoutingComponent.PushSims(list, false); 
                                }
                            }
                        }
Regards to the stretchy animations, that does require some Jazz scripting and making custom animations for that  

https://www.youtube.com/watch?v=EmHLZa3GxWE
https://modthesims.info/showthread.php?t=642029
Lab Assistant
Original Poster
#10 Old 14th Dec 2020 at 2:15 PM
Wow, thanks! So maybe what I need to do next weekend to check if adding a break to the while loop was actually a good solution is to test what happens when there are multiple sims trying to use the same staircase, not just one.

And then...jazz scripts (shivers)
Virtual gardener
staff: administrator
#11 Old 16th Dec 2020 at 12:22 PM
Quote:
Originally Posted by lizcandor
Wow, thanks! So maybe what I need to do next weekend to check if adding a break to the while loop was actually a good solution is to test what happens when there are multiple sims trying to use the same staircase, not just one.

And then...jazz scripts (shivers)
I used to absolutely avoid Jazz scripts like the plague, so I totally get what you mean lol. But in your case it's really super duper easy. Just get the Jazz script for the stairs, copy paste all that and replace the statemachine name to yours, add the toddler age to the jazz script, add the animation resource key and voila! 

Now, I do get if you're super new to it, you might be getting nervous already lol but, that's what we're here for! :D Just @ me if you ever need some help on the jazz script, because I do like the idea of toddlers being able to actually use the stairs!
Lab Assistant
Original Poster
#12 Old 16th Dec 2020 at 1:58 PM
Oh, that does sound straightforward! I might be able to not mess that up, we'll see. I'll definitely ask you for help if I get myself turned around, thank you!
Lab Assistant
Original Poster
#13 Old 20th Dec 2020 at 6:26 AM Last edited by lizcandor : 21st Dec 2020 at 2:34 AM.
I wasn't able to find a jazz script for the stairs, but I did find the LocomotionConfig XML in JazzData! It has a definition for the "WalkStairs" walkstyle that Stairs refers to, and the walkstyle refers to a bunch of stairs-related animations; so I added a field for the toddler age stage and put just some quick child-to-toddler conversions of the normal stairs animations (there are so many different ones, I never realized) in it. Not the most realistic-looking solution in several ways, but it gets the job done without disturbing taffy limbs! I'm excited, this is the first time I've gotten a converted animation to not do the weird floaty thing :D

@TheSweetToddler, if you're still willing to share the work you've done on this just let me know! Totally cool if you're busy though, I can relate. For now I'm going to see if I can find where toddlers are blocked from interacting with anything not on their current level of the lot; the most problematic consequence of that (or I think that's the cause, at least) is that toddlers can go up stairs but not down, which I think is because the staircase belongs to the floor where its foot is, so once it's been climbed it's unusable just like everything else on that floor.

Would also be nice to find a non-XML-coding way to edit the walkstyles in LocomotionConfig, it seems like there's a lot of cool stuff that could be done there so avoiding conflicts would be good.

Edit: I think I've found why toddlers can't interact with objects on different levels, in InteractionDefinitionUtilities.CommonTests; might be able to unlock at least the use stairs interaction by specifying a special age case test for the interaction that isn't DisallowIfTargetIsOnDifferentLevel.

Edit 2: Yes, that was it! Just have to make the interaction definition implement the IOverridesAgeTests interface and then override GetSpecialCaseAgeTests() to have whatever special age case (potentially none) you want, instead of Standard (which seems to include blocking toddlers from interacting with objects on different levels). And now I'm done for a while again
Screenshots
Field Researcher
#14 Old 21st Dec 2020 at 2:02 PM
Toddlers walking up and down the stairs in TS3... Wow. This has to be one of the most exciting news of 2020 for our community, thank you for all your testing and tweaking @lizcandor!
Virtual gardener
staff: administrator
#15 Old 21st Dec 2020 at 7:51 PM
Quote:
Originally Posted by lizcandor
I wasn't able to find a jazz script for the stairs, but I did find the LocomotionConfig XML in JazzData! It has a definition for the "WalkStairs" walkstyle that Stairs refers to, and the walkstyle refers to a bunch of stairs-related animations; so I added a field for the toddler age stage and put just some quick child-to-toddler conversions of the normal stairs animations (there are so many different ones, I never realized) in it. Not the most realistic-looking solution in several ways, but it gets the job done without disturbing taffy limbs! I'm excited, this is the first time I've gotten a converted animation to not do the weird floaty thing :D

@TheSweetToddler, if you're still willing to share the work you've done on this just let me know! Totally cool if you're busy though, I can relate. For now I'm going to see if I can find where toddlers are blocked from interacting with anything not on their current level of the lot; the most problematic consequence of that (or I think that's the cause, at least) is that toddlers can go up stairs but not down, which I think is because the staircase belongs to the floor where its foot is, so once it's been climbed it's unusable just like everything else on that floor.

Would also be nice to find a non-XML-coding way to edit the walkstyles in LocomotionConfig, it seems like there's a lot of cool stuff that could be done there so avoiding conflicts would be good.

Edit: I think I've found why toddlers can't interact with objects on different levels, in InteractionDefinitionUtilities.CommonTests; might be able to unlock at least the use stairs interaction by specifying a special age case test for the interaction that isn't DisallowIfTargetIsOnDifferentLevel.

Edit 2: Yes, that was it! Just have to make the interaction definition implement the IOverridesAgeTests interface and then override GetSpecialCaseAgeTests() to have whatever special age case (potentially none) you want, instead of Standard (which seems to include blocking toddlers from interacting with objects on different levels). And now I'm done for a while again
Not surprising that there is this age restriction! This is also the reason why toddlers tend to just stay in front of the staircase when they want something downstairs. Because the touting code says they can, but obviously they can't :p 

Good to hear you're getting somewhere though!
Lab Assistant
Original Poster
#16 Old 21st Dec 2020 at 10:14 PM
Quote:
Originally Posted by Lyralei
toddlers tend to just stay in front of the staircase when they want something downstairs

Does this mean using stairs should get incorporated into toddlers' normal routing now, without having to click on the staircase first? I could try replacing Go Here with a de-age-restricted version to check - I feel like that might not work well with NRaas GoHere, but I'll try it next time just to see!

If that works, what would be really cool is if I could edit the SpecialCaseAge enum so that Standard doesn't include DisallowIfTargetIsOnDifferentLevel anymore, that way toddlers would be free to just go anywhere and use anything without having to individually replace every interaction they might want to do with an IOverridesAgeTest version. Editing existing entries of an enum might be a little too invasive though.
Virtual gardener
staff: administrator
#17 Old 23rd Dec 2020 at 1:37 PM
Quote:
Originally Posted by lizcandor
Does this mean using stairs should get incorporated into toddlers' normal routing now, without having to click on the staircase first? I could try replacing Go Here with a de-age-restricted version to check - I feel like that might not work well with NRaas GoHere, but I'll try it next time just to see!

If that works, what would be really cool is if I could edit the SpecialCaseAge enum so that Standard doesn't include DisallowIfTargetIsOnDifferentLevel anymore, that way toddlers would be free to just go anywhere and use anything without having to individually replace every interaction they might want to do with an IOverridesAgeTest version. Editing existing entries of an enum might be a little too invasive though.
Hrmmm well editing enums, unfortunately, won't be possible (Unless you're turning this into a core-mod ) But overall i don't think you'll have to do the 'DisallowIfTargetsIsOnDifferentLevel thing. What you might be able to do is override the current interaction with a custom one. Even if that means you're literally copy pasting the interaction, just for the sake of removing that check

Kindly stolen from Zoe, but here is an example for that:

Code:
private static void OnPreload()
        {
            WashHands.Singleton = new CustomWashHands.Definition();
        }
And then CustomWashHands, in this case, would look like a regular EA interaction as you'd always program them
Lab Assistant
Original Poster
#18 Old 23rd Dec 2020 at 2:38 PM
Aw, darn. Makes sense though!

In that case I'll go with individually replacing them - I was just wondering if I could avoid copy and pasting every single toddler interaction, they have so many toys they can play with But that's not worth making a core mod for.
Lab Assistant
Original Poster
#19 Old 2nd Apr 2021 at 12:42 AM Last edited by lizcandor : 2nd Apr 2021 at 1:56 AM.
A small update on this: I've been working on more realistic-looking animations than the child-to-toddler conversion I started with, and they're definitely not good yet (there's a lot of clipping I still need to fix, not an IK chain issue just me being bad at Blender), but they're playing at the times and in the places they should be! No teleporting up the stairs. I'm not using IK chains at all so far - that was originally unintentional, but it seems to be working, so I haven't tried to change it.

Edit: Aaaand I spoke too soon, changing the root offset in Blender did nothing and then adding the IK chains from the original animation back in also did nothing. It seems like the feet are following a track aligned to the bottom of the staircase, if that makes sense? I'm not sure how to describe it well.

Edit to the edit: No, I was right the first time, just learned a thing about Blender. All fixed and looking good!
Field Researcher
#20 Old 2nd Apr 2021 at 2:49 AM
Still excited about this thread! Going to tag @TheSweetSimmer see if maybe she has "toddlers walking up the stairs" animations ready to go on Blender? Fingers crossed. WE NEED TODDLERS WALKING UPSTAIRS. Sorry, I couldn't help screaming it.
Lab Assistant
Original Poster
#21 Old 2nd Apr 2021 at 5:22 PM
It's happening! For now, the plan is to have toddlers that can walk climb/descend by planting both feet on each step before moving to the next one (climbing up like that is the part that's currently working; I'd add a gif if I knew how, but I've never made a gif in my life), and toddlers that can't walk crawl on all fours going up and...I guess scoot over the edge and sit on each step going down? I don't know if it's actually realistic for toddlers that can't walk to still be able to use stairs, it seems like it might take too much arm strength, but I'm doing it anyway because having to wake someone up to carry them is just too annoying.

I think going down is going to be harder to animate, in both cases; I've used the toddler walking animation as a base for going up, since all I need to do to it is make them lift their feet higher, but I don't know where I'd find anything like what I'm imagining for going down. So that might be more from-scratch.

Will probably have more updates tonight/over the weekend, I'll be back!
Field Researcher
#22 Old 2nd Apr 2021 at 5:40 PM
Quote:
because having to wake someone up to carry them is just too annoying


Especially for the person who has to wake up, haha!

As for gif, I'd say create a video of your animation, then if you're on Windows you could use the "File converter" software here which adds a "convert file" right-click menu item on files, and turn your mp4 video into a .gif image. Then you could host the .gif on imgur or wherever cool people host their stuff these days (I do it at postimage.org myself): https://file-converter.org.

If you're not on Windows, there are a bunch of websites to convert your mp4 file into a .gif out there.

Can't wait to hear & see more! Thanks for making this dream happen lizcandor!

EDIT: a lot of us will not mind clipping issues for toddlers going up & down stairs! We just want them to do it on their own, haha.
Forum Resident
#23 Old 2nd Apr 2021 at 7:37 PM
I actually have created a few animations of toddlers using the stairs, but they're pretty old and I could make better ones now, but like I said before, we could encounter the problem of them staying in the same location because making new locomotion animations is actually a lot harder than people think. I'll start off by making an animation of them going down and adding the IK targets and I'll send it here to add to the mod and we'll see how it goes

- When one gets inspired by the other, the one inspires another - Anything is Possible.

My Discord server (mainly Sims but other games are welcome too) ---> https://discord.gg/tvrTafF
You can download a lot of my custom animations (for TS3) on my Twitter ---> https://twitter.com/SweetSavanita
Lab Assistant
Original Poster
#24 Old 3rd Apr 2021 at 12:45 AM
Made a gif! Thanks for the tip @MissPat, I have so much power now. The problems here (clipping, elevation jumps, floating in the air a little on the first step) are all problems with the animation itself, not the code, so that's what I'm fixing in Blender next.


@TheSweetSimmer That sounds great, thanks for the help! As you can see, I barely know what I'm doing No rush of course; the animations in your mods are excellent and I'd happily use anything you want to share, but I can substitute them in whenever you have time to make them, even if it's after I submit the mod's initial form.

I think it'll work without the IK chains if that's any easier to do - the problem I had the other day turned out to be unrelated, I'm still not using IK chains for any of the descent animations I converted (I added them to the ascent animations but it didn't make a difference) and those play like this:
Instructor
#25 Old 3rd Apr 2021 at 3:52 AM
This is a threadjack, but would you be able to tell me what an IK chain is and how I might learn more about them?

I haven't given up on cat fish catching with the proper fish models, but the easy thing isn't working so far....

Echo Weaver's Simblr: http://echoweaver.tumblr.com/
A portrait in stubbornness - Playing the same legacy since 2009
Sample a Brave Legacy: http://sims3sample.illation.net
Page 1 of 2
Back to top