DariusFinch Posted March 3, 2016 Posted March 3, 2016 So, essentially. What I'm hoping to do is write a script that reads the info of all those present in a paricular sim, including their UUID/current co-ords, and reports it in an orderly fashion from nearest to furthest. Is that possible?
Rolig Loon Posted March 3, 2016 Posted March 3, 2016 Use llGetAgentList and llGetObjectDetails. That's what they are for.
steph Arnott Posted March 3, 2016 Posted March 3, 2016 Yes it possible, the script will probably crash with all that info. Thou think i be inclined to use llGetAgentSize along with Roligs suggestions.
Madelaine McMasters Posted March 3, 2016 Posted March 3, 2016 And once you've used those two functions, you're going to have to learn how to manage lists. The list of agent keys (UUIDs) returned by llGetAgentList will be in random order. You want them sorted by distance from the script. So you must execute llGetObjectDetails once for every agent in the list, building another list containing the UUID, position, and distance from the script, for each agent. Distance isn't reported, so you must calculate it from both the script's position and that of each agent. Once that list is built, you'll sort it with llListSort. That sorts on the first element of each "stride", where a stride is the sub-list of data you obtained from each agent. You select the stride size to encompass the information you've obtained/calculated from each agent. And because sorts are done on the first element of each stride, you'll want to build that llGetObjectDetails list with each agent's distance information first, followed by UUID and then position. If that's all you collect/report, your stride will be three.
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