Jump to content

realignment textures-prims


Edward Nussbaum
 Share

You are about to reply to a thread that has been inactive for 4187 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

I have a script that rotates child prims slowly in one direction (llSetLinkPrimitiveParams)while rotating the texture slowly in the other (using llSetLinkTextureAnim). In another script is a timer that should reset the positions of the prim and the texture to the upright position after a certain time, but it's not! I know it's reading the script - I tested that - but it isn't resetting the prims at all! why is that? Is the other script overpowering it? Thanks!

Link to comment
Share on other sites

It's hard to say without seeing your scripts, but it's probably worth asking yourself why you have split those two operations into two scripts instead of doing everything in one.

ETA:  Here's a rough example of an approach that works for a two-prim linkset ........

integer gON;float speed = 60.0;integer gCount;default{        touch_start(integer num)    {        if (!gON)        {            llSetLinkTextureAnim(LINK_THIS,ANIM_ON|ROTATE|SMOOTH|LOOP, 0,1,1,0.0,TWO_PI,-5.0*PI/speed);            gCount = 0;            llSetTimerEvent(0.3);        }        else        {            llSetTimerEvent(0.0);            llSetLinkPrimitiveParamsFast(2,[PRIM_ROT_LOCAL, ZERO_ROTATION]);            llSetLinkTextureAnim(LINK_THIS,FALSE,0,1,1,0.0,TWO_PI,-PI/speed);        }        gON = !gON;                }        timer()    {        ++gCount;        if (gCount%100 == 0)        {            llSetTimerEvent(0.0);            llSetLinkPrimitiveParamsFast(2,[PRIM_ROT_LOCAL, ZERO_ROTATION]);            llSetLinkTextureAnim(LINK_THIS,FALSE,0,1,1,0.0,TWO_PI,-PI/speed);            gON = FALSE;        }        else        {            rotation OldRot = llList2Rot(llGetLinkPrimitiveParams(2,[PRIM_ROT_LOCAL]),0);             llSetLinkPrimitiveParamsFast(2,[PRIM_ROT_LOCAL, llEuler2Rot(<0.0,0.0,PI/speed>)*OldRot]);        }    }}

 

Link to comment
Share on other sites

Thanks for your help - I'm slowly learning about programming, and this is helping me a lot! I originally split it because I thought there might be a conflict between the values in the script and the timer, but I can see I am wrong. Ill put it back together and see what comes out! Illpost code snippets next time! Thanks again.

 

 

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 4187 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...