Jump to content

Avatar Coordinate


dalocogamer
 Share

You are about to reply to a thread that has been inactive for 4054 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

Creating hud that will at a push of a button will display avatar coordinate in owner chat. This is what I have so far. 

default
{
state_entry()
{
llOwnerSay( "Touch me to get the positions of avatars in 'Say' range" );
}

touch_start(integer total_number)
{
llOwnerSay(llDetectedPos(integer 1));
}
}

 

Any tips, suggestions would be helpful. It is currently a non-functioning script. aka it has errors. 

Link to comment
Share on other sites

Let's take it one stage at a time.

First you need to detect all avatars in chat range (20 metres).   There's two ways to do this.    Either you can use llSensor or llGetAgentList.  

if you use llSensor, you can simply set the range to 20 metres.   If you use llGetAgentList you will have to loop through a list of the uuids it returns, checking llList2Vector(llGetObjectDetails(id,[OBJECT_POS]),0)  for each one, and using llVecDist to see how far away they are.

In the sensor event, if you use a sensor, you can say something like (code not tested)

sensor(integer total_number)	{		integer i;		vector v = llGetPos(); // my position		do {			llOwnerSay(llGetDisplayName(llDetectedKey(i))+" is "+ (string)llVecDist(v,llDetectedPos(i))+" metres away");		}		while (++i<total_number);	}

 

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 4054 days.

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
 Share

×
×
  • Create New...