Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

possible LSL bug

Gigs Taggart
The Invisible Hand
Join date: 12 Feb 2006
Posts: 406
11-30-2006 17:36
I think I may have found a bug in llSetScale, someone try this:

Try resizing it when it's in the default state, then touching it. The setscale silently fails.

CODE

float gHeight;

default
{
touch_start(integer num)
{
vector scale;
scale=llGetScale();
gHeight=scale.z - 0.01;
llSetScale(scale - <0,0,gHeight>);
state flat;
}

}

state flat
{

touch_start(integer num)
{
llSetScale(llGetScale()+<0,0,gHeight>);
state default;
}
}
_____________________
Gigs Taggart
The Invisible Hand
Join date: 12 Feb 2006
Posts: 406
11-30-2006 17:53
Followup:

It never fails if you setscale to a minimum of 0.02. Looks like setscale to 0.01 is flaky.
_____________________
Gigs Taggart
The Invisible Hand
Join date: 12 Feb 2006
Posts: 406
11-30-2006 18:04
Followup 2:

I think this is being caused by float inprecision, every now and then it must be getting 0.00999999... because of the subtraction I do.

Changing it to not calculate on the float works.

So, not an LSL bug. Case closed :)
_____________________
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
11-30-2006 18:16
Looking at the comments in the wiki it looks like llSetScale has always been kind of iffy. Try llSetPrimParameters instead.
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime.
From: someone
I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
Ziggy Puff
Registered User
Join date: 15 Jul 2005
Posts: 1,143
11-30-2006 20:26
Interesting. I've been noticing some flakiness on a 0.01 set scale recently too. My script isn't doing any math though. I'll see if it acts more reliably at 0.02.
Lex Neva
wears dorky glasses
Join date: 27 Nov 2004
Posts: 1,361
12-01-2006 10:38
Oh, well, this makes sense. I don't think 0.01 can be represented exactly internally, so when the sim is doing "if scale component > 0.01", you're losing because of float inaccuracies. Try targeting 0.011.
Eliza Lafleur
Registered User
Join date: 8 Jul 2006
Posts: 1
12-01-2006 15:18
Just pointing out that setting scale WITHOUT a script is flaky at the moment....as are other parameters for that matter.