Jump to content
Sign in to follow this  
Rhemah

llSetLinkPrimitiveParamsFast, question

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

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

Recommended Posts

can i use object name or description as an integer? if possible can someone teach me pls

llSetLinkPrimitiveParamsFast(objectname or desc here, [
            PRIM_GLOW, ALL_SIDES, 1.0
        ])

Share this post


Link to post
Share on other sites

Nope.   Take a look at the Wiki article on llSetLinkPrimitiveParamsFast.

This function applies only to the object in which the script is.   There are some constants you can use -- LINK_SET, LINK_ROOT, LINK_ALL_CHILDREN, LINK_THIS and LINK_ALL_OTHERS.   Otherwise you need to specify the actual link numbers you want to affect.

However, what you can do --and, to my mind, should do in appropriate cases --  is use link names or link descriptions to identify the link numbers you are interested in rather than hard-code link numbers.   That's because if you hard code the numbers, the script will almost inevitably get broken at some point if you have to relink to object.

So,what I regularly do is something like

integer counter;integer max;list liPrimsToChange;string lookFor = "Change me";findPrims(){	liPrimsToChange =[];//clear the list	max = llGetNumberOfPrims()+1;	counter = 1;	do {		string str = llList2String(llGetLinkPrimitiveParams(counter,[PRIM_DESC]),0);		if(lookFor==str){//if the prim description is "Change me"			liPrimsToChange+=[counter];//add the link number to the list		}	}	while(++counter<max);}

I call that in state_entry, on_rez, and in the changed event if (change & CHANGED_LINK);

Then at run time I do something like 

	listen(integer channel, string name, key id, string message)	{		if ("change"==message){			max = llGetListLength(liPrimsToChange);			counter=0;			list params;			do{				params+=[PRIM_LINK_TARGET]+[llList2Integer(liPrimsToChange,counter)]+[PRIM_COLOR,ALL_SIDES,<0.5,0.5,1.0>,1.0];			}			while (++counter<max);			llSetLinkPrimitiveParamsFast(LINK_SET,params);		}	}

(I think that's right -- I've not gone in world to test it).

That's telling the script to buiild a list of the prims I'm interested in and then, at run time, build a params list to change them all.  

I could equally loop through the list calling llSetLinkPrimitiveParamsFast to change each prim separately, but this way the change is excuted in one frame.   If it's only a few prims it doesn't make much difference but, in a large build, it can do.

  • Like 1

Share this post


Link to post
Share on other sites
You are about to reply to a thread that has been inactive for 1884 days.

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...