Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Detecting Mouse Look

Les White
sombish
Join date: 7 Oct 2004
Posts: 163
02-27-2005 17:41
Hello avatars!

When you use the default gun hold poses it will switch to the matching default aim pose on mouse look.

I use my own animations but can't figure out how to detect mouse look to change to an aim pose.

Any ideas?
McWheelie Baldwin
Registered User
Join date: 9 Apr 2004
Posts: 154
02-28-2005 14:54
While I am not sure if this will work, you could try doing something like this:

CODE

integer aiming;
string defaultAimAnim = "//key of default aim animation that matches the default hold"

.
. SNIPPET
.
//code that starts the default hold and custom hold ( most likely in run_time_permissions() )
aiming = FALSE;
llSetTimerEvent( 1.0 );
.
. /SNIPPET
.

timer()
{
list anims = llGetAnimationList( llGetOwner() );
integer mouseLook = llListFindList( anims, [defaultAimAnim] ) != -1;
if( mouseLook != -1 && !aiming)
{
llStopAnimation( customHoldAnim );
llStartAnimation( customAimAnim );
aiming = TRUE;
}
else if( !mouseLook && aiming )
{
llStopAnimation( customAimAnim );
llStartAnimation( customHoldAnim );
aiming = FALSE;
}


Note that in order for this type of thing to work, you would have to verify that the default aim animations have standardized keys, which you save somewhere. You would also have to make your custom hold and aim animations priority 3 or 4. You would play the default hold anim, then your custom hold would overlay it, since it has a higher priority. Then start a timer that checks for the active animations. When you detect the default aim animation, you would start the custom aim over the top of it. Again, this is just an idea, has not been tested in any way. Anyway, if you have questions, or want clarification on my idea, PM or IM me.

McW
_____________________


Lex Neva
wears dorky glasses
Join date: 27 Nov 2004
Posts: 1,361
03-28-2005 14:29
Wait two days. I believe 1.6 has a method to detect mouselook.
Kali Dougall
Purple and Spikey
Join date: 5 Feb 2005
Posts: 98
03-28-2005 15:44
From: Lex Neva
Wait two days. I believe 1.6 has a method to detect mouselook.

Indeed. It'll be here: http://secondlife.com/badgeo/wakka.php?wakka=llGetAgentInfo
Jeffrey Gomez
Cubed™
Join date: 11 Jun 2004
Posts: 3,522
03-28-2005 16:02
Of course, an easy hack would be a simple llEuler2Rot(llGetRot()); on an attachment. After all, llGetRot() for an agent returns level on one of the axes unless you're in mouselook.

Usually. :D
_____________________
---