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
Top Secret Researcher
Original Poster
#1 Old 21st May 2011 at 7:08 PM
Default Assigning beds for certain ages?
Is there a way to make a bed for just a certain age? Like how the crib is just for babies/toddlers, can there be a crib just for babies and a crib just for toddlers? Or making the double beds just for adults? I've been looking through the files in S3PE but haven't had any luck.

Not sure if this counts as modding or not. :\
Advertisement
Field Researcher
#2 Old 21st May 2011 at 11:19 PM
You could have a look at the cribs coding in reflector. I guess it's in the scripting.
Top Secret Researcher
Original Poster
#3 Old 23rd May 2011 at 11:48 PM
So I'd have to make a script mod?
Field Researcher
#4 Old 24th May 2011 at 12:39 AM
Quote: Originally posted by claudiasharon
So I'd have to make a script mod?


Theoretically, yes, unless you do happen to find a XML file and that somehow works. Here's a line of code that I found in the Crib class.
Code:
 public static List<Sim> GetPossibleTargets(ref InteractionInstanceParameters parameters)
    {
        IGameObject target = parameters.Target;
        List<Sim> list = new List<Sim>();
        foreach (Sim sim in target.LotCurrent.GetSims())
        {
            if ((sim.SimDescription.ToddlerOrBelow && !(sim.Posture.Container is Crib)) && PickUpChild.Definition.CanPickUpBabyOrToddlerObjectInteraction(sim, ref parameters))
            {
                list.Add(sim);
            }
        }
        return list;
    }



Notice this line of code in particular:
Code:
sim.SimDescription.ToddlerOrBelow


It's basically saying that to load up the interactions if there are any sims that are Toddler or Below to put into a crib. If you would just want it for a newborn, then you'd have to change it to sim.SimDescription.Baby and also change any other occurrences from that.

So yes, the easiest way to do this would be a scripting mod. It wouldn't be that difficult, you'd just have to rework the code so C# doesn't give you any issues and a different class name and all that stuff. You'll then need to add in the objects and have them use that script. You'd have to do this for both babies and toddlers, though if you get one of the scripts complete the baby would simply be a Copy/Replace.
Test Subject
#5 Old 6th Jun 2011 at 5:43 AM
I was thinking about looking into this also, but I have an additional question. Would it be possible to assign cribs to a certain Baby/Toddler? Beds "learn" who their owners are, is it possible to force get that code to work on cribs as well?
1978 gallons of pancake batter
#6 Old 20th Jun 2011 at 6:44 PM
Quote: Originally posted by SJBequeath
I was thinking about looking into this also, but I have an additional question. Would it be possible to assign cribs to a certain Baby/Toddler? Beds "learn" who their owners are, is it possible to force get that code to work on cribs as well?
Possible, probably yes. But it would take quite a bit of time and effort, because you'd have to replace (script mod) or alter (core mod) all the related interactions.

If gotcha is all you’ve got, then you’ve got nothing. - Paul Krugman
Back to top