Jump to content

llSetLinkPrimitiveParams - PRIM_SIZE Problem


Maxx Deischer
 Share

You are about to reply to a thread that has been inactive for 2664 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

Hello all,

I have the following code:

float up = 0.01;

default
{
    touch_start(integer total_number)
    {
		if (up < 0.49)
		{
			llSetLinkPrimitiveParams(2,[PRIM_SIZE,<0.49,0.49,0.01+up>]);
			up = up + 0.01;
		}	
		else
		{
		llOwnerSay("Full");
		}
    }
}

Works good, but a problem:

The Linked Prim is a cylinder. If I click on prim 1, prim 2 resizes on the z-axis +0.01 and -0.01. I know I can get the position with llGetPos, but I can´t click the child prim, so i have to click prim 1 to resize prim 2.

How can I do that ?

Thanks for help.

Maxx.

Link to comment
Share on other sites

try using llDetectedLinkNumber

However, the way you have it written, it won't know if the prim has reached its maximum size, it will count up no matter which link is touched. you may need to get the link size and compare it to the max size you want for that specific prim (or global max size if they're all going to have the same max size)


Maxx Deischer wrote:

Hello all,

I have the following code:
float up = 0.01;default{    touch_start(integer total_number)    {
if (up < 0.49) { llSetLinkPrimitiveParams(,[PRIM_SIZE,<0.49,0.49,0.01+up>]); up = up + 0.01; } else { llOwnerSay("Full"); } }}

 

Link to comment
Share on other sites

I'm sorry, but I can't understand the question at all.   

If you're asking about not being able to toucn the child prim, the answer is that you should be able to unless there's another script already in the child prim containing a touch event.   If there isn't, then the script in the root prim should register touches to the child prim (and if there's more than one child, you can use llDetectedLinkNumber(0) to find out which child prim was touched.

However, you also talk about the difficulties in determining the position of the second prim.   llGetLinkPrimitiveParams(2, [PRIM_POSITION[)  should tell you what you need to know, though I suspect you might find PRIM_POS_LOCAL more useful, depending on exactly what you want to do with the measurement).

You probably know this trick and have rejected it since won't work for your build, but when I'm resizing stuff on the z axis, I often find it easiest to set the prim's slice to 0.5 so I don't need to worry about repositioning it.

Link to comment
Share on other sites

ok ok, to be more presicse:

I have one Mesh Prim (root) and two others:

A tube (1) and and something in in the tube(2)

the script is in the tube(1) because i can´t click then tube(2)

The tube(2) resizes well, but with z -0.01 and +0.01. So it moves in the ground 0.005 and up 0.005.
I just want it to move up 0.01. 

Thats the true problem.

If I use llGetLinkPrimitiveParams(2, [PRIM_POSITION[) I get always the position of the root prim and not of the child.
i tried this already.

I´ve got no problem with resizing the child or to get the child, but the child resizes up and down 

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 2664 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...