Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Stop animation when away?

Maya Remblai
The one with pink hair.
Join date: 25 Mar 2006
Posts: 434
06-04-2006 02:39
I'm trying to get my eye blibk script to close the avatar's eyes when "away". Any advice? Here's the relevant peice of script. (The rest deals with texture changing and stuff, and I didn't feel like cleaning it all out :P )

CODE


timer()
{

if ( llGetAgentInfo(llGetOwner()) & AGENT_AWAY ) llSetTextureAnim(FALSE,ALL_SIDES, 2, 2, 3, 1, 0.0);

else
// Stop the last blink, so you can blink again
llSetTextureAnim(FALSE, 0, 2, 2, 0.0, 0.0, 10.0);
// Close the eyes, then reopen them
llSetTextureAnim(ANIM_ON|PING_PONG,ALL_SIDES, 2, 2, 0.0, 0.0, 10.0);
// Randomize time for next blink
llSetTimerEvent(time + llFrand(10));

Maya Remblai
The one with pink hair.
Join date: 25 Mar 2006
Posts: 434
06-05-2006 04:57
bump

Come on, I know it's not complicated! :P
Yumi Murakami
DoIt!AttachTheEarOfACat!
Join date: 27 Sep 2005
Posts: 6,860
06-05-2006 07:59
From: Maya Remblai
bump

Come on, I know it's not complicated! :P


You've left out the { } braces around the second block of code.

At the moment, only the line llSetTextureAnim(FALSE, 0, 2, 2, 0.0, 0.0, 10.0); is part of the else clause. The other two lines are running whether the agent is away or not, and are cancelling out the effect of the If statement.