Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

linked prims llsetscale in %

Milcoi Delcon
Registered User
Join date: 24 May 2007
Posts: 30
09-11-2007 09:51
Hi,

I have 10 prims linked and looking like a doll, I'm now looking for a script to increase the size of the doll in %. Like 10%, 20%, 30%........

I have this script but it doesnt work on linked prims and I don't know how to let it grow in %

CODE

vector small_scale = <0.5, 0.5, 0.5>;
vector large_scale = <0.6, 0.6, 0.6>;
vector new_scale;
integer is_large;

default
{
touch_start(integer total_number)
{
if(is_large)
{
new_scale = small_scale;
}
else
{
new_scale = large_scale;
}
while(llVecDist(llGetPos(), new_pos) != 0)
{
llSetScale(new_scale);
is_large = ! is_large;

}
}
}
Shadow Subagja
Registered User
Join date: 29 Apr 2007
Posts: 354
09-11-2007 10:47
Give the example link set script here a good read:
http://www.lslwiki.net/lslwiki/wakka.php?wakka=llSetScale
Milcoi Delcon
Registered User
Join date: 24 May 2007
Posts: 30
09-11-2007 22:25
I know this and tried it but, the linked prims are moving when I put the script in and give the command.

isn't there an better way?
Anya Ristow
Vengeance Studio
Join date: 21 Sep 2006
Posts: 1,243
09-11-2007 23:57
My trick is to take advantage of minimum or maximum prim size. If I want to enlarge a linked object by, say, 14%, I create a cube that is 10m/1.14 (8.772m) and link it to the object, making it the root prim. Then I use stretch to enlarge the object as large as it will go. The cube is now 10m and the rest of the object is enlarged 14%. Unlink the cube and discard it.

To shrink a linked object by 14%, link to it a cube that is 0.01m/(1-0.14). To do that with any accuracy you'd have to use a script. Then link the cube to your object as the root prim, shrink as far as it'll go, unlink the cube and discard it.

Problem is, right now stretching linked sets is problematic. It wants to snap back to the original state. Try stretching slowly, stoping at intermediate states. If that doesn't work, try stretching quickly. And in all cases, have a backup of your object available in case it gets trahsed.
Milcoi Delcon
Registered User
Join date: 24 May 2007
Posts: 30
09-12-2007 01:45
Ty,

I found a male gentinal and you can change size by % it's working perfect. I will ask the creator if he is willing to send me the scale script.
Boss Spectre
Registered User
Join date: 5 Sep 2005
Posts: 229
09-12-2007 05:43
From: Milcoi Delcon
I know this and tried it but, the linked prims are moving when I put the script in and give the command.

isn't there an better way?


In fact the prims have to move, to stay in the same relative spot when they scale. the distance between the prims has to scale as well.
Milcoi Delcon
Registered User
Join date: 24 May 2007
Posts: 30
09-12-2007 08:08
but to to script it then...

llsetscale with llsetpos?
Joannah Cramer
Registered User
Join date: 12 Apr 2006
Posts: 1,539
09-12-2007 08:19
From: Milcoi Delcon
llsetscale with llsetpos?

Yes, you'd need to multiply both the size and the relative position from root by the same factor. Probably better to use llSet(Link)PrimitiveParams() to perform change of both size and offset in single step, for higher performance and less messy appearance.

Btw, rather than store every supported size it's more flexible to store just the original offset and dimensions, and then re-calculate offset * scale and size * scale for the prims on the fly (just need to make sure the resulting size stays within SL supported boundaries) This way you can have smooth scaling ability that can be as precise as you want it.
Milcoi Delcon
Registered User
Join date: 24 May 2007
Posts: 30
09-12-2007 23:55
isn't there any example script there with , let's say 4 boxes on the ground stick together and linked. When touch they grow and no seams are there or gaps between the 4 boxes.
Boss Spectre
Registered User
Join date: 5 Sep 2005
Posts: 229
09-15-2007 01:28
http://lslwiki.net/lslwiki/wakka.php?wakka=llSetScale