Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Looking for prim resize script

Myoko Takashi
Registered User
Join date: 10 Feb 2006
Posts: 20
03-10-2006 22:41
I have been looking all over and cannot find this, and I am hoping that I am posting this in the right spot.

I am looking for a script that will allow me to resize a prim at a touch. If you know where i can find one or know of one you would like to share I would appreciate it greatly. Thank you.
Seagel Neville
Far East User
Join date: 2 Jan 2005
Posts: 1,476
03-11-2006 05:12
I was about to let you refer to this Wiki, but it wasn't a touch command. If you would put down the scale value into the script directly, you might use the below.
CODE
float scale = 2;    // You can change this scale value here.

vector OriginalSize;
integer TouchSW;

default
{
state_entry()
{
OriginalSize = llGetScale();
}
touch_start(integer total_number)
{
if(!TouchSW)
{
llSetScale(OriginalSize * scale);
}
else
{
llSetScale(OriginalSize);
}
TouchSW = !TouchSW;
}
}
_____________________
:) Seagel Neville :)
Myoko Takashi
Registered User
Join date: 10 Feb 2006
Posts: 20
03-11-2006 20:09
Ok, I spent a few hours looking over LSL Wiki and still could not get this right. I think what I am looking for may be a bit more complicated than I can figure out. Basically what I need is a script that will change the size and position of a prim at a touch. For example, taking a prim size (.500, 10.000, 5.000) at position (100.000, 50.000, 50.000) and changing it to size (.500, 10.000, .500) and position (100.000, 50.000, 65.000) by touching it and back to the first stats with another touch. I would also like to keep the rotation on the prim set to what I make it. I hope this makes sense to those of you with more scripting experience than I have. Thank you. :)
Seagel Neville
Far East User
Join date: 2 Jan 2005
Posts: 1,476
03-11-2006 20:39
OK, then again just wrote, not tested. :D The positions are global coordinates. Take care so that you don't loose your object. :p
CODE
vector scale_i = <.500, 10.000, 5.000>;
vector pos_i = <100.000, 50.000, 50.000>;
vector scale_ii = <.500, 10.000, .500>;
vector pos_ii = <100.000, 50.000, 65.000>;
integer TouchSW;

default
{
touch_start(integer total_number)
{
if(!TouchSW)
{
while(llVecDist(llGetPos(), pos_i) != 0)
{
llSetPos(pos_i);
}
llSetScale(scale_i);
}
else
{
while(llVecDist(llGetPos(), pos_ii) != 0)
{
llSetPos(pos_ii);
}
llSetScale(scale_ii);
}
TouchSW = !TouchSW;
}
}
_____________________
:) Seagel Neville :)
Myoko Takashi
Registered User
Join date: 10 Feb 2006
Posts: 20
03-11-2006 21:29
Wow, thank you :)

I used what you gave me and what I read on LSL Wiki about llSetPrimitiveParams and I did it!! :) Thank you so very much for the help. Mabye I will get the hang of this script stuff eventually after all. :)