Replies: 0 (Who?), Viewed: 164 times.
Test Subject
Original Poster
#1 Old 27th Mar 2021 at 8:30 PM
Default Changing a token's attribute using Manage Inventory
I'm have a bit of confusion concerning the terms that are used when discussing primitive 0x0033, Manage Inventory.

Say I have an object with an arbitrary attribute, "Worth". Sims can be directed to pick up this object and add it to their inventory. However, if the object finds a copy of itself in the Sim's inventory first, I would want it to increase that copy's "Worth" by whatever the object not in their inventory's "Worth" is, instead.

The usual Set to Next variants of Manage Inventory are used to find an eligible token, which loads it into a temp token, and then checks its GUID. It all works as desired, apart from that last bit of attribute-changing functionality.

I have been trying to use the "Get Nth Property From Token In Temp" variant for this as it seems to be the correct one? It keeps throwing an error, and I lack the understanding to troubleshoot.

Per the following thread, and the documentation attached in it: https://modthesims.info/showthread.php?t=208887
"Takes the value provided by index and copies the property at that index from the temp token into the property variable. Returns false if the property index is invalid."
1. Can a "property" be any operand, within reason? Is attempting to use "My Attribute" incorrect? I've only found one Maxis BHAV that uses it.
2. SimPE displays two fields, "property" and "Value". Is value meant to be the index, or a variable the token's property is to be written to? If not, what are the functions of the two? If found, where is the token's property written to, otherwise?
3. Would it be better to just create an object version of the token in the ether, modify its attribute with 0x0002, then return that object to the inventory? Can one even directly modify the attributes of tokens, or temporary tokens?

If anyone has any notes or advice they would be willing to share, it would be very much appreciated!
Back to top