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
Inventor
Original Poster
#1 Old 22nd Feb 2023 at 10:49 AM
Default Handling Push Interaction within Tree By Name
I want to be able to accept small pushed interactions within an interaction the sim is having. This can usually be done. For example, when you go dining, you can accept push to eat food and then return to dining. But in my case it didn't work. The unique property here is that I am pushing onto a tree by name, which may or may not be allowed.

The script can be outlined as follows:

Code:
Do some stuff ()
Select an object
   Run Tree By Name on object
   Do useful stuff ()
   Wait For Notify
     Idle for Input (allow push)
        handle push ()
        return
   priority:=50
   Do some more stuff ()
   return
continue the interaction ()
here it fails.

When Tree By Name returns, if there was a push, I immediately lose the interaction. The icon disappers, ci: Interaction Object, and ci: Current Running Object are set to 0. "Do some more stuff" involving walking and waiting works normally. Problem only happens when RTBN finishes. If there wasn't a push, then it works ok.

Has anybody encountered a situation like this?
I don't currently have an object to demonstrate because I grew frustrated and removed the push part.
Advertisement
Lab Assistant
#2 Old 4th Mar 2023 at 2:22 AM
Hi! What you're describing should be doable.

The easy stuff out of the way - ensure that any relevant interactions involved have "Allow Nested" and/or "Nest" checked in the TTAB. I usually try one or both until it behaves how I expect it to.
Inventor
Original Poster
#3 Old 4th Mar 2023 at 2:31 AM
I did not have allow nested because the action was not nestable. I will see if it makes any difference. I primarily expect the Move action on self that is issued when a higher priority person pushes you out of the spot, so that you can continue after moving.
Lab Assistant
#4 Old 4th Mar 2023 at 10:45 AM
Oh, I see now that I misunderstood - I was under the impression that you wanted to push a subqueue interaction.

So the intended implementation is something like this?
Interaction starts > Object (Different from Stack Object) Chosen > Run CallTree > Allow Move if Pushed To Move > Return > Interaction Continues

If I were you, I would investigate under what circumstances Maxis usually pushes Sims to move. Are you familiar with Whoward's (PickNMixSims)' BHAVfinder? You can use that to find Primitives with the type of operands you need.

Regarding the dining example... I'm not sure if that's one continuous interaction? I haven't checked, but that might be a string of interactions controlled by the dining controller.

If the Move interaction is not nested, pushing Maxis Move in a SemiGlobal TTAB onto a Sim will only (A) queue the interaction at lower priorities, and (B) at higher priorities will not let the rest of your interaction complete. Is that what you're trying to do, or am I off base?
Inventor
Original Poster
#5 Old 5th Mar 2023 at 12:43 AM
I want them to reliably approach the object within in a CT. You might have seen two people trying to climb modular stairs at the same time, and both stop because for one the stair exit is blocked and the other is asked to move. I can show you the mod where it happens, where I plugged my wait for notify back in. It is a bit complicated, but in simple scripts the problem doesn't happen. I tried with 'allow nested' both checked and unchecked. It works on an interaction directly on the object, but not via a social, which interfaces to the object via a CT.

I think it is the primitive 2E Snap that causes other people to "Move". In other cases it is 02FC Shoo - Sims from tile Object X is on, which explicitly pushes interaction 0xDD "Walk Away".

I fixed going to a seat in dining and cafeteria duty when serving near barstools where people can try to stand up from. I can push Wash Hands. The person takes the next item from the queue if it has a higher priority, executes it, and continues from where he left off. But here it doesn't work.
Inventor
Original Poster
#6 Old 15th Feb 2024 at 6:28 PM
I have come to the conclusion that this may not be done. Wait For Notify with push nested within CT is not legit. The moment the Tree By Name returns and is popped off the stack, it tries to restore the parent interaction, possibly because it has seen the nested notify and thinks that the current level (CT) is an interaction too. So it pops one level of "interaction parameters" off too. But the pushed CT didn't create a child interaction, and the current parent is instead deleted.

I took "CT - Get Bought Drink" and "CT - Order Drink for Sim" and made them interactions on the coffee machine. If I push those, the nesting structure looks the same, but it works. I can interrupt, and they continue. But managing this is harder. I don't think I can return false to the parent script, and need to signal if the child was "cancelled". Only callers params can be passed onto the child, so it looks messy. If anything is pushed while inside the child, it gets executed immediately after, and not later.

Push also doesn't work in the following scenario:

Cleaning Loop (TTAB interacton)
-> CT - EP3 - Do NPC Job
-> -> Maid - Clean an Item
-> -> -> Run functional clean (Empty Toddler Toilet)
-> -> -> -> Notify: Interaction - Flush Down Toilet.

This completely breaks when I pop back into Cleaning Loop. But it works ok inside the maid when returning to Maid - Clean Up House, because there is no CT involved. It seems to be OK if the parent isn't a TTAB interaction.

Main
-> CT - Alternate Visitor Controller
-> -> do all your complex life here with push
return to main, it still works.
Back to top