|
Smithy Zeno
ownes 9 pet cacti
Join date: 3 Aug 2006
Posts: 52
|
07-10-2008 13:25
Hey all, Inspired by the threat "Sensor limited to 16?" (by JPT62089 Agnon), I made an attempt to make a script that takes lists of people and their distances from two sensors and then 'glues' the two lists together. Here is what I have so far: Script that puts the two lists together. list everything; integer counter; integer main;
Update() { llSetText("Detected:\n"+llDumpList2String(everything,"\n"),<1,1,1>,1); llResetScript();//Restart the process..... }
default { state_entry() { main = 0; }
link_message(integer sender_num, integer num, string str, key id) { if(sender_num == 2) { everything += llParseString2List(str,["||"],[]); ++main; } else if(sender_num == 3) { everything += llParseString2List(str,["||"],[]); ++main; } if(main == 2) { Update(); } } }
One of the two scripts that get the people's names and distances. default { state_entry() { llSetTimerEvent(.5); } timer() { llSensor("","",AGENT,96,PI_BY_TWO); } sensor(integer num) { integer dist; string name; list names; integer i; names = []; for(i=0;i<num;i++) { dist = llRound(llVecDist(llGetPos(),llDetectedPos(i)));//detect distance name = llDetectedName(i);//detect name string line = name +" @ "+(string)dist+" M"; names += line; } llMessageLinked(LINK_SET,0,llDumpList2String(names,"||"),""); } }
The main script gets the people's names and distances, but both are repeated twice and the list is out of order in the main script (distance wise). If someone could give me a hand, that'd be great.
_____________________
-Smithy
|
|
Darien Caldwell
Registered User
Join date: 12 Oct 2006
Posts: 3,127
|
07-10-2008 13:31
if you fire off two sensors from the same location and same prim, they will both pick up the exact same list of avatars. The two sensors need to be in different locations, or in separate prims facing different directions. I see your script uses PI_BY_TWO, so you are scanning a half hemisphere. Turn the first sensor prim 180 degrees from the second, and each would have a potential to scan 16 avatars on their respective side. But it's still no guarantee to get all avatars.
Most professional scanners employ 5 or more roaming scanner objects which follow pre-calculated routes and report back to a base object what they encounter. A fair amount of planning is involved.
|
|
Smithy Zeno
ownes 9 pet cacti
Join date: 3 Aug 2006
Posts: 52
|
07-10-2008 13:35
From: Darien Caldwell if you fire off two sensors from the same location and same prim, they will both pick up the exact same list of avatars. The two sensors need to be in different locations, or in separate prims facing different directions. I see your script uses PI_BY_TWO, so you are scanning a half hemisphere. Turn the first sensor prim 180 degrees from the second, and each would have a potential to scan 16 avatars on their respective side. But it's still no guarantee to get all avatars. Thats what I did, I turned both prim opposite of eachother. But the list still has some people repeated.
_____________________
-Smithy
|
|
Dora Gustafson
Registered User
Join date: 13 Mar 2007
Posts: 779
|
07-10-2008 14:03
if you are wearing the detector you may easily turn a few degrees in ½ a second and get the same agent on both sensors, no?
_____________________
From Studio Dora
|
|
Smithy Zeno
ownes 9 pet cacti
Join date: 3 Aug 2006
Posts: 52
|
07-10-2008 16:06
From: Dora Gustafson if you are wearing the detector you may easily turn a few degrees in ½ a second and get the same agent on both sensors, no? I was testing the detector on the ground. Any other thoughts?
_____________________
-Smithy
|