Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

llSetLinkPrimitiveParams not working well

Azul Wilder
Registered User
Join date: 29 Jan 2007
Posts: 87
02-20-2008 11:16
Hi there.

I have a linkset with 25 prims. The root prim sends llSetLinkPrimitiveParams comands to 20 of these child prims to change position to some of them and position and scale to some others.

None of the child prims change to the same position or scale, that's why I have to send 20 times that command one after the other.

After 15 calls it stops and no more changes happen.

I have also tried to make it work using one llMessageLinked and then every prim calculates its position and/or scale, but it doesn't work either, a similar problem happens.

Does anyone know if there are restrictions on the amount of scale or position changes that can happen in a linkset, in a short period of time.

Any light shed on this is very welcome.

Thanks a lot.
_____________________
First goes before
AW Devices
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
02-20-2008 13:44
at a guess they're starting to fail at a pint where the changes would violate some link distance rule.... that'd be the first suspect.
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -
Kahiro Watanabe
Registered User
Join date: 28 Sep 2007
Posts: 572
02-20-2008 13:50
Instead of using llSetPrimitive....you can use llSetPos that will change position of the prim where the script is in.

The limit is 10 meters but you can loop it in a 'while' or 'for'.
Azul Wilder
Registered User
Join date: 29 Jan 2007
Posts: 87
02-21-2008 10:50
Thanks a lot for your answers.

Void I changed the order of the llSetLinkPrimitiveParams and happens the same after 15 calls, so it doesn't seem to be a problem with link distance rule.

Kahiro I had also tried llSetPos using llMessageLinked to send them the info, and the result is the same.

I really don't know what to think, I will review (again) all the code step by step.

Any more ideas?

Thanks a lot.
_____________________
First goes before
AW Devices
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
02-21-2008 16:25
it could be a viewr issue, as I noted in another thread with a similar problem. with the veiwer not updating small (or in this case repeated) changes. to test this just set it working, tp away and back, if it's in the right final position (or begins working again for a limited time) that would likely be the problem....

to my knowledge the sim won't clamp changes to a prim like it does with chat messages, but knowing LL... ::shrug::

you might try inserting check messages to make sure the message to move is being recieved... if all the messages aren't there, then it's not likely the set call is the problem, but more likely the message call is

posting code helps
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -
Leyah Renegade
Live Musician
Join date: 2 Nov 2006
Posts: 125
02-21-2008 18:48
From: Azul Wilder
Hi there.

I have a linkset with 25 prims. The root prim sends llSetLinkPrimitiveParams comands to 20 of these child prims to change position to some of them and position and scale to some others.

None of the child prims change to the same position or scale, that's why I have to send 20 times that command one after the other.


In my experience it's a lot more reliable to implement this sort of thing by putting a separate script into each of the 20 prims that change, which will listen for a link message and change position, scale etc. when it receives the message. Then you just call llMessageLinked once from the root prim's script, and they will all change at once.

llSetLinkPrimitiveParams causes the script to sleep for .2 seconds after each call, which will throw off the timing of your animation, and it may also cause problems if you're trying to execute too many of them too fast.
Plastic Spoonhammer
Registered User
Join date: 9 Feb 2006
Posts: 20
02-23-2008 06:41
FWIW, I recently had (seemingly) similar problems with using llSetPrimitiveParams in child prims of a linkset. I had three child prims that could be 'toggled' between two positions/sizes from the root. The root sent the toggle command via llMessageLinked. I found that what would typically happen is: 1 prim would resize, 1 prim would move, and one would do both (all should have done both). Occasionally all three would move/resize as they should have.

I didn't take the time to get to the bottom of it, I just placed an increasing delay in the script of each child prim, so the movement/resize happens one at a time, and this configuration works dependably. Clearly there's something funny about llSetPrimitiveParams and linksets.
_____________________
P. Spoonhammer
Azul Wilder
Registered User
Join date: 29 Jan 2007
Posts: 87
02-24-2008 02:32
Thanks again for your answers.

Void, I have made what you said, I teleported to another place and later I came back, everything was the same, so not a viewer bug.

I have also inserted check messages and the orders arrive to the prims, but simply some of them don't carry them out. I have tried with linked messages and directly with llSetLinkPrimitiveParams. also when I used linked messages I tried to use llSetPos / llSetscale, and llSetPrimitiveParams, the result is always the same: "Some of the prims don't execute the comands" not always the same prims and not always the same amount of prims.

Plastic, I have also tried to put a delay (llSleep) in every prim with a difference of 0.1 second from a prim to the next, and the result is the same.

Thanks a lot again.
_____________________
First goes before
AW Devices
Plastic Spoonhammer
Registered User
Join date: 9 Feb 2006
Posts: 20
02-24-2008 14:37
For the record, I did a little more checking. I used one root prim and 14 child prims, with the following scripts:

Root:
CODE

default {
touch_start(integer total_number) {
llMessageLinked(LINK_ALL_CHILDREN, 0, "foo", NULL_KEY);
}
}


Child:
CODE

integer big = TRUE;
vector low_pos;
vector high_pos;

default {
changed(integer change) {
if (change & CHANGED_LINK) {
low_pos = llGetLocalPos();
high_pos = low_pos+<0,0,0.5>;
}
}

link_message(integer sender_num, integer num, string str, key id) {
vector pos = llGetLocalPos();
if (big) {
llSetPrimitiveParams([PRIM_SIZE, <0.25,0.25,0.25>,PRIM_POSITION,high_pos]);
big = FALSE;
} else {
llSetPrimitiveParams([PRIM_SIZE, <0.5,0.5,0.5>, PRIM_POSITION,low_pos]);
big = TRUE;
}
}
}


The sim I was on was realistically loaded (only a few avs, but plenty of objects and active scripts). Results? No problems at all. So my previous problems must have been with my scripts, though they were not much more complicated than these.
_____________________
P. Spoonhammer