Evan Reanimator Posted June 29, 2011 Share Posted June 29, 2011 thanks. Link to comment Share on other sites More sharing options...
Dora Gustafson Posted June 29, 2011 Share Posted June 29, 2011 For ideas look here or here or here After that you can look in the waka library and the wiki library:smileyvery-happy: Link to comment Share on other sites More sharing options...
Highstaker Posted June 29, 2011 Share Posted June 29, 2011 float R = 0;float G = 0;float B = 0; default{ state_entry() { llSay(0, "Hello, Avatar!"); } touch_start(integer total_number) { R = llFrand(1);G = llFrand(1);B = llFrand(1); // change color! llSetColor(<R,G,B>,ALL_SIDES); llSetPrimitiveParams([PRIM_POINT_LIGHT,TRUE,<R,G,B>,1,20,0.75]); } } This changes the color and light color to a ... random color upon every touching. Hope it helps. Feel free to ask if a particular effect is needed. BTW you may want to set a Glow parameter to about 0.4-0.6 and turn on Full Bright, cause the object without those effects looks very dull. Link to comment Share on other sites More sharing options...
Void Singer Posted June 29, 2011 Share Posted June 29, 2011 if you are looking to define the colors as static, then you want a list wrapper... the simplest list wrapper is a global integer that each time you make your call, you add 1, then modulus by the list length, and save the result back to the global gIdxColor = (-~gIdxColor) % color_list_length; //-- wraps the list index back to zero when it reaches the end of the list Link to comment Share on other sites More sharing options...
Dora Gustafson Posted June 29, 2011 Share Posted June 29, 2011 Void Singer wrote: gIdxColor = (-~gIdxColor) % color_list_length; //-- wraps the list index back to zero when it reaches the end of the list or simply: gIdxColor = ++gIdxColor % color_list_length; Link to comment Share on other sites More sharing options...
Void Singer Posted June 29, 2011 Share Posted June 29, 2011 probably better to avoid the double assignment that the increment operation causes.... you could just write is as +1, but the double bit flip is faster and I expected someone would ask and I'd explain it Link to comment Share on other sites More sharing options...
Dora Gustafson Posted June 29, 2011 Share Posted June 29, 2011 I recognize your sport as fun and legitimate:smileywink: I refuse to trade readability for a few (documented?)machine cycles. Link to comment Share on other sites More sharing options...
Paladin Pinion Posted June 29, 2011 Share Posted June 29, 2011 I'm in awe of bit-flippers. But on a practical level, I think when a new scripter asks a question, the most straightforward answer will probably teach them best. They can learn the tricks later. But I'm still in awe, Void. Link to comment Share on other sites More sharing options...
Void Singer Posted June 30, 2011 Share Posted June 30, 2011 no learning without exposure, but I'll count that as a questions so... gIdxColor = (gIdxColor + 1) % list_length; ~Y = (Y +1) * -1 -1 * ~Y = (Y + 1) * -1 *-1 -~Y = (Y + 1) * (1)-~Y = Y + 1 -Y = (Y * -1) ~(-Y) = ((Y * -1) + 1) * -1 ~-Y = (-Y + 1) * -1 ~-Y = (-Y * -1) + (1 * -1)~-Y = Y - 1 X = 1 -~X = 2 ~-X = 0 Link to comment Share on other sites More sharing options...
Evan Reanimator Posted June 30, 2011 Author Share Posted June 30, 2011 WOW!! Thanks for all the replies, I got it to work perfectly Now am I able to do the same but with textures and without the light. Its for a piece of wall art, so an avatar can touch it until they like what they see. Thanks! Link to comment Share on other sites More sharing options...
Rolig Loon Posted June 30, 2011 Share Posted June 30, 2011 I don't know, Paladin. I think it all depends on the new scripter. When I was just starting, I lurked here for quite a while before finally asking Void how one of her bit flip thingees worked. It was fascinating. I remember taking apart a bunch of freebie scripts and trying to rewrite them with Void's syntax to see if I understood correctly. It was a great exercise, and I learned a lot about things other than bit flipping in the process. I know I'm a little wierd --- as interested in the puzzle as in the solution --- but there have to be other scripters like me .... I hope. Link to comment Share on other sites More sharing options...
Evan Reanimator Posted June 30, 2011 Author Share Posted June 30, 2011 Anyone? Link to comment Share on other sites More sharing options...
Darkie Minotaur Posted June 30, 2011 Share Posted June 30, 2011 What is your question - the original has been answered, right? Link to comment Share on other sites More sharing options...
Void Singer Posted June 30, 2011 Share Posted June 30, 2011 Evan Reanimator wrote: [...] am I able to do the same but with textures and without the light. [...] yes Link to comment Share on other sites More sharing options...
Evan Reanimator Posted June 30, 2011 Author Share Posted June 30, 2011 What would that be? Also I have a movie screen that I want to just loop with a quick clip of something, could anyone point me to a tutorial or script that I could achieve this with? and what format can the clip be? Like does it have to be a .GIF or can it be .MP4? Link to comment Share on other sites More sharing options...
Paladin Pinion Posted June 30, 2011 Share Posted June 30, 2011 Rolig Loon wrote: I don't know, Paladin. I think it all depends on the new scripter. Absolutely, and I didn't mean to sound snarky. And Void's response was not only very kind, but interesting. As a non-flipper, I appreciated it. Maybe both types of answers would be appropriate, since it's hard to know how much experience the poster has. I work in a very high-level language where that kind of thing isn't required, so my eyes glaze when I see it. Human nature being what it is, I assume everyone in the world is like me. Link to comment Share on other sites More sharing options...
Void Singer Posted July 1, 2011 Share Posted July 1, 2011 using the method of storing the uuid or names of inventory items in a list that I outlined above, you'd just replace the color function with the texture function. using a single texture with multiple images in it, you'd change the offsets identically as you do for the color swatch version. Link to comment Share on other sites More sharing options...
Recommended Posts
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