Jump to content

Jotow

Resident
  • Posts

    3
  • Joined

  • Last visited

Reputation

0 Neutral

Recent Profile Visitors

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

  1. I never gave any indicator that would imply that i misunderstood the point of the numbering. I pointed out that it wasn't a necessary component to the process if the OP was just looking to populate buttons with enough information to do the job. But if they do want this use the numbered buttons from a list thankfully we don't 'live' in the prim age anymore. These days, we don't need a second list to match from, you only really need the one UUID list thanks to functions like llGetDisplayName. Which can be easily pulled from the list and converted using llString2Key. ie, llGetDisplayName(llString2Key(avatarUUIDs); with that all you need to do is match the list index point of the list, with the number on the button.
  2. No matter how you do it, you still have to extract and compare that UUID to the detectedName and do a little dance with it, even with a loop through the index locations (and that assumes the UUID and names are in the same index location in both lists). Admittedly, a numbered list may be a more ideal way to go for some, or for a commercial product. I personally have had no use for it. A truncated name on a button still presents me enough information as to who I am looking for.
  3. I see its been nearly a year. But I wanted to pass on how I used some of this code. I removed the particles in my own version (didnt need them). But here is how how i grabbed the UUID from a person In my buttons list. You may want to still use the numbered list, but IMO it's overly convoluted since you're the only one that will be using it. It's possible to use the display names as buttons too, by converting the detected names in your 'avatarList' to display names in the state_entry of the dialog state if you wish. But, anyway, here is how I obtain the UUID for a selected button choice, based on your original script references. MakeParticles(key target) //This is the function that actually starts the particle system. { llParticleSystem([ //KPSv1.0 PSYS_PART_FLAGS , 0 //Comment out any of the following masks to deactivate them | PSYS_PART_INTERP_COLOR_MASK //Colors fade from start to end | PSYS_PART_INTERP_SCALE_MASK //Scale fades from beginning to end | PSYS_PART_FOLLOW_SRC_MASK //Particles follow the emitter | PSYS_PART_FOLLOW_VELOCITY_MASK //Particles are created at the velocity of the emitter | PSYS_PART_TARGET_POS_MASK //Particles follow the target | PSYS_PART_EMISSIVE_MASK //Particles are self-lit (glow) , PSYS_SRC_TARGET_KEY , target , //Key of the target for the particles to head towards PSYS_SRC_PATTERN, PSYS_SRC_PATTERN_ANGLE_CONE ,PSYS_SRC_TEXTURE, "" //UUID of the desired particle texture, or inventory name ,PSYS_SRC_MAX_AGE, 5.0 //Time, in seconds, for particles to be emitted. 0 = forever ,PSYS_PART_MAX_AGE, 1.0 //Lifetime, in seconds, that a particle lasts ,PSYS_SRC_BURST_RATE, 0.02 //How long, in seconds, between each emission ,PSYS_SRC_BURST_PART_COUNT, 2 //Number of particles per emission ,PSYS_SRC_BURST_RADIUS, 2.0 //Radius of emission ,PSYS_SRC_BURST_SPEED_MIN, 5.5 //Minimum speed of an emitted particle ,PSYS_SRC_BURST_SPEED_MAX, 6.0 //Maximum speed of an emitted particle ,PSYS_SRC_ACCEL, <0.0,0.0,-0.8> //Acceleration of particles each second ,PSYS_PART_START_COLOR, <0.0,0.0,1.0> //Starting RGB color ,PSYS_PART_END_COLOR, <0.6,0.6,1.0> //Ending RGB color, if INTERP_COLOR_MASK is on ,PSYS_PART_START_ALPHA, 0.9 //Starting transparency, 1 is opaque, 0 is transparent. ,PSYS_PART_END_ALPHA, 0.0 //Ending transparency ,PSYS_PART_START_SCALE, <2.4,2.4,0.0> //Starting particle size ,PSYS_PART_END_SCALE, <1.3,2.3,0.0> //Ending particle size, if INTERP_SCALE_MASK is on ,PSYS_SRC_ANGLE_BEGIN, PI //Inner angle for ANGLE patterns ,PSYS_SRC_ANGLE_END, PI //Outer angle for ANGLE patterns ,PSYS_SRC_OMEGA, <0.0,0.0,0.0> //Rotation of ANGLE patterns, similar to llTargetOmega() ]); } integer dlgHandle = -1; integer dlgChannel; list avatarList = []; reset() { llSetTimerEvent(0.0); llListenRemove(dlgHandle); dlgHandle = -1; } default { state_entry() { dlgChannel = -1 - (integer)("0x" + llGetSubString( (string)llGetKey(), -7, -1) ); //set to a more personal channel } touch_start(integer total_number) { llOwnerSay("Scanning..."); avatarList = []; llSensor("", NULL_KEY, AGENT, 10.0, PI); // Look for any avatars within 10m. } sensor(integer num_detected) { integer i; while((i < num_detected) && (i < 9)) { if (llDetectedKey(i) != llGetOwner()) { avatarList += [llDetectedName(i)]; } ++i; } if (llGetListLength(avatarList) > 0) { state dialog; } } } state dialog { state_entry() { dlgHandle = llListen(dlgChannel, "", llGetOwner(), ""); // Set up a listener to detect button clicks. llSetTimerEvent(30.0); avatarList += ["Cancel"]; llDialog(llGetOwner(), "Please select an avatar.", avatarList, dlgChannel); } listen(integer channel, string name, key id, string message) { if ((channel == dlgChannel) && (llListFindList(avatarList, [message]) != -1)) { if (message != "Cancel") { // We make a list and key reference to get the target key of the menu. We convert the name // of the target to a string using the list, then convert the string to a key. After we have // the key, we use that key to spew out the displayname of the button name, and pass key to // the objects owner for whatever they need it for. list targetName = []; key targetKey; targetName += [message]; string targetID = (key)llList2String(targetName,0); targetKey = llName2Key(targetID); llSay(0, llGetDisplayName(llGetOwner()) + " pokes " + llGetDisplayName(targetKey)); llOwnerSay("Target key is " + (string)targetKey ); MakeParticles(id); } reset(); state default; } } timer() { reset(); state default; } }
×
×
  • Create New...