Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Analog Clock scripts makes clock move

Nefertari Wallace
Registered User
Join date: 9 Dec 2004
Posts: 64
08-26-2006 11:44
Hi: I was in a class at Teazers and it taught us how to make analog clocks. Well, I made a nice grandfather clock. There was a lockclock script in it as well as the hands scripts. Well, when I logged back in game the next day, the entire clock had moved. Actually, it was imbeded in the wall! Can someone please help me to fix this problem? Thanks in advance.
Ohforf Uram
n00b
Join date: 27 Jun 2006
Posts: 82
08-26-2006 17:15
I have the same problem with Objects drifting very slow.
You can try the following :
1. make the Object Phantom (not sure if this helps)
2. set your Parcel to Push Limitation (this should work)
3. make your script save the coordinates of the object and move it back each 5 minutes
(not tested, but should work 100%)
_____________________
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
08-26-2006 18:19
Err...make the clock non-physical?
Kayla Stonecutter
Scripting Oncalupen
Join date: 9 Sep 2005
Posts: 224
08-26-2006 19:34
From: Ohforf Uram
I have the same problem with Objects drifting very slow.
You can try the following :
1. make the Object Phantom (not sure if this helps)
2. set your Parcel to Push Limitation (this should work)
3. make your script save the coordinates of the object and move it back each 5 minutes
(not tested, but should work 100%)
1 and 2 won't work. The problem is a small drift that objects with moving parts now have (started around SL v1.9 I think). Only way to fix would be the resetting position once in a while. How often would depend on how fast it's drifting. Every 5 mins should be fine, or even less often if it's a slow drift.
_____________________
Ohforf Uram
n00b
Join date: 27 Jun 2006
Posts: 82
08-27-2006 19:50
Drifting Objects are a big Problem.
I wrote a little Script to move the Object back.
It works like this : if the Owner moves it, the movement is quite fast,
Drift is _very_ slow, like 0.000008 m in 5 minutes.
I'm testing it now, feel free to try it and tell me if it works for you.

EDIT : after some testing, i watched faster drifting
the script below is not the ultimate solution
i changed it to 0.01 m / 60 sec, it needs more testing

CODE

vector start;
vector pos;
float dist;

init()
{
start = llGetPos();
llSetTimerEvent(60);
}
default
{
state_entry()
{
init();
}
on_rez(integer param)
{
init();
}
timer()
{
pos = llGetPos();
if(start!=pos)
{
dist=llVecDist(start,pos);
if(dist>0.01)
{
// moved by owner
start=pos;
}
else
{
// drifted, moving back
llSetPos(start);
}
}
}
}
_____________________
Reitsuki Kojima
Witchhunter
Join date: 27 Jan 2004
Posts: 5,328
08-28-2006 05:46
This is actually a very old bug. It's been around at least since 1.3, probably longer. The problem is it only shows up sometimes, not all the time.

I've found that setting the object to Locked in the edit tab can /sometimes/ stop it.

My other solution is to have the root prim, once every ten minutes, do an llGetPos() comparison with it's previous position. If it's changed at all, it moves back to the old position.
_____________________
I am myself indifferent honest; but yet I could accuse me of such things that it were better my mother had not borne me: I am very proud, revengeful, ambitious, with more offenses at my beck than I have thoughts to put them in, imagination to give them shape, or time to act them in. What should such fellows as I do crawling between earth and heaven? We are arrant knaves, all; believe none of us.