Quick Reply
Search this Thread
Forum Resident
Original Poster
#1 Old 21st Dec 2023 at 2:09 PM
Default Making another sim start doing stuff
I'm hoping someone can help me with this, because I'm stuck and I'm not sure what to look for.

I can set up interactions for my custom object, and get the sim who interacted with the object to do various things with BHAVs, including adjusting another sim's person data etc. But "Me" always refers to the original sim. I now want to make the original sim move out, switch control to a different sim (whose object ID and neighbor ID I know), and then get the new sim to start doing things - effectively add something to the new sim's queue. How do I do that? How do I say "Make sim xxx the Active sim" and "Make sim xxx do bhav 1xxx"?
Advertisement
Mad Poster
#2 Old 21st Dec 2023 at 7:03 PM
There are a lot of different ways to switch the stack object to a new Sim, but if you do it by feeding the object ID or NID into your code, the mod you're making will have very limited use, since a Sim's object ID can change from lot to lot. The Nid is unique, so if you used that then you wouldn't be able to use it for other Sims. Do you really only need this to work for one Sim and one lot? If yes, if for example that the Sims Object ID is 5, you could do something like

Local 0 := Literal 5
Stack Object ID := Local 0

then run the interaction in the new Sim's stack object. If you want the process to be more versatile, you could have your object look for Sims with a certain attribute, token or thing in their inventory, using the Set to Next function. Then use the Push function to push a certain interaction on them.
Forum Resident
Original Poster
#3 Old 23rd Dec 2023 at 1:37 PM
Thank you - but I've clearly not explained this very well.

I know how to change the Stack Object, and have already been doing that. And when I know the sim in question's NID and object ID, I mean that I have code to work it out so that Local 2 is the object ID and Local 3 is the NID (or something like that, I can't remember exactly which numbers I used). I want to change "Me" - which presumably means starting an interaction for the new sim.

But thank you for the suggestion of the Push function - I will investigate.
Mad Poster
#4 Old 23rd Dec 2023 at 2:58 PM
If the push function doesn't work, it might be best to post your code. Because all you should need to do to start an interaction for the new Sim is to make them the stack object. "Me" is the Sim who you're controlling when you click the object.
Back to top