Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

How to force client update of prim parameters?

BlueSun Beresford
Registered User
Join date: 11 Jul 2007
Posts: 10
07-20-2007 06:51
I do have a rotation script in a child prim with pretty weird behaviour. Basically it's a script which toggles rotation of a globe on a stand. The rotation is OK, but starting and stopping is the issue.

The following script sits in the child prim (the globe):

CODE

integer rotate(integer seconds) {

llTargetOmega(-llRot2Fwd(llGetLocalRot()), TWO_PI / (float) seconds, 1.0);

}


default
{
state_entry()
{
llWhisper(0, "Stopped");
rotate(2000000000);
}

touch_end(integer num_detected)
{
state spin_slow;
}
}

state spin_slow
{
state_entry()
{
llWhisper(0, "Slow spin");
rotate(60);
}

touch_end(integer num_detected)
{
state default;
}
}



Now the problem:

* After editing the script everyting is fine in the original object: The globe starts and stops whenever touched.
* When I rez the object, touching also works (the messages are whispered), but the rotation only becomes visible after I right-click the object and deselect it again. The SL client only seems to update the displayed rotation after selecting and deselecting the object.

My question: Is there any way how I can force the client to update parameters, including omega, such that it is really displayed? I already tried calling llSetAlpha() and llSetScale() from inside the rotate() procedure to force such an update, but without luck.
Milambus Oh
Registered User
Join date: 6 Apr 2007
Posts: 224
07-20-2007 07:31
Not sure if this is your problem or not, but if you have an object selected with the Edit menu or a Right click menu open, then the Omega rotation will not display for you. I don't think that you can make them update, because the animation is stopped so that the person can interact with the object.
BlueSun Beresford
Registered User
Join date: 11 Jul 2007
Posts: 10
07-20-2007 07:40
Yes, I know about selecting stopping the rotation. I guess this effect is also the reason why the new rotation rate is then updated after selecting.

Anyway, I found a kludge to fix the problem:

CODE

rotate(integer seconds)
{
vector scale0 = llGetScale();
vector scale1 = scale0 * 0.999;

llSetScale(scale1);
llTargetOmega(-llRot2Fwd(llGetLocalRot()), TWO_PI / (float) seconds, 1.0);
llSetScale(scale0);
}


It's not pretty, but it works.
Senuka Harbinger
A-Life, one bit at a time
Join date: 24 Oct 2005
Posts: 491
07-20-2007 08:30
I use llSetText("",<1,1,1>,1) to force an update on my objects. it works well with animated textures that get stretched out for unapparent reasons too.
_____________________
My SLExchange shop

Typos are forgiven; desecrating the english language with reckless abandon and necrophilic acts is not.


The function is working perfectly fine. It's just not working the way you wanted it to work.