Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Library: 3D Radar

Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
11-28-2007 18:36
Rezzes a ball for each avatar in range. Each ball tracks it's on AV and displays distance.

=========Scanner/Rezzer Script=========

Place this script in a prim along with the scan ball. When touched it will scan the surrounding area and rezz a ball for each avatar.

Suggestion: Create a sphere with a diameter of 2 meters. Set transparency about 60. Create another sphere about 0.05 diameter, color a dark color and put it in the center of the large prim. Select small prim 1st and then large prim and link them. This will give you a center point to reference. The scan ball script is set to scan for it's avatar to a range of 96 meters.

This formula: vector avDivPos = (avPos - rPos) * 0.010417; Takes the (avatars position - position of scanner) & multiplies by (radius of the distance you want the balls to go(2 meter sphere = 1 meter radius)/scan range(96meters)):

1/96 = approximately 0.010417.

CODE
//////////////////////////////////////////////////////////////////////////////////////////////////////
// 3D Radar 2.5
// "Oct 15 2008", "18:43:28"
// Creator: Jesse Barnett
// Released into the Public Domain
//////////////////////////////////////////////////////////////////////////////////////////////////////

integer Scan = TRUE;
string avKey;
integer list_pos;
list key_list;
integer key_chan; //Key channel is generated randomly and passed to the scan ball
integer die_chan = -9423753; //Hey pick your own channels and be sure to paste them into
//the scan balls too!
integer key_rem_chan = -49222879;
default {
state_entry() {
llSetObjectName("3D Radar");
}
touch_start(integer total_number) {
if (Scan) {
llSensorRepeat("", "", AGENT, 96, PI, 1);
key_list =[];
llListen(key_rem_chan, "", "", "");
llOwnerSay("on");
Scan = FALSE;
}
else {
llSensorRemove();
llRegionSay(die_chan, "die");
llOwnerSay("off");
Scan = TRUE;
}
}
sensor(integer iNum) {
integer p = 0;
for (p = 0; p < iNum; ++p) {
avKey = llDetectedKey(p);
list_pos = llListFindList(key_list, (list)avKey);
if (list_pos == -1) {
key_list += (list) avKey;
key_chan = (integer) llFrand(-1000000) - 1000000;
llRezObject("scan ball", llGetPos(), ZERO_VECTOR, ZERO_ROTATION, key_chan);
llSleep(.25);
llRegionSay(key_chan, avKey);
}
}
}
listen(integer c, string name, key id, string msg) {
integer r = llListFindList(key_list,[(key)msg]);
key_list = llDeleteSubList(key_list, r, r);
}
}

===========Scan Ball Script==========

Place this script in a prim and then place the prim into the inventory of the Scanner/Rezzer. It will automatically name itself.

Suggestion; Create a sphere prim of 0.05 diameter with glow set about .80.
CODE

//////////////////////////////////////////////////////////////////////////////////////////////////////
// 3D Radar 2.5
// "Oct 15 2008", "18:44:36"
// Creator: Jesse Barnett
// Released into the Public Domain
//////////////////////////////////////////////////////////////////////////////////////////////////////

string avName;
integer avDistance;
key avKey;
integer avListen;
integer key_chan;
integer die_chan = -9423753;
integer key_rem_chan = -49222879;
vector avPos;
vector rPos;
default {
state_entry() {
llSetObjectName("scan ball");
}
on_rez(integer start_param) {
rPos = llGetPos();
key_chan = start_param;
llListen(die_chan, "", "", "");
avListen = llListen(key_chan, "", "", "");
}
listen(integer c, string n, key id, string msg) {
if (c == die_chan)
llDie();
else {
avKey = (key) msg;
avName = llKey2Name(avKey);
llSensorRepeat("", avKey, AGENT, 96, PI, 1.0);
llListenRemove(avListen);
}
}
sensor(integer n) {
avPos = llDetectedPos(0);
vector avDivPos = (avPos - rPos) / (96 / 1); //Scan range/Radius of large sphere
avDistance = (integer) llVecDist(rPos, llDetectedPos(0));
llSetPos(rPos + avDivPos);
llSetText(avName + "[" + (string) avDistance + "]", <1, 1, 1 >, 1);
}
no_sensor() {
llRegionSay(key_rem_chan, avKey);
llDie();
}
}


To see it formatted: https://wiki.secondlife.com/wiki/3D_Radar
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime.
From: someone
I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
Nada Epoch
The Librarian
Join date: 4 Nov 2002
Posts: 1,423
12-05-2007 11:38
library bump
_____________________
i've got nothing. ;)
Frazospazo Zamani
Uniqueness
Join date: 10 Nov 2007
Posts: 38
12-11-2007 01:14
This is awesome..
Welldone.
Jonar Boa
Registered User
Join date: 3 Mar 2007
Posts: 9
12-11-2007 02:47
This is great work. Love it.

I made a piece of furniture for my home out of it.

Decorative and useful.

Thanks for sharing.
Johan Laurasia
Fully Rezzed
Join date: 31 Oct 2006
Posts: 1,394
12-11-2007 03:41
Very nice, concise, I made mine with an offset scale of 0.10416666666666666666666666666667 (10 times yours) so that it moves 10 meters (instead of one) across the 96 meter range. That way, the scan ball will move across an entire full sized prim ;)
Frazospazo Zamani
Uniqueness
Join date: 10 Nov 2007
Posts: 38
12-11-2007 04:25
That's a good idea Johan, but I think it depends on how much space you have, or how much space you want to use.

But that's awesome to know.
:)
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
12-11-2007 05:14
Yep. That was why I put the formula up top and did an explanation of it. It can come in handy for a few different things.
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime.
From: someone
I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
Bjorn Collins
Will draw for food..
Join date: 2 Sep 2007
Posts: 18
Nice script Jesse!
12-13-2007 08:53
Just to show how this can be made, I made the root as a box instead, and made it in the exact size needed, so if I'm 96 meters away my little sphere is exactly at the edge of the area, etc.

Then I used the LL water, as ground (having the root prim just below the water) to have the most awesome effects, with the glow on the little sphere. Check out the screenshot!

(the tiny little dot is me, either im too far away to see the name or the screen just doesnt include hovertext - what would I know)

http://www.bjornsveistrup.dk/files/3dradar_001.jpg

* Im working on getting the script to change the color of the little sphere, when a new avatar shows up, so its easy to see who is who, regardless of the names shown.
Rhaorth Antonelli
Registered User
Join date: 15 Apr 2006
Posts: 7,425
12-24-2007 15:18
love the screenshot

while looking for something else to do with scripting I see this one and wanna try this hehe, I love how you did it with the water

nice
_____________________
From: someone
Morpheus Linden: But then I change avs pretty often too, so often, I look nothing like my avatar. :)


They are taking away the forums... it could be worse, they could be taking away the forums AND Second Life...
Raphory Repine
Registered User
Join date: 16 May 2007
Posts: 9
12-25-2007 14:32
Hi all, very handy script! My only complain is about the way the distance is displayed, above each little scan ball.

Right now it says for example : "Raphory Repine(14,09094)"

I don't need such a precision :) Is it possible to change a line of the scan ball script, so that it says something like: "Raphory Repine(14,09)"? The whole device would be far more readable to me!

Regards

Raph
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
12-25-2007 16:43
change
avDistance = (string) llVecDist(rPos, llDetectedPos(0));
to
avDistance = (string) (llRound( llVecDist( rPos, llDetectedPos(0) ) * 10 ) / 10);
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
12-26-2007 18:11
WOW, Cool to have a response like this and glad everyone is having fun playing with these scripts. Definitely a unique and awesome job you did there Bjorn.

Hope everyone had as great a Christmas as we did.
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime.
From: someone
I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
Uriel Blackadder
Registered User
Join date: 21 Aug 2007
Posts: 1
blips are dying
01-03-2008 18:22
whenever i speak near my radar ball or a friend of mine does, all the radar blips except mine (the owners) disappear. anyone else experienced this? if so, how would i fix it?

otherwise this is a great tool.
Sasha Nurmi
Registered User
Join date: 26 Nov 2006
Posts: 2
05-12-2008 06:52
seems to be broken now :/
as I move out of scan range and back in, it doesn't spawn a new marker
anyone know whats wrong with it?
did everything as the guide said
Meta Starostin
Registered User
Join date: 5 Jul 2007
Posts: 56
05-20-2008 08:10
Yes Sasha, I have the same problem. If I relog its the same problem.
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
05-20-2008 14:08
Apologies Sasha & Meta,

I didn't notice a posting with a problem until Meta's post. I'll go in world tonight and see if there is a problem or if a jira bug needs to be filed for something new.
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime.
From: someone
I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
05-22-2008 17:39
Edit; problem found and solved.
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime.
From: someone
I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
Talarus Luan
Ancient Archaean Dragon
Join date: 18 Mar 2006
Posts: 4,831
05-23-2008 16:53
That can't be correct, Jesse.

We've got temp rezzers, and they continue to work when the owner isn't around.

Not to mention the fact that holovendors and ad billboards for a common ad system would stop working if that were the case.

Are you sure about this?
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
05-23-2008 17:27
From: Talarus Luan
That can't be correct, Jesse.

We've got temp rezzers, and they continue to work when the owner isn't around.

Not to mention the fact that holovendors and ad billboards for a common ad system would stop working if that were the case.

Are you sure about this?

I am going to start with a simple temp on rezzer and work up from there this weekend and see what happens. But I do recall playing with a temp on rezzer a few months back and seeing the same thing. As soon as I left the sim it would stop working until I came back, confirmed that one with an alt.

Have seen a mention of of similiar behaviour a couple of times in passing, but never had the time to flesh it out. LL algorithm for taking temp on rezzer load off of the simulators?
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime.
From: someone
I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
Barrington John
Yorkshire guy
Join date: 17 Nov 2007
Posts: 119
05-24-2008 10:30
I think for temp rezzing, isn't it necessary to have the rezzing prim's group set to the group that owns the land it's on? You don't need to deed it, just set its group. If that's not done, the rezzing doesn't work when the owner leaves the sim (or logs out, maybe).

I've no idea what happens on individual-owned land, and this is old memory anyway from messing about with temp rezzers.

EDITED TO ADD: Note that this is not the deletion problem Jesse fixed
Kitty Barnett
Registered User
Join date: 10 May 2006
Posts: 5,586
05-24-2008 10:47
From: Jesse Barnett
Problem found but not solved yet. LL has changed the way temp on rezzers work, unfortunately this affects any kind of rezzer. When the owner leaves the simulator the script is in, the script is disabled. At one point the script was re-enabled when the owner returned, I don't know if that still holds true.
What are the permissions on the land you're trying this on (and avie owned with/without set to group vs group-owned)? :confused:

If Create Objects is turned off for "Everyone" and "Group" for instance on group-deeded land then the group permissions come into effect, but those permissions only apply to avies and not to scripts.

As long as you're on the sim, the script runs under your own personal group permissions and will happily rez anything, but as soon as you leave the sim (about 30 seconds - 2 minutes after) it will loose its ability to rez new objects.

The solution is to either check "Group" again for "Create Objects" (and obviously have the object to the proper group), or to deed the object to the group since the land owner can always rez.
Barrington John
Yorkshire guy
Join date: 17 Nov 2007
Posts: 119
05-24-2008 13:59
I've just confirmed by testing that the scanner works on group-owned land when its owner is logged out, simply by setting the group on the object to be the land-owner group and logging out, then logging in an alt to check the scanner. This confirms my memory above.

Note that it is NOT necessary to deed the object to the group - just set the group value on the object.
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
05-24-2008 14:17
Already found the problem and will post the corrected scripts in a little bit. At some point I had posted a beta version with:

llDeleteSubList(key_list, r, r); which of course won't return the corrected list. Should be:
key_list = llDeleteSubList(key_list, r, r);

But that still wasn't the big problem. It wasn't able to find the key to remove when it was cast as a key:
key remove_key = msg;
integer r = llListFindList(key_list,[remove_key]);

Changing it to :
integer r = llListFindList(key_list,[msg]);
Worked!
Ah well, must have been an off day :(

EDIT: Corrected scripts posted. Now people can see why I started using esl to generate the header info with version, time and date just so stuff like this doesn't happen.
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime.
From: someone
I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
Meta Starostin
Registered User
Join date: 5 Jul 2007
Posts: 56
05-25-2008 08:04
Very cool and thanks Jesse.
All I need to do now is make it a cube instead of a sphere so I can put a region map or land sculptie inside.
Marcha Chaika
Registered User
Join date: 2 Apr 2006
Posts: 5
olmost great
05-27-2008 12:27
still found a error it not takes out the good key when you start run it when 2 ppl there it will put 1 name on both bals :) and when 1 leave areea that person comes back gets entered with the other avie name how i fix this?
1 2