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!
*shrugs*
retired moderator
Original Poster
#1 Old 4th Mar 2011 at 4:24 AM Last edited by maybesomethingdunno : 4th Mar 2011 at 4:42 AM.
Default Wait for notify leading to routing failure?
At the end of an interaction, I want the Sim to route to a particular position (e.g. to the mailbox) regardless how or why the interaction ends.

The Sim has a X% chance of "failure" (based upon body skill) which forces the Sim to quit the interaction...similar to when the Sim gets too scared to jump off the diving board. When this happens (or motives drop too low), the Sim goes through the exit protocols for the interaction which conclude with the Sim routing.

When the I cancel the interaction, however, all of the exit protocols work except for the routing. It's as if the act of canceling the interaction carries over to the canceling of the routing. Could this be the case?

The bhav is a bit lengthy but here's the gist:

.
.
.
30: [global 0x0119] Wait For Notify (2 args: Ticks=0x0000, Allow Push?=0x0000) (T:31, F:29)
31: Stop Sim animation (T:32 F:32)
32: Get rid of the props (T:33 F:33)
33: Set the destination as the Stack Object (T:34 F:34)
34: [prim 0x001B] Go To Relative Position (Location: On top of, Direction: Same direction, no failure trees: True, allow different altitudes: True) (T:T F:T)

Nodes 30-33 work, but node 34 seems to be ignored whenever the interaction is manually ended.

Is there something obvious I'm missing? Am I doing something that's stupid? Is there a work-around?

I don't mind if you call me "MSD" or something for short.
Tumblr
Perhaps someday I'll have leisure time back...
Advertisement
Retired Duck
retired moderator
#2 Old 5th Mar 2011 at 2:20 AM
What's happening when you say "Set the destination as the Stack Object"? Is continuing blindly on going to work if it fails? And are you playing with testing cheats?
*shrugs*
retired moderator
Original Poster
#3 Old 5th Mar 2011 at 2:46 AM Last edited by maybesomethingdunno : 5th Mar 2011 at 3:15 AM.
[prim 0x0002] Expression (Stack Object ID 0x0000 := Local 0x0004), where Local 4 gets its value from Temp 0 using a slight modification of your "Get in Temp 0 - ID - Closest whatever" bhav. (Instead of passing in the Sim's object ID, I'm passing the wave effect's object ID to get the closest beach portal ID. This way I can tell the Sim to route out of the ocean when done surfing without having a pile-up with multiple surfers swimming to the same portal.) I get the portal object ID earlier in the bhav, shortly after the Sim finds the unoccupied wave effect object.

Yes, I've got testing cheats on. I can set the false route on that node to Error though.


ETA: I don't get an error on the false route on that node.

ETA2: I'm attaching the package if it will help. The "Interaction - Surf" bhav is admittedly a bit long, despite my efforts to branch off parts into other bhavs. I've actually mislabeled the node numbers in my simplified version. My nodes aren't sorted, as their current order makes more sense to me.

As-is, the Wait for Notify bhav is node 47. Sorted, it's node 65. The Standard Exit did not seem to be clearing the "In Use" flag properly, so that's why there is the manual flag clearing.
Attached files:
File Type: zip  surf_interaction_test.zip (7.6 KB, 9 downloads) - View custom content

I don't mind if you call me "MSD" or something for short.
Tumblr
Perhaps someday I'll have leisure time back...
*shrugs*
retired moderator
Original Poster
#4 Old 9th Mar 2011 at 7:27 AM Last edited by maybesomethingdunno : 9th Mar 2011 at 4:20 PM.
I've done some more testing. I've set the "Go to Relative Position" node to return Error on false and successfully got the expected error for when the node returns Error. It seems that the "Wait For Notify" indeed forces a return "False" for the rest of the bhav (or at least on routing nodes). Thinking perhaps that this would resolve itself once the tree has terminated (judging by the way the action in the Sim's action queue remains X'd), I created a new bhav which would be a wrapper for the surfing interaction's bhav and which would re-instruct the Sim to route. Sadly this was without any apparent success. It seems no matter what I do, any post-"Wait for Notify" routing is going to be automatically canceled.

Would pushing a separate "Swim Away" interaction (possibly even located in a separate .package file -- I'm that desperate ) whose sole purpose is routing onto the Sim resolve this? The main "surfing" interaction should be considered concluded and, hopefully, routing sanity would return.

I'm a little uncertain what should be the operands for the [prim 0x000D] Push Interaction. (I understand the Interaction would be the number of the interaction in the TTAB.) I keep getting either "No stack object present when required" or "Object referred to must be a person" errors.

At this point in the surfing interaction, the Stack Object is normally the beach portal. So I use [prim 0x0002] Expression (Stack Object ID 0x0000 := My person data 0x001F (neighbor id)) then [prim 0x0002] Expression (Local 0x0006 := My 0x000B (object id)) for [prim 0x000D] Push Interaction (Target: Stack Object, Object: Local 0x0006, Interaction: Literal 0x0001, maximum priority, Icon object: Local 0x0006, Icon index: Literal 0x0000). Am I barking up the wrong tree with the whole "Push Interaction" idea?

My plan is to push the interaction only if the "Go To Relative Position" node returns false, as that should be the only time it would be needed. I wish I could pass the id of the portal onto the other bhav so that I wouldn't have to find it again. (I initially find it even before the Sim begins to route to the water to get rid of the slight lag that takes place while searching for it.)

(If I'm not making any sense, it's because I should have gone to bed several hours ago. -.- )


ETA: Instead of passing the ID to the next bhav, perhaps I could store it on an attribute inside the self-interaction?

I don't mind if you call me "MSD" or something for short.
Tumblr
Perhaps someday I'll have leisure time back...
Retired Duck
retired moderator
#5 Old 12th Mar 2011 at 4:47 AM
If the "Go To Relative Position" returns false, that means that for some reason or another your sim was unable to get to that location. Either that location is blocked by something, or your sim was, and pushing more interactions is unlikely to fix the problem... One thing you might try is changing the "Go To" target so that instead of "on top of" it's "in front of" or some such. If that still doesn't work, you might need to stick in a "Go To Routing Slot (global 0x0008)" to get the sim to move out of the way of whatever is blocking it.
*shrugs*
retired moderator
Original Poster
#6 Old 12th Mar 2011 at 7:10 AM
The "Go To Routing Slot" also returns False. What confuses me is that routing works when the interaction ends via "Wipe Out," which bypasses the "Wait for Notify" node. The only difference between ending the interaction by "Wipe Out" versus canceling the interaction should be the animations. I don't understand why something would be blocking the Sim in one case but not the other. It couldn't be that the NPC is in the way because the NPC is deleted before the Sim's routing starts. The Sim couldn't still be stuck on the cart because that gets deleted with the NPC; thus the Sim would be gone too. Even if it was a matter of the Sim being in the ocean (i.e. "locked tiles" or something), there is still the question of why it works for the Wipe Outs.

Here is the most recent code with an error log. (If it helps, the wave object is Local 0x0, the NPC is Local 0x1, the cart is Local 0x2, the surfboard is Local 0x3, and the portal is Local 0x4.)

Again, thank you so much for your help.
Attached files:
File Type: zip  surf_interaction.zip (17.1 KB, 9 downloads) - View custom content

I don't mind if you call me "MSD" or something for short.
Tumblr
Perhaps someday I'll have leisure time back...
Retired Duck
retired moderator
#7 Old 12th Mar 2011 at 8:32 AM
Unfortunately I can't test it, because I don't think I have the right EPs set up at the moment, but here's something to consider. At the moment, your BHAV has pretty much every line set to continue to the next line, regardless of whether it returns true or false. That's not really a good idea when you're developing. The only time you should point both true AND false to continue is if you are confident that it doesn't matter whether the line actually succeeds or not (like running an animation or starting an effect - they're eye candy but they won't break subsequent code). I can see several lines which, if they failed, could cause all subsequent lines to fail. For example, if:
[prim 0x0012] Remove Object Instance (Stack Object, return immediately: False, cleanup all: True)
failed, then the object would still exist, potentially blocking the sim's path. Or if this line failed:
[prim 0x002E] Snap (slot number 0x0001, from slot in temp 1: False, ask person to move: False, TEST ONLY: False)
then the sim would (presumably) still be stuck inside the object and therefore unable to route away from it.

In those circumstances, it looks like the later line is the one causing the error, when it was actually something which happened quite a while before hand. It might be a good idea to go through, and for any commands which have the potential to break subsequent commands if they fail, point the false target to error. Then try it out and see if any of them actually are breaking.
*shrugs*
retired moderator
Original Poster
#8 Old 12th Mar 2011 at 11:21 PM
I've cleaned up my loop a bit (I had some redundancy/less than efficient or logical decision-making regarding when to Wipe Out vs when to check for "Exit Skill Object?"). I kept the same return settings for animations (since I recall reading from somewhere that they occasionally return false for some unknown reason) and various evaluations (e.g. value-oriented or logical, "should I be paddling?" type). Just about everything else now has a "Return Error" for their false path. Yet it still only breaks on the routing when the interaction is terminated manually. Is there anything else here that could have the potential to break subsequent commands?
Attached files:
File Type: zip  surf_interaction.zip (17.1 KB, 10 downloads) - View custom content

I don't mind if you call me "MSD" or something for short.
Tumblr
Perhaps someday I'll have leisure time back...
Lab Assistant
#9 Old 27th Aug 2016 at 3:37 AM
Hey,
sorry about this intense thread necromancy, but I was wondering how you ended up solving this problem. I am dealing with something similar: cancelling the interaction leads to an error when trying to route to a given slot. This issue doesn't occur when my interaction ends 'automatically'.

I'm http://crispsandkerosene.tumblr.com/ on tumblr, admittedly not very active on MTS.
*shrugs*
retired moderator
Original Poster
#10 Old 27th Aug 2016 at 5:29 AM
Oh geeze. Um, forbidden magic? I don't remember what I did exactly...

You are certainly welcome to look at my mod for ideas as well as post your package and the error log.

Your Sim does not have trouble routing to the slot all the other times, correct? Only when canceling the interaction?

I don't mind if you call me "MSD" or something for short.
Tumblr
Perhaps someday I'll have leisure time back...
Lab Assistant
#11 Old 27th Aug 2016 at 8:09 PM
Yep, that is it.

I've looked into your surf interaction a bit, but didn't really get into identifying what solved the problem. It was a bit tricky to find what did that, and what served other parts of the interaction. I should probably look into it more.

I've included my package with this post. The error is just a generic "Undefined Transition".
Attached files:
File Type: rar  FaultyRoutingonCancel.rar (1.66 MB, 7 downloads) - View custom content

I'm http://crispsandkerosene.tumblr.com/ on tumblr, admittedly not very active on MTS.
*shrugs*
retired moderator
Original Poster
#12 Old 28th Aug 2016 at 3:31 AM
I'm sorry I haven't had much time to play with this, but I'm thinking the routing is failing to due to the footprint of the object (even with "ignore dest obj footprint:True"). It like the Sim wants to route to position, but the box is seen as in the way, if that makes sense.

I don't mind if you call me "MSD" or something for short.
Tumblr
Perhaps someday I'll have leisure time back...
Lab Assistant
#13 Old 28th Aug 2016 at 3:50 AM Last edited by Azelanne : 28th Aug 2016 at 4:04 AM.
I don't think that's it. This routing slot is used elsewhere in the interaction, and it being cancelled is the only thing leading to failure.

Maybe there's something about Wait for Notify returning true that erases the stack object info or something like that?

(Also thank you for helping, and take your time. I still have some meshes and anims I need to create for this object anyways.)

I'm http://crispsandkerosene.tumblr.com/ on tumblr, admittedly not very active on MTS.
*shrugs*
retired moderator
Original Poster
#14 Old 28th Aug 2016 at 11:41 PM
It shouldn't be losing the Stack Object info because the Stack Object is listed in the object error log: Stack Object name: CandK - TS1 Superstar Remake - Diving Tank.

Taking the "Wait for Notify" out the equation seems to produce the same result. Check out what I've done with the "Sub - Navigation Loop" BHAV; I have all routing returning False which should happen when you cancel the navigation. Then in the "Function - Loop" BHAV, I have it exit if the "Sub - Navigation Loop" BHAV returns False or if the "Skill - Exit Skill Object?" returns True. It's definitely something with exiting the action because the exit on motive failure works. I tried Snapping the Sim into the Slot which would work great if the Sim didn't fly over to the slot.

This is a really cool, well-made object.
Attached files:
File Type: zip  CandK_TS1SuperstarDivingTankRemake2.zip (1.90 MB, 9 downloads) - View custom content

I don't mind if you call me "MSD" or something for short.
Tumblr
Perhaps someday I'll have leisure time back...
Lab Assistant
#15 Old 29th Aug 2016 at 5:02 AM
Thank you
I can manage with that if the problem cannot be solved otherwise. Maybe I can find an animation to 'hide' the sim's teleportation haha.
(Is this the technique you ended up using for your surf interaction? I still want to look into it more + compare similar functions in Maxis objects.)

I'm http://crispsandkerosene.tumblr.com/ on tumblr, admittedly not very active on MTS.
Scholar
#16 Old 29th Aug 2016 at 4:00 PM
The error code "Undefined Transition" is usually struck when an op-code returns Error.
When you cancel the interaction you cancel the routing and line 1 of 'Sub - Exit' returns error when false (or cancelled). Point the false return to line 5 (snap into slot) to get your sim out reasonably cleanly on cancel.
Lab Assistant
#17 Old 29th Aug 2016 at 5:56 PM
Ohh, that explains why it leads to a false return then. And I'll go with the snap into slot. Thank you both for your help :3

I'm http://crispsandkerosene.tumblr.com/ on tumblr, admittedly not very active on MTS.
Back to top