Jump to content

SEMaster Aftermath

Resident
  • Posts

    19
  • Joined

  • Last visited

Reputation

1 Neutral

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Thank you everyone, I was able to get the problems solved with everyone's help. I appreciate it
  2. So, now I have the problem of names on the buttons being too long solved (yay). My problem now, is that when I choose a name from the dialog box, it is not associating that name with the appropriate avatar key. I know it has to have something to do with the index number, but I am lost. string gFullName; string gShortName; key gTgt; list gShortNameList; integer gListener; default { state_entry() { myChan = (integer)("0xF" + llGetSubString(llGetOwnerKey(llGetOwner()),0,6)); } touch_end(integer num_detected) { llSensor("",NULL_KEY,AGENT_BY_LEGACY_NAME,10.0,PI); } sensor(integer num_detected) { gFullName = llDetectedName(0); gShortName = llGetSubString(gFullName,0,11); gTgt = llName2Key(gFullName); integer index = 1; while(index < num_detected) { gShortName += ":" + (llGetSubString(llDetectedName(index++),0,11)); } gShortNameList = llParseString2List(gShortName,[":"],[]); llListenRemove(gListener); gListener = llListen(myChan,"",llGetOwner(),""); llDialog(llGetOwner(),"\nChoose target",gShortNameList,myChan); } listen(integer channel, string name, key id, string message) { if(channel == myChan) { llOwnerSay("You selected " + message); llOwnerSay("The key is " + (string)gTgt); << this is where my problem is. It keeps returning the key of the first name on the list, not necessarily the name I chose. } } }
  3. I must be missing something, unable to find any examples or help on how to have the sensor scan an area > assign scanned avatars to buttons in a dialog box > do something with the information on the avatar once clicked from the dialog box. The piece of script I have and posted in the original post works perfectly...unless someone's name is too long. I guess I just need to play around with it and figure out where to llGetSubString part of the name, but the button still coordinate with the avatar. When I try to llGetSubString a name...it returns the key of that name as all zeros (because the name is not real).
  4. That is a great idea Wulfie, thank you for the suggestion. Would definitely get around the character limit for buttons. How would I assign button number to the specific avatar?
  5. I am trying to use a sensor that will find avatars within 10 meters, and when touched will give a dialog menu of the nearby avatars (my problem is the names being to large for the buttons). In my example below, I am simply using an llOwnerSay to tell me the name of the avatar that was chosen, and their key to check my work. I keep getting an error message about the sensed avatar's name being more than 24 characters. Please help, list nameList; integer gListener; default { touch_end(integer num_detected) { llSensor("", NULL_KEY, AGENT_BY_LEGACY_NAME, 64.0, PI); } sensor (integer num_detected) { string names = llDetectedName(0); integer index = 1; while (index < num_detected) names += ":" + llDetectedName(index++); nameList = llParseString2List(names,[":"],[]); llListenRemove(gListener); gListener = llListen(-99,"",llGetOwner(),""); llDialog(llGetOwner(),"Pick name",nameList,-99); } listen(integer channel, string name, key id, string message) { if(channel == -99) { key tgt = llName2Key(message); llOwnerSay("You selected " + message + " with a key of " + (string)tgt); llSetTimerEvent(10.0); } llSetTimerEvent(10.0); } timer() { llListenRemove(gListener); return; } }
  6. Thank you both of you, I will need to read up more on the llDeleteSubList. From what I can see on the wiki though...I need to use the entry number on the list, or can I use the person's name?
  7. Hello everyone, I am working on a creating a waiting list. I currently have the ability for a person to add their name to the list by clicking on the object. However, I would also like to (as the object owner) remove a name from the list if that person is no longer interested in being on the list. I attempted the ListItemDelete function, but can not get it to work. I was hoping it would be as simple as doing the listname -= personname, but I guess lsl doesn't recognize -= like it does the +=. Any help would be appreciated, thank you.
  8. The llGetTime() gave me just what I needed. Thanks!!
  9. Hello. I am working on an attachment that an avatar will wear for a set amount of time (let's say 100 hours). I know how to write the script to count how long the avatar has been wearing the attachment, but that counter restarts whenever the avatar logs off and logs back on SL...so they will never meet the 100 hours. Is it possible to store the amount of time worn somewhere, so when the avatar logs back on, it picks up from that point? I do not want to use the unix time, because the avatar could just stay logged out of SL for the 100 hours, and the script would be pointless. Thanks for any help.
  10. Thank you everyone, all of this has answered my question.
  11. Hello, I am trying to make an Object A (the speaker in my script example below) tell Object B (the listener in my example below) what it's current position is every time it moves. I am not able to get my two objects to communicate with each other though. Please help. Also, is it possible to have Object A say its new position every time it moves? //Globals for speaker object (Object A) vector myLoc; integer chanSpeak = -68497305; // same large negative random number, so both scripts are communicating on same channel //Globals for listener object (Object B) integer Handle; integer chanListen = -68497305; // large negative random number //Script for speaking object (Object A) default { touch_end(integer num_detected) { myLoc = llGetPos(); llRegionSay(chanSpeak,(string)myLoc); } } //Script for listener object (Object B) default { state_entry() { Handle = llListen(chanListen,"","",""); } listen(integer channel, string name, key id, string message) { llSay(0,"I heard this: " + message); // I was hoping my listening object would read back the vector from the speaking object } } Thanks for any assistance with this.
  12. I would like this to work on a mesh head, I tested it on one of the standard SL heads though, you are correct. Does anyone have a suggestion on how to get it to work with a mesh head? As for how I am measuring the lag, not anything very official nor scientific. Just observation on my part and the assumption my script is probably a little heavy due to my minimal experience.
  13. Thank you for the info. Unfortunately, the animation is one of the SL built in emotes (it only opens the avatars mouth) so I do not think it is looped as a normal animation would be. Or, that is the understanding I have.
  14. Hello everyone, I created a gag script and everything is working, but it just seems really inefficient as my novice level is showing. I would be incredibly grateful for any feedback on how to clean this thing up some. The major area I had difficulty with was having the "open mouth" animation continue...and that I believe is what is causing my lagging issue. Here is the script: string anim = "express_open_mouth"; string dmenuText = "\nWhat would you like to do?"; list dmenuButtons = ["Gag","Ungag","Remove"]; integer dmenuChan; string gmenuText = "\nWhat would you like to do?"; list gmenuButtons = ["Ungag","Remove"]; integer gmenuChan; string umenuText = "\nWhat would you like to do?"; list umenuButtons = ["Gag","Remove"]; integer umenuChan; string desc; integer gListener; integer gag1strap1 = 14; integer gag1strap2 = 13; integer gag1strap3 = 12; integer gag1strap4 = 9; integer gag1ring1 = 10; integer gag1ring2 = 11; integer gag1ball = 1; integer gag2strap1 = 6; integer gag2strap2 = 7; integer gag2strap3 = 8; integer gag2strap4 = 3; integer gag2ring1 = 4; integer gag2ring2 = 5; integer gag2ball = 2; integer show = 1; integer hide = 0; inst() { llOwnerSay("Set the strength of the gag with either a 1, 2, or 3 in description field" + "\n1 = no talking" + "\n2 = no talking, no sending IMs" + "\n3 = no talking, no sending IMs, no receiving IMs"); } showgag() { llSetLinkAlpha(gag1ball,show,ALL_SIDES); llSetLinkAlpha(gag1ring1,show,ALL_SIDES); llSetLinkAlpha(gag1ring2,show,ALL_SIDES); llSetLinkAlpha(gag1strap1,show,ALL_SIDES); llSetLinkAlpha(gag1strap2,show,ALL_SIDES); llSetLinkAlpha(gag1strap3,show,ALL_SIDES); llSetLinkAlpha(gag1strap4,show,ALL_SIDES); llSetLinkAlpha(gag2ball,hide,ALL_SIDES); llSetLinkAlpha(gag2ring1,hide,ALL_SIDES); llSetLinkAlpha(gag2ring2,hide,ALL_SIDES); llSetLinkAlpha(gag2strap1,hide,ALL_SIDES); llSetLinkAlpha(gag2strap2,hide,ALL_SIDES); llSetLinkAlpha(gag2strap3,hide,ALL_SIDES); llSetLinkAlpha(gag2strap4,hide,ALL_SIDES); } showungag() { llSetLinkAlpha(gag2ball,show,ALL_SIDES); llSetLinkAlpha(gag2ring1,show,ALL_SIDES); llSetLinkAlpha(gag2ring2,show,ALL_SIDES); llSetLinkAlpha(gag2strap1,show,ALL_SIDES); llSetLinkAlpha(gag2strap2,show,ALL_SIDES); llSetLinkAlpha(gag2strap3,show,ALL_SIDES); llSetLinkAlpha(gag2strap4,show,ALL_SIDES); llSetLinkAlpha(gag1ball,hide,ALL_SIDES); llSetLinkAlpha(gag1ring1,hide,ALL_SIDES); llSetLinkAlpha(gag1ring2,hide,ALL_SIDES); llSetLinkAlpha(gag1strap1,hide,ALL_SIDES); llSetLinkAlpha(gag1strap2,hide,ALL_SIDES); llSetLinkAlpha(gag1strap3,hide,ALL_SIDES); llSetLinkAlpha(gag1strap4,hide,ALL_SIDES); } showremove() { llSetLinkAlpha(LINK_SET,hide,ALL_SIDES); } level1() { llOwnerSay("@sendchat=n"); llOwnerSay("@emote=add"); } level2() { llOwnerSay("@sendchat=n"); llOwnerSay("@sendim=n"); llOwnerSay("@emote=add"); } level3() { llOwnerSay("@sendchat=n"); llOwnerSay("@sendim=n"); llOwnerSay("@recvim=n"); llOwnerSay("@emote=add"); } free() { llOwnerSay("@sendchat=y"); llOwnerSay("@sendim=y"); llOwnerSay("@recvim=y"); } unlock() { llOwnerSay("@detach=y"); llOwnerSay("@touchattachself=y"); } lock() { llOwnerSay("@detach=n"); llOwnerSay("@touchattachself=n"); } default { state_entry() { inst(); showremove(); desc = llGetObjectDesc(); llOwnerSay("Description set at: " + desc); } attach(key id) { llRequestPermissions(id,PERMISSION_TRIGGER_ANIMATION); } changed(integer change) { if(change & CHANGED_OWNER) { llResetScript(); } } touch_start(integer num_detected) { llListenRemove(gListener); dmenuChan = (integer)(llFrand(999999.0) * -1); gListener = llListen(dmenuChan,"",llDetectedKey(0),""); llDialog(llDetectedKey(0),dmenuText,dmenuButtons,dmenuChan); llSetTimerEvent(60.0); } listen(integer channel, string name, key id, string message) { if(message == "Gag") { state gag; } if(message == "Ungag") { state ungag; } if(message == "Remove") { unlock(); showremove(); free(); llStopAnimation(anim); } } timer() { llListenRemove(gListener); } } state gag { state_entry() { llRequestPermissions(llGetOwner(),PERMISSION_TRIGGER_ANIMATION); showgag(); lock(); if(desc == "1") { level1(); } if(desc == "2") { level2(); } if(desc == "3") { level3(); } } run_time_permissions(integer perm) { if(perm) { llStartAnimation(anim); llSetTimerEvent(0.5); } } touch_start(integer num_detected) { llListenRemove(gListener); gmenuChan = (integer)(llFrand(999999.0) * -1); gListener = llListen(gmenuChan,"",llDetectedKey(0),""); llDialog(llDetectedKey(0),gmenuText,gmenuButtons,gmenuChan); } listen(integer channel, string name, key id, string message) { if(message == "Ungag") { state ungag; } if(message == "Remove") { unlock(); showremove(); free(); llStopAnimation(anim); state default; } } timer() { llStartAnimation(anim); } } state ungag { state_entry() { showungag(); unlock(); } touch_start(integer num_detected) { llListenRemove(gListener); umenuChan = (integer)(llFrand(999999.0) * -1); gListener = llListen(umenuChan,"",llDetectedKey(0),""); llDialog(llDetectedKey(0),umenuText,umenuButtons,umenuChan); llSetTimerEvent(60.0); } listen(integer channel, string name, key id, string message) { if(message == "Gag") { state gag; } if(message == "Remove") { unlock(); showremove(); free(); llStopAnimation(anim); state default; } } timer() { llListenRemove(gListener); } }
×
×
  • Create New...