NeonSteamPunk Posted January 4, 2016 Share Posted January 4, 2016 I do not know much about this so I will explain what I am trying to do . I do not even have a script made to post.I have a link set with 11 prims linked together.I would like to make a list of the prims names from link 2 to 10.Somthing tells me doing trying to do the below is all wrong...list names = [ (string)llGetLinkName(2),(string)llGetLinkName(3),(string)llGetLinkName(4),(string)llGetLinkName(5) ,(string)llGetLinkName(6),(string)llGetLinkName(7),(string)llGetLinkName(8),(string)llGetLinkName(9),(string)llGetLinkName(10)] So my first question is what would be the best way to compile a list using 10 to 20 linked prims names or is the above the only way?My second questions, using my list I made from the above question I like to read the names and make a second list from any name that differs from a selct word.example if the list is ["OPEN","OPEN","AVATAR UUID","OPEN","AVATAR UUID","OPEN"] I like to make a 2nd list of only the avatar uuids and not the word "OPEN".In the end I would have a list of prim names that are not "OPEN" but ony a list of avatar uuids for the prims names. I am not sure the best way to explain this but if any one can understand my question I love a little help. Link to comment Share on other sites More sharing options...
Qie Niangao Posted January 4, 2016 Share Posted January 4, 2016 You might loop* from 2 to 10, appending (+=) the name of each link to the first list and testing the "OPEN" match to decide whether to also append the name to the second list. If you could use help scripting such a loop, we can do that in another post. My first question, though, is whether you're sure 2 and 10 will always be the right numbers, or if instead the script might someday be used in a linkset with different elements? I also wonder about getting "only a list of avatar uuids for the prims names." That makes perfect sense if all the other, non-"OPEN" prims are somehow already named with avatar uuids. It's just not clear how that works, but if it's outside the scope of the problem, never mind. ________ * It can be written with any of the loop constructs, but this seems to fit a for loop pretty naturally. Link to comment Share on other sites More sharing options...
Rolig Loon Posted January 4, 2016 Share Posted January 4, 2016 Let me make a guess that each of the prims you are concerned about is a potential seat on your object -- a bus, perhaps, or a long park bench? --- and that you will ultimately need to know whether a seat is occupied or available for a new av to sit on. That's a fairly common scripting problem. The logic can be truly complicated, depending on whether you want to have your script assign seats randomly or get users a choice of where to sit. You do have one very simple shortcut in LSL if it fits your conceptual design and if you have prims to burn for individual seats. Use llLinkSitTarget and llAvatarOnLinkSitTarget to designate specific seats in your linkset and check to see if they are occupied. If you are saving prims and trying to seat multiple avs on a small number of prims, it can get hairy. I suggest that you take a step backwards and map out the logic first. Do it on paper as a flow chart if you need to. If you leap into the details of how to create a list and what the syntax of your statements should be, you'll get frustrated very quickly. Link to comment Share on other sites More sharing options...
NeonSteamPunk Posted January 5, 2016 Author Share Posted January 5, 2016 The script is part of a RP tool, a pager HUD for a hosspital. The user can drop a list of people around them and add DR,Nursse what ever to their pager HUD. When added it will replace the name "open" with a uuid.When they want to page people it will drop a list of who uuid is in the HUD (the reason for the ssecond list) .then the user has a textbox to place the message and it them instat messages the person they choose the message from the drop box. this part of a hosspital rp , a simple pager tool is all im making. Link to comment Share on other sites More sharing options...
Rolig Loon Posted January 5, 2016 Share Posted January 5, 2016 If I understand correctly, it sounds as if you can do everything with a single permanent list with one entry for each prim (each pager line) in your HUD. An entry contains either a person's UUID or a placeholder ("Open" or "0" or NULL_KEY -- I'd prefer NULL_KEY). You run a timer that updates, say, once every 10 or 15 seconds. Each time it updates, the script makes a temporary list of the UUIDs of nearby avs and then 1. Compares the saved list with the temporary list. If a UUID is on the saved list but not the temporary list, remove the UUID from the permanent list and replace it with the placeholder. This produces a version of the permanent list that is corrected for people who have left the area. Then 2. Compares the temporary list with the saved list For each UUID on the temporary list, look to see if it is also on the permanent list. If so, leave it there. If not, replace the first placeholder entry with that UUID. That produces a version of the permanent list that if corrected to include people who have recently entered the area. So, two sweeps through the lists and you have an updated permanent list. You display the names in hover text on your HUD's linked display prims, ignoring any entries that have a placeholder in them rather than a UUID. Link to comment Share on other sites More sharing options...
steph Arnott Posted January 5, 2016 Share Posted January 5, 2016 I know you have an I.Q of 6 milllion, but most of us humans are at best barely get too 100. What did that all that mean? Link to comment Share on other sites More sharing options...
NeonSteamPunk Posted January 5, 2016 Author Share Posted January 5, 2016 I kind of get what you arre saying but it does not really explain much. there is no flaoting text,the system simple allows you to log uuids to prim names so its a perm thing and no risk of loosing them on a reset. Bottom line we are trying to give the usser the ability to add up to 20 fellow RPers in their HUD for long term storage, some might have 2 uuids others might have 20.Using string data stored in prim names will insure no lost or a user having to carry a list from sim to sim.I do not thik a timer is needed as this is not a list that changes much. I dout I explained it correct the first 2 times,Hope this explains a little bett Link to comment Share on other sites More sharing options...
NeonSteamPunk Posted January 5, 2016 Author Share Posted January 5, 2016 I figure it out ussing a greeter script,I have a button that is linked to a function I made. The function loops the first list of prim namre making a 2nd list of uuids and not the word"open". I ussed the += for the word "open" leeaving me with a list of uuids,the fact that some user will have different amounts and the prim names a set order of links made it easy to mod the greeter script. Thank you for your input it helped me to choose the correct open source script to asssist me in this Link to comment Share on other sites More sharing options...
Rolig Loon Posted January 5, 2016 Share Posted January 5, 2016 there is no flaoting text,the system simple allows you to log uuids to prim names so its a perm thing and no risk of loosing them on a reset. Exactly. That's why I would use floating text in the HUD. It, too, is safe from reset. But still, that's a detail. Whether you use prim names or put the same information hover text on the prims, the technique is the same. The hover text is nice because it is both a storage method AND a display method. If you don't use hover text, then you still have to have some way to put people's names on the HUD. I do not thik a timer is needed as this is not a list that changes much. That's good to know, because it makes the job MUCH simpler. I thought you were wanting to restrict the pager to only people nearby. If so, there had to be a way to update it frequently. Since that's not necessary, all you need is a simple dialog that has two buttons. One button triggers a way for you to enter a new name. I'd prefer a quick scan of nearby avs, which would give you a list to choose from, but you could take a longer route and add them in chat or in a text box. The other button would let you delete any specific av from the HUD. Your link names or hover text contents are the equivalent of the single "permanent" list that I recommended before. When you go to add a name, you query all prims to see if there is one that already has the person's UUID on it. If so, you don't add the name. If not, you add the UUID to the first prim that has a placeholder. Link to comment Share on other sites More sharing options...
Rolig Loon Posted January 5, 2016 Share Posted January 5, 2016 NeonSteamPunk wrote: I figure it out ussing a greeter script,I have a button that is linked to a function I made. The function loops the first list of prim namre making a 2nd list of uuids and not the word"open". I ussed the += for the word "open" leeaving me with a list of uuids,the fact that some user will have different amounts and the prim names a set order of links made it easy to mod the greeter script. Thank you for your input it helped me to choose the correct open source script to asssist me in this That sounds very much like what I suggested. Nice work. 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