Quit standing on pose ball
|
|
Baron Hauptmann
Just Designs / Scripter
Join date: 29 Oct 2005
Posts: 358
|
03-08-2006 13:10
I have noticed with many (if not all) poseballs that when you "stand", you stand ON TOP OF the poseball. Is it possible to add to a script (such as the freely available one from another forum) something that causes the avatar to stand IN FRONT OF the poseball, maybe a certain distance away? Or maybe beside the poseball?
Instance number 1: sitting on a bench. When I stand up, I should stand up in front of the bench.
Instance number 2: sitting in a chair at a table. When I stand up, I should end up either beside the chair or behind it.
Also (I guess this may be different), is there a function or event in the poseball that can detect when the avatar stands up? Maybe to say "see 'ya later" or something silly like that?
Thanks for the help! Baron
|
|
Ceera Murakami
Texture Artist / Builder
Join date: 9 Sep 2005
Posts: 7,750
|
03-08-2006 13:18
Yes, it certainly looks silly when you get up from a chair or bed that you were using a poseball on, and find yourself balancing atop the poseball like a trained dog in a circus act!
I think there is a way to detect 'unsit' actions. It seems to me that if you click on 'stand up' to get up, the scripting should be able to include in the handler a change in your offset, prior to executing the 'unsit' action, so that you are released in front of or to one side of the seated position, instead of squarelt atop the pose ball.
Script gurus? Any ideas on that?
_____________________
Sorry, LL won't let me tell you where I sell my textures and where I offer my services as a sim builder. Ask me in-world.
|
|
Sky Honey
Coder
Join date: 16 May 2005
Posts: 105
|
03-08-2006 14:15
From llUnsit: From: someone Q: When I make an avatar stand up from my chair, they end up standing on it. That looks stupid. Is there some way to get them to stand up and move to a specific position? A: Not precisely. There are a couple things you can try. The most effective option is to apply a small force to the avatar with llPushObject. Alternatively, try having the chair turn phantom when they stand up, so as to make them drop to the floor. They still might appear to be standing "in" the chair however. You can tell that some vehicles do this llPushObject thing by the hop you do when you stand up. I think that's to avoid getting stuck in the vehicle.
|
|
Baron Hauptmann
Just Designs / Scripter
Join date: 29 Oct 2005
Posts: 358
|
03-08-2006 15:00
Thanks sky. I had glanced through the wiki, and I guess did not notice that Q&A. Should open my eyes or search more!
I also notice that the "changed" event is used to detect when an avatar sits. So it seems that the same trigger (change & CHANGED_LINK) would detect the standing up?
Thanks again.
|
|
Sky Honey
Coder
Join date: 16 May 2005
Posts: 105
|
03-08-2006 15:44
From: Baron Hauptmann I also notice that the "changed" event is used to detect when an avatar sits. So it seems that the same trigger (change & CHANGED_LINK) would detect the standing up? That's right. In the changed page is an example for the standard teleport-using-unsit hack: // When an avatar sits on the object containing this script, // the object will say "Get off!" and then force the avatar to stand up. default { state_entry() { llSitTarget(<0, 0, 0.1>, ZERO_ROTATION); // needed for llAvatarOnSitTarget to work } changed(integer change) { // something changed if (change & CHANGED_LINK) { // and it was a link change llSleep(0.5); // llUnSit works better with this delay if (llAvatarOnSitTarget() != NULL_KEY) { // somebody is sitting on me llSay(0, "Get off!"); llUnSit(llAvatarOnSitTarget()); // unsit avatar } } } }
See the test for llAvatarOnSitTarget() != NULL_KEY? When the avatar stands up, you still get a CHANGED_LINK, but llAvatarOnSitTarget returns NULL_KEY. So you need to save who's doing the sitting, then you can do a slight llPushObject when they stand up.
|
|
Chris Wilde
Custom User Title
Join date: 21 Jul 2004
Posts: 768
|
03-09-2006 06:11
Could you simply make the bench phantom then put an invisible prim (non-phantom) beneath it thats angled so when you stand you 'slide' down the surface of the invisible prim and end up infront of the bench where you should normally be? Sorry for the run-on sentence. 
|
|
Sable Sunset
Prim Herder
Join date: 15 Apr 2005
Posts: 223
|
03-09-2006 06:50
erm... just make the pose ball or object phantom. It also stops those instances where standing from a sit target on a complex object throws you off in a random direction at high velocity. Chris' idea is good, but as you can't link phantom and non-phantom objects without them all becoming one or the other you wouldn't be able to link the 'ramp' to your phantom object 
|
|
Argent Stonecutter
Emergency Mustelid
Join date: 20 Sep 2005
Posts: 20,263
|
03-09-2006 06:54
Not to mention... why would anyone NOT phantom a poseball?
When it's in a non-phantom linkset, sure, but just sitting around the scenery? Or linked into a beach towel that's flat on the ground and doesn't matter if it's phantom or not?
|
|
Argent Stonecutter
Emergency Mustelid
Join date: 20 Sep 2005
Posts: 20,263
|
03-09-2006 06:59
From: Sable Sunset Chris' idea is good, but as you can't link phantom and non-phantom objects without them all becoming one or the other you wouldn't be able to link the 'ramp' to your phantom object  handle_sit() { llStartAnimation(MY_ANIMATION); llRezObject(RAMP,RAMP_POS,ZERO_VECTOR,RAMP_ROT,CHAN); }
handle_unsit() { llStopAnimation(MY_ANIMATION); llWhisper(CHAN,"die"); }
|
|
Chris Wilde
Custom User Title
Join date: 21 Jul 2004
Posts: 768
|
03-09-2006 11:27
^^^Good idea too. Also why even link the invisible "slide" prim?
|
|
Fa nyak
>(O.o)<
Join date: 8 Oct 2004
Posts: 342
|
03-09-2006 11:47
if you make your own sit poses, offset the hips a couple feet "back" in the anim itself, so you sit "behind" the poseball. use a sit target in the poseball script so that you appear to be sitting directly on top of it (effectively, the sit target is a foot or two in front of the chair. when you stand up, you should be standing where the sit target was, not where you appeared to be sitting, and hence, on the ground in front of the chair.
and yar, i always make all my furniture phantom, especially free-standing poseballs. gotta love walking through a room with hidden poseballs, bumping into "nothing" all over the room because they're still solid.
|