Quick Reply
Search this Thread
Test Subject
Original Poster
#1 Old 31st Dec 2024 at 4:45 PM Last edited by Tschvir : 31st Dec 2024 at 4:48 PM. Reason: typos
Default Check if an object can be found on the lot? Struggling with '[prim 0x001F] Set to Next'
I want to create a mod that works more or less the same way as beestew's Less Apparition Mod, but I want it to work with different interactions and look for the required objects on the lot, rather than just the active sim's inventory.

So far I was able to modify beestew's mod to make the 'Take Shower' interaction visible only if a sim has a specific object in their inventory (currently I'm using an object from that mod for testing purposes, but eventually I want to create a body wash object and make it required). I essentially recreated the same check beestew added to the 'Social - Play - KickyBag TEST' BHAV and I added it to 'Interaction - Take Shower Test'. And that works.

But as I said, beestew's mod looks for the object in the inventory, and when I want to change that to the whole lot it stops working, i.e. the "Take Shower" interaction is never visible, regardless of whether the object is present on the lot or not. The game doesn't crash or anything, the shower is still 'clickable' and has the 'Tinker' interaction available, so I feel like the game just can't find the object based on those values for whatever reason and that check always returns false...

Based on my research, looks like I should use [prim 0x001F] Set to Next and make it look for an object with a specific GUID, but I probably set it up incorrectly. I found this thread How to properly "Set to next" [2] where @Lamare mentioned how she was using it and tried to follow the same logic, but I must have done something wrong...

Here's how it's currently set up:


And here's the original BHAV I used for reference that only checks the inventory:



I tried experimenting with a different setup in the Wizard e.g. ticking the Set Stack Object checkbox which changed the value from 'Stack Object Id' to simply 'Stack Object', but it didn't make any difference in the game.



Since it's the first time I'm editing a BHAV, I must have made some silly mistake along the way, but I can't find any information on how to fix that so I'll appreciate any suggestions and ideas!

TL;DW: Want the 'Interaction - Take Shower TEST' BHAV to check if a specific object exists on the lot and hide the 'Take Shower' interaction if not
Screenshots
Advertisement
Scholar
#2 Old 4th Jan 2025 at 11:29 PM
Yes, inventory and lot are two different contexts. Don't be confused by there being a Lot option in Manage Inventory. That is a house memory where things like fridge contents go.

To step through objects on the lot, you need to start at 0 not the current stack object, which is likely the shower. Objects on the lot can be found in any order depending on when they were placed.

Remember that you usually need to restore the Stack Object ID from a variable where you first put it for subsequent functions. As you step through objects, the ID will take on different values. If you don't need to query any properties from A561B9, you can do Set to Next, Local 1 (instead of Stack Object ID). Locals default to 0 when first used, so you will then start at the beginning. You need to increment the Local Var Count at the top of the window if you use a new local.

It is also a good practice to zero all operands if you clone an entry. The value 61 has no meaning.
Back to top