Jump to content

Life Camino

Resident
  • Posts

    127
  • Joined

  • Last visited

Everything posted by Life Camino

  1. How do I construct this loop? Here is what I am wanting to do: I have ten prims linked together. I also have five shades of blue that I wish to paint on the prims in sequence. I want the sequence staggered, so that each successive prim is showing the next color in the sequence, but I want each prim to be cycling between all five shades of blue at the same time. For example: On the first pass, the prims would have this color sequence: p1 = c1 p2 = c2 p3 = c3 p4 = c4 p5 = c5 p6 = c1 p7 = c2 p8 = c3 p9 = c4 p10 = c5 On the second pass, the prims would have this color sequence: p1 = c2 p2 = c3 p3 = c4 p4 = c5 p5 = c1 p6 = c2 p7 = c3 p8 = c4 p9 = c5 p10 = c1 On the third pass, the prims would have this color sequence: p1 = c3 p2 = c4 p3 = c5 p4 = c1 p5 = c2 p6 = c3 p7 = c4 p8 = c5 p9 = c1 p10 = c2 On the fourth pass, the prims would have this color sequence: p1 = c4 p2 = c5 p3 = c1 p4 = c2 p5 = c3 p6 = c4 p7 = c5 p8 = c1 p9 = c2 p10 = c3 On the fifth pass, the prims would have this color sequence: p1 = c5 p2 = c1 p3 = c2 p4 = c3 p5 = c4 p6 = c5 p7 = c1 p8 = c2 p9 = c3 p10 = c4 The cycle would then be repeated. I want to use a timer, so I can vary the speed at which the colors are cycling. So, how do I construct the necessary loops to accomplish this? I am able to use LSL well enough that I don't need help with the syntax of the script, so much as I need help in constructing the logic of the loop. I will be using llSetLinkPrimitiveParamsFast to set the colors for the prims. And, I have put the color vectors in a list, called colors. Thank you, for any help you can offer. EDIT: I figured out the loop structure and added another set of ten prims, plus a couple of other prims that are not being colored. So, here is what I came up with: list colors= [<0.400, 0.753, 1.000>,<0.502, 0.796, 1.000>,<0.600, 0.835, 1.000>,<0.698, 0.878, 1.000>,<0.800, 0.918, 1.000>,<0.400, 0.753, 1.000>,<0.502, 0.796, 1.000>,<0.600, 0.835, 1.000>,<0.698, 0.878, 1.000>,<0.800, 0.918, 1.000>]; integer top=3; integer bottom=2; vector color; integer idx; integer pass; default { state_entry() { llSetTimerEvent(0.5); } timer() { integer i=2; if (pass<0) pass=9; idx=pass; do { color=llList2Vector(colors, idx); llSetLinkPrimitiveParamsFast(i, [PRIM_COLOR, ALL_SIDES, color, 1.0]); ++i; llSetLinkPrimitiveParamsFast(i, [PRIM_COLOR, ALL_SIDES, color, 1,0]); ++idx; if (idx>9)idx=0; } while (++i < 22); --pass; } } Thanks, for the help!
  2. I'm working on a little space shuttle with a menu system that has sounds that are triggered when menu selections are made. The problem is that, occasionally, the most recent sound will be triggered repeatedly - by unrelated events. Like clicking the camera buttons or opening or closing the inventory window, or opening or closing a script window can cause the most recent sound played to be triggered, again. But, the script isn't reacting to anything that the user might be doing. For example, you touch the shuttle for the main menu and get a "ding" and the main menu pops up like it should. Then, you click the camera button to change your view and get another "ding" every time you click it - but, not every time - just intermittently. Make a menu selection that triggers a different sound, and now that's the sound that gets triggered erroneously. The sounds should only be triggered on touch (when the main menu is brought up), or when they make a menu selection. It's possible, maybe even probable, that this is some kind of viewer problem - except., that I have other menu-driven objects that play sounds on menu select that don't exhibit this strange problem. The sounds are also being played by the object - in other words, I can be 20M away from the shuttle, click my camera buttons, and trigger the sound being played by the shuttle. I can tell it is the shuttle in the distance playing the sound. I've searched and searched through my code for any clues that might cause this, and I really don't want to put others through doing that, too, if someone else has experienced the same issue or similar and has an idea of what causes it and how to solve it. The problem exhibits itself using either Phoenix or Firestorm (latest versions of each). I haven't tried any other clients. Any insight into this would be greatly appreciated.
  3. I was just wondering what the considerations are regarding open listens and when they should be closed? I'm working on a little space shuttle that can be operated by a HUD, including starting, stopping, cloaking, color and texture changes, etc. so I feel like I need my listens open all the time in the ship script so it can hear commands from the HUD. Is this a problem? Or, is there a good way to manage the listens properly while meeting the requirement that the ship always hear commands from the HUD? And, can leaving listens open cause any kind of problems either in the script they are in, other scripts in the object, or for the client? Thanks, for any insight you can offer on this subject.
  4. I wrote the script below to change weapon particle effect colors. It triggers on the change of color of the prim in which it resides. So, you can set the color using the SL color picker, and the exact color vector will be sent region wide to a receiver. Then, you can pass the color vector to your particle script as discussed above. I also integrated this script with a menu system that had nine preset colors. as well. But, this script will give you over 16,500,000 colors. Hope you find this useful: vector color=<1.0,1.0,1.0>; integer CHANNEL; //Channel for sending color vector key owner; //This script relays the color of face 0 of this prim to a receiver anywhere in the same region default { state_entry() { owner=llGetOwner(); color=llGetColor(0); } link_message( integer sender_num, integer num, string str, key id ) { if (str=="command codes") //This is the channel used by the receiver { CHANNEL=num; llListen(CHANNEL,"","",""); llMessageLinked(LINK_SET,96, (string)color,""); } } changed (integer type) { if (type & CHANGED_COLOR) { color=llGetColor(0); if(CHANNEL!=0) { llRegionSay(CHANNEL, "/weapon "+(string)color); llMessageLinked(LINK_SET, 96, (string)color,""); } } } listen (integer channel, string name, key id, string message) {//If colors are changed by the menu system on the ship, we update the color of our HUD button accordingly if (channel==CHANNEL && llGetOwnerKey(id) == owner && llGetSubString(message, 0, 6)=="/weapon") { color=(vector)llGetSubString(message, 8, -1); llSetColor(color, 0); } } }
  5. I contacted Cheshyr Pontchartrain who created emDash and he was good enough to share this information. You must play a sound to trigger the TPV to chat the keys in the region. llTriggerSound("76c78607-93f9-f55a-5238-e19b1a181389", 1.0); That did the trick! Thanks, and hopefully others can benefit from this little tidbit.
  6. I'm not trying to figure out how to trigger my scanner script. I'm trying to figure out how to get my Phoenix or other TPV to chat the avatar keys in the region. They do this automatically whenever avatars enter or leave the region. But, if the scanner is turned on, and no avatars come or go, it just sits there - because, it's receiving no data. But, as soon as an avatar comes or goes, or as soon as I turn on emDash's built in HUD scanner, the TPV chats the keys. That's what I'm trying to trigger. Sorry for the confusion. And, thanks for your help. It is much appreciated.
  7. Hi Rolig, I tried chatting "switch on" on channel -777777777; but, it didn't do anything. I use emDash, too, and whenever I trigger emDash's built in HUD scanner it triggers the viewer and my scanner receives the info, but I'm not seeing any "switch on" or "switch off" messages on that channel. I'm just capturing whatever is heard on -777777777 and using llOwnerSay to let me know what is being received by the listen event in the script. Any other suggestions? Thanks.
  8. Yes, the data is being chatted by a TPV - Phoenix, in this case.
  9. I'm writing a sim-wide scanner script that uses the information chatted on channel -777777777 and I've got most everything worked out; but, I don't know how to initiate the viewer chatting the information. It works fine if an avatar enters or leaves the region - that triggers it. But, how do I trigger it manually when I turn on the scanner? Thanks. The script follows: (pardon the trouble-shooting llOwnerSay messages - I'm still learning.) list avatars; default { state_entry() { llListen(-777777777,"","",""); llSetTimerEvent(2.0); llSetText("",<1.0,1.0,1.0>,1.0); } timer() { llSetText("",<1.0,1.0,1.0>,1.0); string hov_text=""; integer num_recs=llGetListLength(avatars); list avi_names=[]; integer i; for (i=0;i<num_recs;i++) { string cur_name=llKey2Name(llList2Key(avatars, i)); key curr_avi=llList2Key(avatars, i); list avi_pos=llGetObjectDetails(curr_avi, ([OBJECT_POS])); vector avi_vec=(vector)(llList2String(avi_pos, 0)); integer distance =(integer)llVecDist(llGetPos(), avi_vec); if (cur_name!="") { avi_names+=cur_name; hov_text+=llList2String(avi_names, i)+ "[" + (string)distance + "M]\n"; llSetText(hov_text,<1.0,1.0,1.0>,1.0); } } } listen(integer channel, string name, key id, string message) { if (channel==-777777777) { llOwnerSay("This is what I'm receiving..." + message); list tmplist=llCSV2List(message); llOwnerSay("My tmplist looks like this " + (string)tmplist); key curr_avi= llList2Key(tmplist, 2); llOwnerSay("curr_avi's name is " + llKey2Name(curr_avi)); if (llListFindList(avatars,[curr_avi])==-1 && llList2Integer(tmplist, 1) > 0) { avatars+=[curr_avi]; if (~llListFindList(avatars, [curr_avi])) { llOwnerSay("We just added " + llKey2Name(curr_avi) + " to our avatars list."); llOwnerSay(llKey2Name(curr_avi) + " is located at " + (string)llGetObjectDetails(curr_avi, [OBJECT_POS])); list avi_pos=llGetObjectDetails(curr_avi, ([OBJECT_POS])); vector avi_vec=(vector)(llList2String(avi_pos, 0)); integer distance =(integer)llVecDist(llGetPos(), avi_vec); llOwnerSay("which is " + (string)distance + "M away."); } } else if (~llListFindList(avatars, [curr_avi]) && llList2Integer(tmplist, 1) == 0) { integer index = llListFindList(avatars, [curr_avi]); llOwnerSay(llKey2Name(curr_avi) + " was found in our avatars list at index "+ (string)index); avatars=llDeleteSubList(avatars, index, index); if (~llListFindList(avatars, [curr_avi])) { llOwnerSay(llKey2Name(curr_avi) + " is still in the list."); } if (!~llListFindList(avatars, [curr_avi])) { llOwnerSay("We just deleted " + llKey2Name(curr_avi) + " from our avatars list"); } } //llOwnerSay("avatars = "+(string)avatars); } } }
  10. I want to add sensors to a little space ship and I want them to be able to scan for and retrieve the names and locations of all avatars in a region. How would I do that with LSL? In lookiing at the llSensor and llSensorRepeat commands and the sensor event, it looks like 96M is the limit, but I know there are radar HUDs (like Novatech's emDash) that can scan for avatars throughout a region. How do I overcome the 96M limitation?Thanks, Life
  11. I want to add sensors to a little space ship and I want them to be able to scan for and retrieve the names and locations of all avatars in a region. How would I do that with LSL? In lookiing at the llSensor and llSensorRepeat commands and the sensor event, it looks like 96M is the limit, but I know there are radar HUDs (like Novatech's emDash) that can scan for avatars throughout a region. How do I overcome the 96M limitation? Thanks, Life
  12. Perhaps, the best way is to just buy some. But, you can also get a job and do things like pole dance, host parties, manage clubs, manage properties, model clothing (if you have a dynamite avatar), become a sales clerk/greeter, and other odd jobs. Another way to generate funds is to play sploders in Second Life clubs. A sploder is a game where everyone pays into it and when a certain number of people have entered, a countdown starts and at the end of the countdown, the sploder pays out all the money randomly to those who paid in so you might win more than you put in and you might not.. Usually, club owners will fund the sploder with enough cash to ensure that no one goes away a loser and you might even go away with a few hundred lindens. The best way to make lindens in Second Life is to become a content creator and sell your wares both in world and on the Marketplace. But, that takes time to learn how to create. Welcome to SL and have fun!
×
×
  • Create New...