Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Linked set with childprim

Milcoi Delcon
Registered User
Join date: 24 May 2007
Posts: 30
09-20-2007 01:41
Hi,

I have a linked set/object with child prims (attache/wearable). Via the root script I let the entire object rotate by llDialog commands.
2 child prims has to stay in one "start" position while the others rotate.

what function do I need to script (childscript) so these 2 will go to their start postion after a rotation. How will I get the start position and tell them to stay?

Milcoi
Squirrel Wood
Nuteater. Beware!
Join date: 14 Jun 2006
Posts: 471
09-20-2007 03:28
Have scripts in them record their local rotation and position on attach / rez and every time you twist and turn the whole thing, move the specific prims to the recorded position and rotation.

That should do the trick. But expect the prims to twitch on rotation.
Milcoi Delcon
Registered User
Join date: 24 May 2007
Posts: 30
09-20-2007 05:36
ok...clear... possible to let me see an example how to record the start position and use them again?
Squirrel Wood
Nuteater. Beware!
Join date: 14 Jun 2006
Posts: 471
09-20-2007 06:50
vector a = llGetLocalPos();
rotation b = llGetLocalRot();

and setpos/setrot to do the repositioning magic.
Milcoi Delcon
Registered User
Join date: 24 May 2007
Posts: 30
09-20-2007 10:11
damn...that hard to understand...

I have this script inside the 2 child prims:

CODE

vector pos;
vector scale;
integer procent;

default
{
state_entry(){
//get the position and scale
pos = llGetLocalPos();
scale= llGetScale();
}

link_message(integer sender,integer num,string str,key id){

if (str=="chosen"){
//stretch it
procent = num;
llSetPos(pos*procent/100);
llSetScale(scale*procent/100);
if (procent == 100);
//Here chould come the rule to set it back to starting position
}
}
}


As you can see I'm scaling the 2 child prims and they rotate together with the whole object via the root script.
I like to return these 2 child prims back into starting position via if (procent==100);

Milcoi
Milcoi Delcon
Registered User
Join date: 24 May 2007
Posts: 30
09-21-2007 01:47
after trying serverall times and getting me going nuts...I realy need some help.
Squirrel Wood
Nuteater. Beware!
Join date: 14 Jun 2006
Posts: 471
09-21-2007 02:59
From what I see you use the prims as sort of graph/scale.

Suggestion for that: Set the cut values to .125/.625 so the prim is cut in half and its center point "wanders" to one side of the prim.
You can then stretch it any way you want while the center point stays in place.