Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Animation stops when crossing sim

Postmark Jensen
is not a jerk.
Join date: 23 May 2004
Posts: 281
12-14-2004 15:48
I think that this worked before the 1.5.8.

When I wear my AV object, it starts an animation. When I take it off it stops the animation. Simple huh? But now when I cross a sim or TP, the animation stops. I have to detach and wear the object again. I swear this was working yesterday, but maybe I made a rookie mistake in my script...

CODE

// Postmark Jensen 13dec2004 Free to copy and mod. DO NOT SELL
//Drop this and an animation into an object, and when worn the animation will start.
//When detached the animation will stop.

//animation
string ani = "Compact";

default
{
state_entry()
{
llSay(0,"Oink"); //made for my flying pig avatar
}

attach(key attached)
{
if (attached != NULL_KEY) // object has been attached
{
integer perm = llGetPermissions();
if ((perm & PERMISSION_TRIGGER_ANIMATION) == PERMISSION_TRIGGER_ANIMATION){
llStartAnimation(ani);
}else{
llRequestPermissions( llGetOwner(), PERMISSION_TRIGGER_ANIMATION );
}
}else{ // object has been detached
llStopAnimation(ani);
}
}

run_time_permissions( integer permissions )
{
if ( permissions & PERMISSION_TRIGGER_ANIMATION ) // permission granted
llStartAnimation(ani);
}

}
Kurt Zidane
Just Human
Join date: 1 Apr 2004
Posts: 636
12-14-2004 18:48
I haven't herd of this happening, but if I can look at the script. Perhaps I could figure out what's happening.
Stinky Queso
Second Life Resident
Join date: 29 Nov 2004
Posts: 53
12-15-2004 16:58
Unless I'm much mistaken, crossing sim borders causes all attachments and things to enter the rez_object state, screwing up scripts and things. If you add llStopAnimation(ani); to the rez_object state, the animation will reset but then start again.. I think. Try it
Strife Onizuka
Moonchild
Join date: 3 Mar 2004
Posts: 5,887
12-15-2004 17:37
From: Stinky Queso
Unless I'm much mistaken, crossing sim borders causes all attachments and things to enter the rez_object state, screwing up scripts and things. If you add llStopAnimation(ani); to the rez_object state, the animation will reset but then start again.. I think. Try it


thought they fixed that. don't you mean on_rez?
_____________________
Truth is a river that is always splitting up into arms that reunite. Islanded between the arms, the inhabitants argue for a lifetime as to which is the main river.
- Cyril Connolly

Without the political will to find common ground, the continual friction of tactic and counter tactic, only creates suspicion and hatred and vengeance, and perpetuates the cycle of violence.
- James Nachtwey
Moleculor Satyr
Fireflies!
Join date: 5 Jan 2004
Posts: 2,650
12-15-2004 19:40
From: Strife Onizuka
thought they fixed that. don't you mean on_rez?


They fixed it.
_____________________
</sarcasm>
Postmark Jensen
is not a jerk.
Join date: 23 May 2004
Posts: 281
12-16-2004 06:50
No luck. Could you show me an example of what I should be doing?

I tried the following, which animates me when I rez it, but does not help when flying around.

CODE
// Postmark Jensen 13dec2004  Free to copy and mod.  DO NOT SELL
//Drop this and an animation into an object, and when worn the animation will start.
//When detached the animation will stop.

//animation
string ani = "Compact";

anim()
{
integer perm = llGetPermissions();
if ((perm & PERMISSION_TRIGGER_ANIMATION) == PERMISSION_TRIGGER_ANIMATION){
llStartAnimation(ani);
}else{
llRequestPermissions( llGetOwner(), PERMISSION_TRIGGER_ANIMATION );
}

}

default
{
state_entry()
{
llSay(0,"Oink"); //made for my flying pig avatar
}

on_rez(integer foo)
{
anim();
}
attach(key attached)
{
if (attached != NULL_KEY) // object has been attached
{
anim();
}else{ // object has been detached
llStopAnimation(ani);
}
}

run_time_permissions( integer permissions )
{
//llSay(0,"permissions");
if ( permissions & PERMISSION_TRIGGER_ANIMATION ) // permission granted
llStartAnimation(ani);
}
}