The latest update addressed the crashing issue that some of you have been experiencing, Click here to found out more!
November 27 - Everyone ready for the Friday Highlight? It's ready for you here.

Design Tool question re. custom object COBJ/OBJD IDs

@SimGuruModSquad / @SimGuruEugi : I don't know since when this is possible, but as of 1.4.83 (maybe earlier, I can't tell) it has turned out that the in-game design tool will only work on custom objects when the group ID of their catalogue instance and object definition (COBJ and OBJD) is 0x00000000 and the first half of the instance ID too. Otherwise, custom objects will throw a “Script Call Failed” error when trying to recolour them in-world.

This is probably not a good thing, since it makes ID collisions a lot more likely and you also said that all custom stuff should use a custom group ID and so on .. dunno, would this be a bug? Do you think you can do something about this on your side; or alternatively, do you think there's a chance of getting this to work on “regular” custom objects (with group 0x8000000 or whatever and 64bit IIDs) by way of a script mod, perhaps? I tried to look into the latter before but it went way over my head -- maybe someone like @scumbumbo could comment on the doability of that.
Stuff for TS2 · TS3 · TS4

Comments

  • ScumbumboScumbumbo Posts: 148 Member
    @pbox - I'd never seen that error before, so tried it in game with your notebook. At first glance that doesn't look like something generated by the Python scripting. It's not throwing an exception at all, so I'm not sure where exactly to look in the scripts to see what is going on. My guess is that it's being generated in the UI code, either the C code or the AS - I think probably this happens before it ever gets to Python, or possibly the UI is only throwing a 32-bit value to the Python and so it's forced to return an error back to the UI.

    In short, I'm just not sure where to look, and it's quite possible the bug is in C where it's completely inaccessible to us, or the AS which is only slightly more accessible.
  • pboxpbox Posts: 630 Member
    edited March 2015
    Thanks for chiming in =) -- the last time I looked into the design tool stuff is quite a while ago, so my memory is kind of fuzzy, but I do remember I thought I was able to track down the colour variant switching to something in /tuning, which prompted this post over at mts Create (I wasnt able to get that decompiled, and somebody uploaded it then and explained how they got it to work). This was prompted by having made catalogue objects like the "No-Drop" cabinets in this upload post which only consist of a custom COBJ and OBJD, everything else is Maxis, and they were still throwing those Script Failed errors when attempting to design tool them. I also got exceptions left and right when I broke those catalogue objects in various ways (mostly to do with the group and instance I think, since that also plays a role in getting the module selection to work), most or all involving /tuning/instance_manager.py.

    This was all in a much older game version though, I dont know whether that code is still the same and/or whether I'm even right about instance_manager.py having anything at all to do with the design tool. Just thought since you're a lot more Python literate, maybe you have poked at that issue before and would know more about it.
    Stuff for TS2 · TS3 · TS4
  • SimGuruModSquadSimGuruModSquad Posts: 597 SimGuru
    Hey guys, yes confirmed there is a problem here - I did not verify that it used to work but regardless it should be fixed. It's likely a problem on the C++ side. Will take a look as soon as I can, will keep you posted.
  • IngeJonesIngeJones Posts: 3,194 Member
    I don't think it's ever worked.
  • pboxpbox Posts: 630 Member
    edited March 2015
    Hey guys, yes confirmed there is a problem here - I did not verify that it used to work but regardless it should be fixed. It's likely a problem on the C++ side. Will take a look as soon as I can, will keep you posted.

    Awesome, thank you!

    ETA: just to clarify, by “as of 1.4.83” in my post above I didn’t mean to imply that this has worked differently in earlier games – only that I can’t tell, since I can’t roll back and custom objects were a relatively recent addition.
    Post edited by pbox on
    Stuff for TS2 · TS3 · TS4
  • _orangemittens__orangemittens_ Posts: 512 Member
    The design tool did not work with custom objects until Sims 4 Studio started to make clones that use the same group number and 32 bit instance numbers for the item's Object Definition and Object Catalog fields that EA objects have. Now that the mystery of why the design tool doesn't work for CC items is solved we're at your door asking for a better solution.
  • pboxpbox Posts: 630 Member
    Hey guys, yes confirmed there is a problem here - I did not verify that it used to work but regardless it should be fixed. It's likely a problem on the C++ side. Will take a look as soon as I can, will keep you posted.

    @SimGuruModSquad are there any news on this? It's slowly but surely getting a bit irritating to use older CC objects now, since one doesn't really expect that "Script Call Failed" thing any more .. OTOH changing the IDs would mean having to re-buy all the objects in game which is also not ideal. And the longer we keep using the short IDs the higher the likelyness of collisions ..
    Stuff for TS2 · TS3 · TS4
  • SimGuruModSquadSimGuruModSquad Posts: 597 SimGuru
    Ack! Sorry I totally forgot about this one, thanks for the reminder. I have determined the problem - should be relatively straightforward fix, although slightly more complicated that some of the other ones of this nature we've fixed. So may take a bit longer to get to you guys, will let you know when the fix is released.

    For my testing I just used this object, chosen somewhat randomly from MTS. If you have any specific content you'd like me to test with, feel free to point me at it.

    Thanks,
    SGMS
  • pboxpbox Posts: 630 Member
    edited June 2015
    Thanks for getting back!

    The object you linked to is one that seems to have been changed at some point to 32bit IDs -- is that what you need for testing? (Can't tell when you downloaded it) Or objects that are according to your specs (with group 0x80000000 and long IDs)?

    This might be interesting to test with: catalogue objects for kitchen cabinets/counters, the workingness of which (with the in-game model selection and all) also depends on the ID -- I don't remember the details exactly but I believe they needed to have a group ID of 0x00000000 in order to work. Might be good to check whether or not this kind of thing would work with 0x80000000 as well. The instance IDs of that are 64bit. (The "No-Drop" package is the interesting one.)

    This is also old, with group 0x80000000 and 64bit IDs. Or this or this or this.

    --

    A remaining problem might be that as long as the design-tooling goes by the MODL ID, people can still stick different objects in the same thumbnail and the design tool recolouring procedure will not be able to switch between them .. IDK; would it be possible to give them a somewhat more interesting failure message than "Script Call Failed"? Something along the lines of "You can only redesign between variants of the same item" .. ? (Or can this be made to work too, perhaps? I seem to recall that in the pre release CAS demo there were some pants in the same thumb that were actually a different mesh .. but then that's CAS, not objects.)
    Post edited by pbox on
    Stuff for TS2 · TS3 · TS4
  • pboxpbox Posts: 630 Member
    edited June 2015
    This may be related or may be more of a feature suggestion: it would be very cool if the design tool would work independently of how items are sorted in the catalogue.

    Right now it apparently goes by catalog thumbnail ID (and/or colour swatch entries as SGEugi states here), but that is sometimes a bit impractical: the catalogue would be a lot easier to manage if it were possible to give similar items the same ID and have them grouped together that way (like those four different wall-mounted wardrobe racks, or the oodles of collectibles that make debug mode a scrolling exercise), without getting Script Call Failed errors when the game attempts to design-tool between them even when they only have one material variant each (so there's nothing to design actually).

    Would it be possible to make this work like:

    - In the catalogue, show everything in the same thumb that has the same thumbnail ID and let the user select by clicking on the colour swatch (i.e. like it is now)

    - On an object in world, only activate the design tool when *this MODL* has more than one material variant, and have it switch between the variants regardless of what thumb ID they have -- when there is only one variant, show the "Design Tool Cannot be used on this object" hovertip instead

    ?

    Unless I'm overlooking something, that would seem quite logical .. and offer a lot more flexibility for CC creators and modders in regards to sorting stuff in the catalogue. The catalogue is already large by default, and when people download CC by the gigabyte on top of that, you can imagine that catalogue management becomes a bit of a concern .. right now the trend seems to be to give everything a separate thumb ID for no other reason than to avoid those Script Call Failed errors.

    (Maybe the above would be possible by way of a script mod? Not sure ..)
    Stuff for TS2 · TS3 · TS4
  • SimGuruModSquadSimGuruModSquad Posts: 597 SimGuru
    Hi guys, as of today's patch (v1.10.57) the design tool will work with CC that use the entire 64 bits of the instance. Hoping you guys can now move back to using the full instance as that is much safer long term to avoid collisions. lmk if it gives you any problems.

    @pbox - regarding your suggestion about changing the way the design tool determines how to populate itself. I'll take a look - if you have an example mod the exhibits the bad behavior that would help me more quickly identify what needs to change. Thanks.
  • pboxpbox Posts: 630 Member
    Cool, thank you!

    I'll take a look later and get you some examples of what I mean. TIA!
    Stuff for TS2 · TS3 · TS4
  • pboxpbox Posts: 630 Member
    edited August 2015
    OK, here are two examples:

    1. Lavender Shrubs (contained in this upload) -- these are hardly CC at all, the only thing custom is the COBJ/OBJD (they are Maxis World objects made available for Build/Buy):

    66601_150807191857lavenders.jpg

    Here I stuck 0x0000000000002C69 (“plantCEShrub_02”, MODL 0x4A0D8A548718EB05) and 0x000000000000BEFE (“plantGD_RBH_glade_shrub_01”, 0x48CF1B87C9B65AF7) into the same catalogue thumbnail (SwatchGrouping/PropertyID) as the base game “Lovely Lavender Bush” since their shape is nearly identical; they are only a bit bigger and have different colours. When trying to designtool between them, one gets “Script Call Failed” (in 1.10 too) -- far as I can tell this is because the MODL is different. I’d find it more intuitive if one could put very similar objects into the same catalogue thumbnail and have them behave like recolours in game .. or perhaps just get the “Design Tool Cannot be Used” error, instead of “Script Call Failed”.


    2. Kitchen counters (from here)

    Six recolours of the BlandCo counters/islands that are using the same “body” textures as the Maxis ones, only the top is different. Because they’re the same colours I also gave them the same SwatchGrouping as the existing ones; they have the same internal names for the material variants as well (set1, set2 etc). Here I do *not* get “Script Call Failed” (not before 1.10 either; those have short IDs), but the design tool still acts a little confusingly when switching between CC and Maxis:


    66602_150807194356counters1.jpg

    This is the default variant of the Maxis object


    66605_150807194626counters2.jpg

    When I select one of the custom variants, it’ll show the equivalent variant of the Maxis object instead, as long as the design tool is still active


    66606_150807194754counters3.jpg

    However, once I let go, it correctly displays the custom one


    It’s the same the other way around (i.e. when going from CC to Maxis object). It’s as if it didn’t know which “set3-materialVariant” I mean, but in the end it actually does.



    ETA: 3., here is another little test package I’ve just thrown together -- it’s one of your wall-mounted deco coat racks plus three variants of two of the other ones all in one catalogue entry (this is in Dressers, not deco, since it’s been made to work like a dresser). With 1.10 it now works fine to switch between the variants of each in-world, but not between the different racks of course (Script Call Failed) -- there’s nothing really “bad” about that, it’s just a bit inconsistent how in the catalogue, one can switch between all of them (different models too) but not once the object is in world.

    Also the error message could perhaps be something less scary? “Script Call Failed” really makes some people go “omg my game explodes” =/


    Post edited by pbox on
    Stuff for TS2 · TS3 · TS4
  • ScumbumboScumbumbo Posts: 148 Member
    edited August 2015
    Seems to still be a problem with 64-bit instances. At least for me if I use the high-bit it will fail to load the object throwing an exception:
    line 303, in _load_definition
    KeyError: "resource does not exist: '00000000!8dbb6d4e'f7429c80.c0db5ae7'"
    
    If I changed the instance ID to 0x0DBB6D4EF7429C80 it loaded up without issue.

    ETA: To clarify, the COBJ appears to load (object appears with red X in build/buy) but the OBJD fails to load.

    ETA 2.0: Pbox got me straightened out, it appears that using 0x80000000 for the group will restore sanity.
    Post edited by Scumbumbo on
  • IngeJonesIngeJones Posts: 3,194 Member
    Any internal cross-references that should also be changed?
  • ScumbumboScumbumbo Posts: 148 Member
    edited August 2015
    IngeJones wrote: »
    Any internal cross-references that should also be changed?
    Nope, just unsetting the high-bit of both the COBJ/OBJD instances fixed it so it loaded up and worked fine. When the high-bit was set, the COBJ loaded, but not the OBJD. I'm guessing somewhere the OBJD is being treated as a signed value and the high-bit ignored or thrown out.

    ETA: But when using group 0x80000000 it worked fine, thanks again @pbox
    Post edited by Scumbumbo on
  • pboxpbox Posts: 630 Member
    Scumbumbo wrote: »
    But when using group 0x80000000 it worked fine

    Ah that's good to know, thank you. I guess this means that most if not all of the existing older objects should work just fine -- I know that TSRW automatically set the groups to 0x80000000 and I assume other tools did the same thing, since that what it says in the specs. You probably only had this issue because you were manually fiddling with it =) but that is not something a lot of people do.

    Stuff for TS2 · TS3 · TS4
  • Number08Number08 Posts: 2 New Member
    I'm currently having the "Script Call Failed" error with Sunshine & Roses Quote Wall Art CC (I'd post a link, but I'm apparently not allowed as I haven't been around long enough). Any ideas on how to fix this or what the problem might be? @SimGuruModSquad
  • pboxpbox Posts: 630 Member
    With broken CC you should probably approach the creator.
    Stuff for TS2 · TS3 · TS4
  • _orangemittens__orangemittens_ Posts: 512 Member
    @Number08, prior to the community's ability to make custom objects that worked with the design tool, and prior to Studio's ability to add swatches to an object recolor, many creators were making multiple object .packages and merging them into a single catalog entry by changing all the .package prototype ID's so they were the same.

    Although it is nice to reduce catalog clutter by merging multiple similar items into the same catalog entry it also has the effect of making it so that the in-game design tool does not function correctly. Because no one could make CC that utilized the design tool anyway no one realized this so there is some amount of older CC, like this painting collection, out there that will not work correctly with the design tool.

    Probably the easiest way to fix it for your own game would be to clone the first .package as custom content, export the images out of all the other .packages, add swatches to the new clone, and import the images in on the new swatches. Unless you renumbered each swatch with the original instance number in the object catalog and object definition fields any instance of the original paintings you had in your game would be removed when you removed the original painting .packages and you would need to replace them with the new painting clone. Optimally, you would let the creator of this cute collection know there's a problem and that it isn't difficult to fix it...especially if you don't mind a compulsory replacement of missing paintings when the original set is removed from the Mods folder. :)
  • Number08Number08 Posts: 2 New Member
    edited January 2016
    @_orangemittens_ thank you for your help :smile:
  • _orangemittens__orangemittens_ Posts: 512 Member
    @Number08, you're welcome. If you decide to give this a try there is a tutorial HERE that shows how to clone custom content as a unique new .package that will not overwrite the original item in the game. If you run into questions please feel welcome to post them in the tutorial thread. :)
Sign In or Register to comment.
Return to top