Forum Discussion

IngeJones's avatar
9 years ago

def get_objects_of_def_id_gen

Is the following function referring to the object Tuning IDs? And if so, please could you give me an example of use since the existing decompiled scripts don't seem to use it at all.

def get_objects_of_def_id_gen(self, *definition_ids):
for obj in self._objects.values():
while any(obj.definition.id == d_id for d_id in definition_ids):
yield obj

16 Replies

Replies have been turned off for this discussion
  • Well it would have to create_object of the one it returned (eg mine, or someone else's CC) not just a hardcoded value obviously, or it would defeat the object of the exercise. Of course the easier way all round would be for someone to volunteer to maintain the tuning file with the default bassinet list in it, and just update it every time someone lets them know they made a new CC bassinet! Why is this all so much harder than modding previous games? What sort of successes are you having with the new way?
  • "IngeJones;15209648" wrote:
    Well it would have to create_object of the one it returned (eg mine, or someone else's CC) not just a hardcoded value obviously, or it would defeat the object of the exercise. Of course the easier way all round would be for someone to volunteer to maintain the tuning file with the default bassinet list in it, and just update it every time someone lets them know they made a new CC bassinet! Why is this all so much harder than modding previous games? What sort of successes are you having with the new way?


    It's replacing the bassinet object which you're selecting from the object array, then assigning the baby to the new one and placing it at the location of the first, so you'll have to create a corresponding definition of class 'object_Baby' - you may have done this already and I assumed that you were working with a single instance. For example, Empty Bassinet 23208 is replaced with object_Baby 20988, Empty Bassinet 57771 is replaced with object_Baby 57770, etc, therefore you'll have to create both instances or just migrate the baby to a custom instance and destroy the default when the function is called.

    bassinet_definition = BabyTuning.get_corresponding_definition(bassinet.definition)
    new_bassinet = create_object(bassinet_definition, obj_id=sim_info.sim_id)

    With regard to success, I believe that editing of tuning is a waste of time for any reason other than to add new objects since the entire set of core functions and all data/object instances are fully accessible through the provided interface. Editing of text data and XML for extension of boundaries and interfaces is undesirable when I can create commands and controls for live tuning and instantiate sub-interfaces with custom parameters. If you want values or configurations to remain persistent then you can create an initialization routine which will likely never fail as the result of patching.
  • Are you telling me that a baby is actually a baby-and-bassinet shaped object, and the empty bassinet is a different object? OMG no wonder I am mixed up! When you clone a bassinet using TSRW, the baby is standing underneath it. I thought it was all included.
  • "IngeJones;15210827" wrote:
    Are you telling me that a baby is actually a baby-and-bassinet shaped object, and the empty bassinet is a different object? OMG no wonder I am mixed up! When you clone a bassinet using TSRW, the baby is standing underneath it. I thought it was all included.


    If you create a bassinet of class object_Baby then you should be able to assign the baby to it by setting the sim_info when the baby arrives without having to replace an empty one - it's more like a bassinet-shaped-counter with a baby slot and sim_info. If you don't want to create an empty instance then you'll have to search the zone for your custom instances and verify that one is available with every new arrival.
  • SimGuruEugi's avatar
    SimGuruEugi
    Icon for EA Staff (Retired) rankEA Staff (Retired)
    9 years ago
    Seems like @Forest_Ninja has this covered. Are there more pending questions from this thread?
  • Well it's not working, I guess there was more to the whole process than I anticipated. I don't think it's doable with current object creation tools, and the code is probably too complex for me anyway. So I will wrap up this project with a request for some future patch to allow custom bassinets to be used for babies :D

About The Sims 4 Mods & Custom Content

Find expert tips, troubleshooting help, tutorials for mods and custom content, and The Sims 4 patch files in our forum.15,596 PostsLatest Activity: 7 days ago