I'm trying 3 differet was to tell my 40 linked prims to change their size.
See below.
The message sending stuff produces random results, some prims do what they should do others don't but really in a random way.
The enumeration of all prims in a loop changes all prims the first time but gets worse the more often I call it.
Is the LSL simply unreliable or do I something wrong here.
I checked if all prims have the script attached.
That there are enough prims supported on the sim.(I don't rez any new prims)
Is there a 30prim limit when linking objects together? I think I've seen this with cars.
I know there is a 64 message limit for llmessagelinked but not for llSay
The root prim calls
llSay(INTRERCOMCHANNEL_SETPRIMSIZE, (string)objsize);
And all 40 prims should do something
default
{
state_entry()
{
llListen(INTRERCOMCHANNEL_SETPRIMSIZE,"", NULL_KEY,""
;}
on_rez(integer num)
{
llResetScript();
}
listen(integer channel, string name, key id, string message)
{
llSay(0, data);
vector objsize = (vector) message;
list primparams;
primparams = [];
primparams = [PRIM_SIZE, objsize];
llSetPrimitiveParams(primparams);
}
}
I tried the same with
llMessageLinked(LINK_SET, SETPRIMSIZE, (string)objsize ,"0"
;and
link_message(integer sender, integer channel, string data, key id)
And the third way was to enumerate all prims
SetObjectSize(string obj, vector objsize)
{
if(obj == ""
return;objsize.x = GetMax(objsize.x, 0.01);
objsize.y = GetMax(objsize.y, 0.01);
objsize.z = GetMax(objsize.z, 0.01);
integer i;
integer objlength = llStringLength(obj);
obj = llToUpper(obj);
for (i = 1; i <= llGetNumberOfPrims(); i++)
{
string currobj = llToUpper(llGetSubString (llGetLinkName(i), 0, objlength-1));
if (currobj == obj)
{
list primparams;
primparams = [];
primparams = [PRIM_SIZE, objsize];
llSetLinkPrimitiveParams(i, primparams);
}
}
}