Jump to content

Linkable Scripts SOS


Brooke Portilo
 Share

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

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

Recommended Posts

I have tried and tried.. Shoes with socks and i want to change the colors of the socks ONLY! the socks are in 3 prims.. is anyone willing to come inworld and HELP! i need someone who knows Color changing Scripts for linkable prims.. im inworld weekdays from 10-1 SLT... thanks..............

 

 

Link to comment
Share on other sites

This is how I would approach the problem.

Define a list, prims_to_change, and a user function, find_prims(), up at the top of the script, something like this:

list prims_to_change;find_prims(){	prims_to_change=[];//clear the list	integer max = llGetNumberOfPrims()+1;	while(max--){//loop through the linkset		string s = llToLower(llStringTrim(llList2String(llGetLinkPrimitiveParams(max,[PRIM_DESC]),0),STRING_TRIM));		//find the description of each prim, clean it up and convert to lc		if("sock"==s){//if it's described as a sock			prims_to_change+=[max]; //add the link number to the list		}	}}

 Call find_prims() in state_entry, in the changed event if you change links, and whenever else seems appropriate.

Then, at run time, after deciding on a value for the colour vector you want, run through the list of link numbers and change them like this:

max = llGetListLength(prims_to_change);		while(max--){			llSetLinkColor(llList2Integer(prims_to_change,max),colour,ALL_SIDES);		}

 

Link to comment
Share on other sites

Not only that, but the Community Guidelines (link at the upper right corner of the screen here) explicit say "No advertising or promotion of specific Second Life merchants, Marketplace listings, products, or services, unless the forum area is specifically for the buying or selling of Second Life products or services, for example, a “for sale” or “wanted” forum. Do not reference other websites offering any product or service."

Link to comment
Share on other sites

Well Innula, a thing of it is I don't want people "to learn how to write scripts". Moreover many times, in these forums or otherwise, I suggested The Lab should license the compiler access to those able to pass a professional programming test.

I don't think the LSL compiler is very smart in terms of optimization and I've seen a vast number of inefficient amateur-written scripts violating the basics of Programming 101. They clog a hosting server with inefficient instructions and in the end of it slow down the whole network. Prolly a major contributing cause to the much complained about overall lag. Where else have you seen people being let to learn by trial and error on a live platform with hundreds thousands users?

Link to comment
Share on other sites

Part of SL's appeal is that it welcomes every resident to be a creator.  That means we live in a world that isn't as efficient as if it had been made by experts, but there are plenty of sterile worlds like that to play in.  In this forum, we are here to share scripting ideas and challenges and to help new LSL scripters learn to be creators, if that's what they choose to do.  No license required.

Link to comment
Share on other sites

while it's a wonderful thought (that could easily be applied to other content types), there is a problem or two with it...

the major one being that LSL is platform specific... there is no place else to hone ones skills in this particular language.

the second big one to me is the various idiosyncrasies of scripting for LSL... of which even we who can program are at a loss to fully document at times.

another would be some of the design elements that make it nearly impossible to write both efficiently AND in compliance with standard practices... the very simplistic compiler is a part of that.

and finally of course there is the fact that it's a scripting language and not a full fledged programming language... no matter how efficiently we write, it's still at very best a small subset of commands with much less flexibility than a normal programming environment.

Given all these facts, and that people can and will try anyway, my personal take has always been to try to improve the quality of what goes out.... it's not ideal, but at least it's a stride towards better.

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 4586 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...