Change font size
It is currently Sat Dec 15, 2018 1:03 pm

Forum rules


{L_IMAGE}



Post a new topicPost a reply Page 1 of 1   [ 1 post ]
Author Message
 Post subject: Using llSensorRepeat to make an avatar radar
PostPosted: Sun Aug 03, 2008 9:03 pm 

Joined: Sun Aug 03, 2008 7:30 pm
Posts: 12
It is possible to use llSensor or llSensorRepeat to scan for objects in an area. Here is a simple avatar radar using llSensorRepeat to scan for agents and using the sensor event to read the results using llDetected & friends. See llSensorRepeat and sensor for more information about setting up the sensor. And have a look at Detected for some ideas of the information you can gather inside the sensor event.


default {

state_entry() {
llSensorRepeat("","",AGENT,92.0,PI*2,5.0);
}

sensor(integer _det) {
string radarData = "";
integer x;

for (x = _det - 1; x >= 0; x--) {
radarData += llDetectedName(x) + " : " +
(string) llVecDist(llGetPos(),llDetectedPos(x)) + "m\n";
}

llSetText(radarData,<1.0,1.0,1.0>,1.0);
}

no_sensor() {
string radarData = "No Avatar Detected";
}
}


Top
 Profile  
 
Display posts from previous:  Sort by  
Post a new topicPost a reply Page 1 of 1   [ 1 post ]


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  


Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
610nm Style by Daniel St. Jules of Gamexe.net