SetTimer problem
|
Forseti Svarog
ESC
Join date: 2 Nov 2004
Posts: 1,730
|
01-03-2005 18:00
I'm no coding expert, but I can't figure out why the below code doesn't loop the Texture Anim every 2 seconds. It anims once, and then stops. Help is appreciated!
default { state_entry() { llSetTimerEvent(2.0); }
timer() { llSetTextureAnim(ANIM_ON, ALL_SIDES, 4,4,0,0,15); } on_rez (integer start_param) { llResetScript(); } }
|
DoteDote Edison
Thinks Too Much
Join date: 6 Jun 2004
Posts: 790
|
01-03-2005 18:08
You don't need a timer for llSetTextureAnim(), the loop is built-in. Delete your timer and put:
llSetTextureAnim(ANIM_ON | LOOP, ALL_SIDES, 4,4,0,0,15);
into the state_entry()
|
Al Bravo
Retired
Join date: 29 Jun 2004
Posts: 373
|
01-03-2005 18:10
Also:
llSetTextureAnim(ANIM_ON | LOOP, ALL_SIDES, 4,4,0,0,15);
|
Forseti Svarog
ESC
Join date: 2 Nov 2004
Posts: 1,730
|
01-03-2005 18:13
From: DoteDote Edison You don't need a timer for llSetTextureAnim(), the loop is built-in. Delete your timer and put:
llSetTextureAnim(ANIM_ON | LOOP, ALL_SIDES, 4,4,0,0,15);
into the state_entry() I can't loop in this case because i need a delay between "animations"
|
Harris Hare
Second Life Resident
Join date: 5 Nov 2004
Posts: 301
|
01-03-2005 18:16
In that case, change your timer event to look like this:
timer() { llSetTextureAnim(FALSE, ALL_SIDES, 4,4, 0, 0, 0); llSetTextureAnim(ANIM_ON, ALL_SIDES, 4,4,0,0,15); }
|
Forseti Svarog
ESC
Join date: 2 Nov 2004
Posts: 1,730
|
01-03-2005 18:21
From: Harris Hare In that case, change your timer event to look like this:
timer() { llSetTextureAnim(FALSE, ALL_SIDES, 4,4, 0, 0, 0); llSetTextureAnim(ANIM_ON, ALL_SIDES, 4,4,0,0,15); } thank you harris. I guess this is because if the anim remains "on" it won't restart? I'll implement this
|
Strife Onizuka
Moonchild
Join date: 3 Mar 2004
Posts: 5,887
|
01-03-2005 20:30
blink script?
_____________________
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
|
Forseti Svarog
ESC
Join date: 2 Nov 2004
Posts: 1,730
|
01-04-2005 09:23
From: Strife Onizuka blink script? yes strife... in this case, i'm linking two separate prims on a head attachment and varying blink pause and speed. Trying to get them completely in sync using the messagelinked function. The textureanim(FALSE, etc) addition has helped (a note on that should prob be added to llSetTextureAnim on the wiki) ... haven't completely gotten the timing in sync yet though. ... playing with the structure of parent/child scripts to get it completely working. I've heard some rumors that messagelinked doesn't work completely smoothly on multi-prim attachments, but we'll see...
|
Rickard Roentgen
Renaissance Punk
Join date: 4 Apr 2004
Posts: 1,869
|
01-04-2005 14:24
Harris is right  , if an animtion doesn't loop, but stops on it's own, any future call will start the animation where it left off rather than starting at the beginning. you must implicitly stop the animation before you start it over.
|