Avatar facing
|
|
Cyrus Odets
Registered User
Join date: 5 Oct 2005
Posts: 51
|
05-01-2006 12:42
Is there a way or sneaky workaround to make an avatar face in a certain direction? I realize that there is currently no scripting command to cause an avatar to face another avatar. I'm just wondering if someone knows a means where...
If avatar (A) is standing next to avatar (B). Avatar (A) would need to turn to the RIGHT 45 degrees to face Avatar (B). Is there a means to get avatar (A) to rotate 45 degrees to the right so they are facing Avatar (B)? Perhaps some sort of attached object?
Thanks!
|
|
Cross Lament
Loose-brained Vixen
Join date: 20 Mar 2004
Posts: 1,115
|
05-01-2006 20:09
I think the only way to actually rotate the avatar is with like, llPushObject or llApplyImpulse, and give them some rotational impulse. But it's inexact and probably won't be at all reliable. 
_____________________
- Making everyone's day just a little more surreal -
Teeple Linden: "OK, where did the tentacled thing go while I was playing with my face?"
|
|
Jigsaw Partridge
A man of parts
Join date: 3 Apr 2005
Posts: 69
|
05-01-2006 21:36
Maybe llMoveToTarget() in an attached object will do what you need? I haven't checked, but I had assumed that my hug attachment uses this to walk me over to my designated huggee.
|
|
Cyrus Odets
Registered User
Join date: 5 Oct 2005
Posts: 51
|
05-02-2006 10:08
Hi again Cross  Hi Jigsaw. Actually...thats exactly what led me to this dilemma to begin with. I've got a HUD attachment on a given avatar, and using that HUD attachment and llMoveToTarget I am 'remote controlling' another avatar. So Yup...you're idea for llMoveToTarget works...as thats what I'm using now...but it doesn't rotate them...at all. It seems that an avatar's rotation seems like its 'anchored' in place. I'm running out of ideas and I can't seem to make them face a new direction to save my life. Lets say you've got a compass cardinal, N, S, E, & W. Each of the cardinal points is marked by an object named appropriately (i.e. N, S, E, W). Our 'sample' avatar is standing in the middle and currently facing NORTH. Using llMoveToTarget we send him to the NORTH object. Indeed, works like a charm....the attachment on the HUD goes to move to the NORTH object as commanded. He is already facing North...so it works perfect. Our avatar walks along to the North object. However, instead...lets say we want to send him to the EAST object. The avatar will sort of half turn, and half 'sidestep' to the EAST object. But at the end of his trip...when he reaches the east object...low and behold, when he stops his movement he'll turn back to face NORTH once again. So he reaches the EAST object but still faces NORTH. As another example...say, from the middle again, we want to send him to the SOUTH object. He'll actually walk 'backwards' to get there :/ I've tried: -applying little implulses to the attachment to try to 'turn' him and it only just 'shoves' him left or right....but doesn't change his rotation. Its possible that this could have been done better as I'm not very good yet at using implulses and pushes and such. That was my first experience with using those commands...and I got them to work by following some examples I found....but it still didn't do the trick. -I tried a bunch of shorter llMoveToTargets. For example....if I were trying to move him to the EAST object....I'd send him NNE for a bit, then NE, then ENE, then due east....trying to 'turn' him with a bunch of little moves....but it ended up with the same result. -I even tried spawning a pedestal beneath him that would 'rotate' to the correct direction...and of course...the pedestal rotated but the avatar didn't. -So then I tried putting a little 'phone booth' on top of the pedestal. Hoping to use the 'walls' of the phone booth to 'pin' the avatar in place and forcibly turn him when the pedestal turns. Unfortunately, when the pedestal turns it would just cause the avatar to 'clip' through the walls of the phone booth and 'squirt' out. Of course...once he'd squirt out...he was still facing North. If anyone has had any success using a push or an impulse to turn an avatar....I'd love to know how. So far I'm hitting dead ends though. Jigsaw says his he has this 'hug attachment' and I'd assume that a 'hug' wouldn't be much good if the avatar's weren't lined up. Hugging thin air isn't any fun  So...I'd think there HAS to be some way the folks who make these hug attachments do it...unless they require you to 'line up' your avatar and face the huggee first. And then the 'hugger' just uses llMoveToTarget to move to them...already facing them.
|
|
Cross Lament
Loose-brained Vixen
Join date: 20 Mar 2004
Posts: 1,115
|
05-02-2006 10:26
Hi again, Cyrus.  Oops, I was bad. I meant llApplyRotationalImpulse()... but it wouldn't have mattered anyway, since the function doesn't work when applied to an attachment.  When you tried your 'phonebooth' trick, was the phonebooth using llSetRot() to turn? If so, bear in mind that non-physical movement effectly renders the object phantom until it's done moving, so it's not going to allow you to rotate the avatar. If you created a phonebooth with physics enabled and had it rotating physically, it would probably turn the avatar along with it. The other option I suppose is to rez an object that captures the owner's key, and uses llPushObject on them (since it allows one to apply a rotational impulse to the target). But again, the effectiveness of that is questionable, and it may not always turn the avatar the right amount. And yeah, the hug attachment... or at least, the one I have... doesn't rotate the hugger automatically, so if you're not facing your intended vict... er, huggee, it ends up being rather odd. 
_____________________
- Making everyone's day just a little more surreal -
Teeple Linden: "OK, where did the tentacled thing go while I was playing with my face?"
|
|
Jigsaw Partridge
A man of parts
Join date: 3 Apr 2005
Posts: 69
|
05-02-2006 11:13
Interesting, your experiments with moving to target - I must admit my avatar is usually looking at the object of my affection when I 'hug' , so I had never noticed that he didn't rotate if required to face them.
llLookAt() would obviously help, but according to the Wiki it has never worked. llRotLookAt() also apparently doesn't work with attachments.
Yup, I have no useful suggestions on this topic at all ...
|
|
Cyrus Odets
Registered User
Join date: 5 Oct 2005
Posts: 51
|
05-02-2006 12:45
Hi again guys, Thanks for the help! llPushObject is something I haven't tried. Do you happen to have a snippet of code using llPushObject that might rotate an avatar...oh...say roughly 90 degrees? I just need an example to work from as I'm not exactly sure what values are good values to use for the arguments to llPushObject. If even a 'rough' example will turn my avatar at ALL...then I can 'tweak' that to at least the 'rough' effect I need...and something is surely better than nothing  With regards to the phone booth idea...yup...I tried it both physical and non-physical. It just ended up 'squirting' the avatar back out again, and of course, facing in the direction he was facing prior to any rotation as if there were some big rubber band holding him facing that direction. He might turn for a second or two...but once the phone booth was done rotating and the avatar was 'squirted' out...he'd spring right back to his original rotation. I tried llLookAt as well, after Jigsaw mentioned it. No dice. Just to be sure....I put an object on the ground and put the same llLookAt in that...and in an unattached object it worked fine. Didn't seem to do much of anything when attached.
|
|
Cross Lament
Loose-brained Vixen
Join date: 20 Mar 2004
Posts: 1,115
|
05-02-2006 13:48
Ugh... I just tried using llPushObject to give my avatar some angular push, and it doesn't do anything. Maybe I'm just not fully understanding how this is supposed to work, but nothing I plug into it is giving me any rotational motion. I did manage to throw myself clear out of the sim I was experimenting in, however.  I'm beginning to think maybe you just might not be able to rotate avatars in any useful way. 
_____________________
- Making everyone's day just a little more surreal -
Teeple Linden: "OK, where did the tentacled thing go while I was playing with my face?"
|
|
Eloise Pasteur
Curious Individual
Join date: 14 Jul 2004
Posts: 1,952
|
05-02-2006 14:45
I've got to say I've never tried - but I've always assumed it's pretty much impossible. Every hug attachment I've ever seen requires you and your partner to line themselves up, the attachment just moves the wearer to the person they're going to hug.
There are enough people making them that *someone* would have done one that worked better already, with a rotate built in if it was possible, and it would spread like wildfire.
|
|
Jillian Callahan
Rotary-winged Neko Girl
Join date: 24 Jun 2004
Posts: 3,766
|
05-02-2006 14:46
Simple fact of the matter: Av rotation is done client side first, then reported to the server.
You can't turn an av with LSL. Sorry.
|
|
Zepp Zaftig
Unregistered Abuser
Join date: 20 Mar 2005
Posts: 470
|
05-02-2006 15:29
You might be able to modify this script to remote control someone. It's for walking when you sit on a cylinder, but you could take the controls out to a HUD to remote control someone else. It only works on relatively well-behaved terrain though,
|
|
Copper Surface
Wandering Carroteer
Join date: 6 Jul 2005
Posts: 157
|
05-02-2006 17:47
You could make a hug *vehicle*. That would allow you to control the avatar rotation. Even force mouselook and camera if necessary. I haven't tried it, but perhaps just make it a small vehicle, and pass controls through to the avatar, allowing normal movement.
|
|
Lightwave Valkyrie
Registered User
Join date: 30 Jan 2004
Posts: 666
|
05-02-2006 19:00
Copper ! hi ya, i want a finger of Linden! LOL oh and ya i think a remote vehicle with an animation overider in it is the way to go have the person sit on a cube like poseball rather than wear something -LW
|
|
Zepp Zaftig
Unregistered Abuser
Join date: 20 Mar 2005
Posts: 470
|
05-02-2006 19:06
From: Lightwave Valkyrie Copper ! hi ya, i want a finger of Linden! LOL oh and ya i think a remote vehicle with an animation overider in it is the way to go have the person sit on a cube like poseball rather than wear something -LW That's basically what the script in my previous post does, except it would have to be modified a bit to be remote controlled.
|