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
Test Subject
Original Poster
#1 Old 15th Jan 2015 at 5:30 AM
Changing Environment / Hygiene / Comfort Values of Objects with Tuning
I have been jumping all over the internet for three days trying to figure out how to alter the scores for objects, as well as add things - such as an environment rating for an object that has none.

I tried changing the catalog scores in Sims Studio *and was thrilled at how easy that was* but the changes are only cosmetic.

Over at their tutorials page they suggested I copy the 'Tuning' and 'Tuning ID' from an object that had the scores I desired (such as a bed) to the object I wanted to modify; however there aren't many objects that possess the same buffs that I desire - specifically an environment rating - as well as all the other buffs I desire.

So, this led me to the belief that I would have to create custom tuning XML's for each object that I wanted custom values for ie: BED, COUCH, SHOWER, SINK, PIANO etc...

I have been attempting to create one item - a toilet - that has full stats, costs 25,000 and and environment rating of 5, I created my own XML in "Tuning Tools" (copying another toilet one) made a unique name (object_toiletTac02) and got a number from tuning tools (64824826) as well as creating a unique 32bit hash code for the instance - then added / modified the multipliers for the various buffs and saved it in "Notepad ++" - then packaged it with "S4PE" (uncompressed, replace).

In "Sims Studio" I cloned my desired object and changed it's tuning id's and numbers to my new ones, changed the price and desciption then saved.

Everything went into the mods folder.

Upon loading (and having $25000) i tried to place my object but got "SCRIPT CALL FAILED" - kept my money though.

What am I yet to do - What haven't I done - What?

Am I even going about this the right way - creating my own "buff" to add to an object?
Advertisement
Pettifogging Legalist!
retired moderator
#2 Old 15th Jan 2015 at 11:32 AM Last edited by plasticbox : 15th Jan 2015 at 3:01 PM.
Just in general, I'd suggest you split this up in two steps: first create your object with unchanged tuning, and make sure it works in game without errors, and once you've tested that add in your modified tuning. Also, a useful trick to test tuning for objects would be to temporarily override the tuning of an original Maxis object -- that way you can be sure the object as such will work properly (so errors with the object won't get in the way of your testing).

I'd also advise against copying the entire object tuning of some other object (except when you really want every aspect of it to be identical), since that can have rather a lot of undesired side effects. The object tuning governs a LOT of stuff -- interactions, placement, routing, animations, everything ... and when you don't know that structure very well, it can be really hairy to track errors with that. Most of the time it will be much simpler for you to copy the *original* tuning and change that, because then you know exactly what you changed.


--

Environment score is in the OBJD though, not in the object tuning. I'd recommend using s4pe for this kind of thing since that field is clearly labeled "PositiveEnvironmentScore" in that. If you don't change anything else about the object (mesh, texture) a COBJ and OBJD with a new instance is enough for that to work, there's no need to clone it at all (see my No-Drop Cabinets or the Readable Books for an example of this). Or of course you can make it an override (i.e. COBJ/OBJD with the original instance) if what you want to do is change the stats of existing objects.

Other than that, not sure what could be wrong with your code -- you'd need to attach it, from your description I can't tell what you did exactly. But try just modifying the environment score (both in the OBJD, this is the actual score, and the COBJ, this is for the text to show in the catalog entry) and see if that works.


ETA -- off the top of my head I'm not sure whether you can add e.g. the PositiveEnvironmentScore field in s4pe when it doesn't already exist, but what you can always do is copy and paste an OBJD from an object that has one, and copy and paste your ID, name, and TGIBlockList into that (so the result is effectively a copy with one additional field). The TGIBlock is usually only five entries long (except with "manifold" objects like cabinets) so that shouldn't be too much hassle. You can run two (or more) instances of s4pe in parallel to make the copy-pasting easier.

--

ETA2: some other aspects (like how fun it is to use an object) can be in the interactions, too -- those are not static values like environment score. Look in the SuperAffordances list of your object tuning for the list of available interactions.

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.
Test Subject
Original Poster
#3 Old 16th Jan 2015 at 4:05 AM
Default Update - Nearly there...
Quote: Originally posted by plasticbox
Just in general, I'd suggest you split this up in two steps: first create your object with unchanged tuning, and make sure it works in game without errors, and once you've tested that add in your modified tuning. Also, a useful trick to test tuning for objects would be to temporarily override the tuning of an original Maxis object -- that way you can be sure the object as such will work properly (so errors with the object won't get in the way of your testing).


I've gotten everything working using an override tuning file -

(took me ages to figure out how to edit stuff in s4pe (Hit the "GRID" button on the bottom if you're as confused as I was))

- and the edits you suggested for the .objd files coupled with my basic XML skill allowed me to create an entire set of furniture that had positive environment scores and other buffs along with interactions.... *admiring a toilet?!*

(again, took me ages to figure out how to make things unbreakable)

However, as soon as I changed the "n" and "s" values in the XML (Instance & ID) to make the effects unique to my objects; I got the "SCRIPT CALL FAILED" error again.

I might not be "setting the top bit to '1'" properly - because I have no idea what that means - google says the most important bit is the left-most bit so I changed that to '1' ie: 0x13ADA5... in the instance name - which I got s4pe to generate with the 64bit hash.

The tuning ID though - I've been going through the 64824820 - 64824850 range and I'm not sure if it's too high or not, plus it's decimal in the XML but hexadecimal in the .objd file.

I want to make it clear that everything works fine if I just use the override files without changing the tuning id and instance - and that's due to your help - I was hovering my finger over the 7 day refund button.

I don't wan't to be changing the tuning for the default maxis objects though - so I just can't stick with the overrides.
Deceased
#4 Old 17th Jan 2015 at 9:22 AM Last edited by scumbumbo : 18th Jan 2015 at 7:32 AM.
Quote: Originally posted by Tac02
However, as soon as I changed the "n" and "s" values in the XML (Instance & ID) to make the effects unique to my objects; I got the "SCRIPT CALL FAILED" error again.

I might not be "setting the top bit to '1'" properly - because I have no idea what that means - google says the most important bit is the left-most bit so I changed that to '1' ie: 0x13ADA5... in the instance name - which I got s4pe to generate with the 64bit hash.


Not sure about that script call failed error, I've never seen that, but that "1" in your hex number is actually an entire byte, not a bit. I'd recommend getting the ModdingToolbox by Fogity (link to it is in the Modding Tools here on MTS). That will allow you to generate a 64 bit hash with the high bit set, and it can also convert it to decimal for you to put into that "s" value. A lot of hex->decimal convertors will give you an invalid decimal number from 64 bits of hex.

EDIT: Wasn't thinking straight when I wrote that above, the "1" is actually a nybble (half a byte). Two hex numbers make up one byte, which is eight bits. If the high bit is clear, the first nybble will be between 1-7 - and if it's set it will be from 8-F. Just use the Modding Toolbox and you should be fine
Pettifogging Legalist!
retired moderator
#5 Old 18th Jan 2015 at 4:20 PM
With XML tuning I'm not sure the high bit rule applies at all -- for the group ID, Maxis explicitely state it must remain set to zero and for my own custom tuning I've been using just the FNV64 of the name for the instance and that always worked .. I think (but am not 100% sure anymore) I've had issues when trying to set the high bit for that.

However, Script Call Failed may be due to other problems as well -- Tac02, what exactly are you doing when you are getting that error? Do you know that recolouring custom objects in-world (when they are already placed) will currently always result in that error? I'm not aware anyone knows how to get around that, at this point in time.

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.
Back to top