Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Poseball disengage question

Galena Qi
Registered User
Join date: 9 Sep 2006
Posts: 249
01-02-2008 09:27
How can I move an avatar away from a poseball, and through a surrounding prim, after they click "Stand Up"?

I put a pose ball inside a snow globe. The pose ball needs to be the root prim of the object, so that the user can click through the outer transparent prim to activate the pose. This works fine - the av is moved inside the object and the animation is activated. However, I haven't figured out how to get the avatar out again, without making the entire object phantom. In some sims, the avatar is bounced out of the object when they stand up, but in other sims this doesn't happen, and I can't reproduce this effect consistently enough to use it.

I can't use llVolumeDetect on the outer prim, because it isn't the root. I could use a Changed event to turn the entire object phantom when the user unsits, but that isn't the best solution, as they would fall through the floor. The best I can think of would be to eject the user from the object when they unsit.

Any suggestions how I could do this?
Atashi Toshihiko
Frequently Befuddled
Join date: 7 Dec 2006
Posts: 1,423
01-02-2008 10:03
You could make the object go phantom for a half second or so, in conjunction with a very slight push to nudge them clear of the object. Do that in your changed even when they unsit. This does of course depend on being able to use Push on the land / sim your object is in, but it should get them clear of the object.

-Atashi
_____________________
Visit Atashi's Art and Oddities Store and the Waikiti Motor Works at beautiful Waikiti.
Galena Qi
Registered User
Join date: 9 Sep 2006
Posts: 249
01-02-2008 10:37
Is there a way to detect via script whether a sim has Push turned off? I would have to script an alternative for sims that don't allow that method.

[Answered my own question - I can use llGetRegionFlags & REGION_FLAG_RESTRICT_PUSHOBJECT for this.]
Atashi Toshihiko
Frequently Befuddled
Join date: 7 Dec 2006
Posts: 1,423
01-02-2008 10:46
llGetParcelFlags will let you determine if push is disabled where the object is placed.

For what it's worth, I use the phantom / not phantom trick in several of my products, where when an avatar stands up, the object goes phantom, pauses a second then goes non-phantom. I do not bother using the push. When the object goes phantom, avatars can 'drop' a bit but when the object goes nonphantom, the physics engine automatically does a little push to get them clear.

I use this specifically where the product has parts which frequently get the avatar stuck, i.e. when you stand up you get trapped where you can't get out due to interpenetration. Going phantom then notphantom triggers the physics engine to nudge the avatar clear. The downside is you have no control over which direction they get nudged and no control over the force of the nudge. In most cases though it's just enough to move them clear.

-Atashi
_____________________
Visit Atashi's Art and Oddities Store and the Waikiti Motor Works at beautiful Waikiti.
Galena Qi
Registered User
Join date: 9 Sep 2006
Posts: 249
01-02-2008 10:55
Thanks! :-)
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
01-02-2008 11:25
why not instead of the poseball being inside, make it the outer prim, and set the sit target offset inside of it? this won't eleiminate your standing problem but it removes the need for the pose script to be in the root, and the need to have a separate poseball
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -
Galena Qi
Registered User
Join date: 9 Sep 2006
Posts: 249
01-02-2008 11:36
That's a good suggestion. Then I could use llVolumeDetect to make the object phantom. I'll try both ways and see which works best .
Boss Spectre
Registered User
Join date: 5 Sep 2005
Posts: 229
01-02-2008 16:53
Another option would be to offset the animation itself when creating it, so that their actual postion is closer to the oustide boundary of the object, in which case the collision when they stand would put them back outside it.

If you don't mind their name tag remaining outside, you could position them completely outside it while the anim plays to show them on the inside.
Galena Qi
Registered User
Join date: 9 Sep 2006
Posts: 249
01-02-2008 21:34
That's an interesting approach! It would mean reworking my animation, but I might try it.

I tried using a quick change from phantom to nonphantom to kick the av out of the ball, but I found that the physics varies so much from sim to sim that I can't get the timing to work. Sometimes it works like a charm, other times (in a laggy sim), I don't get enough "kick" and just end up getting tossed a foot into the air and ending up under the object. Is there a secret to maximizing the rebound?

I realized I can't use the llPushObject approach, as I build in sandboxes and they all have Push turned off.
Galena Qi
Registered User
Join date: 9 Sep 2006
Posts: 249
01-03-2008 20:18
Update - Boss Spectre's solution worked great! I changed my animation to be offset a few meters behind the poseball, with a 0 sec. ease-in. It works 100% of the time without having to mess around with phantom/nonphantom action.

You forum denizens are wonderful!
Boss Spectre
Registered User
Join date: 5 Sep 2005
Posts: 229
01-04-2008 14:43
Happy to help!

Sometimes in 3D, thinking outside the box is literal.

;)