Jump to content

Place owner's position on a simulated map.


GTASkinCentral
 Share

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

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

Recommended Posts

Hi!

I'm wanting to create a map of one specific sim that will simply locate an avatar and place a linked prim into the location that matches up with their region position.

It is esentially an avatar region tracker, however it only tracks the owner, and will function correctly when worn as a HUD.

 

When it comes to LSL, I am quite experienced, however the mathemetics that are involved simply stump me!

Please help! :)

Link to comment
Share on other sites

The functions you need are the llDetectedTouchSP or llDetectedTouchUV functions, each of which will tell you exactly what spot on a prim face was touched.  Once you have that information, all you need to do is rez or move your marker to that spot.  You don't need any math at all.  (Well, hardly any.  Just remember that you are getting local coordinates with those functions.)

Link to comment
Share on other sites

Oh, I see.  Sort of duplicating what you can see in your Mini-Map, then. 

You could certainly do that.  Just take results from llGetPos, scale them to the size of the map on your HUD, and move a tiny marker prim around to the local position that's equivalent to llGetPos.  You will have to do some math for that one, but it's not too hard.  Basically all you need to do is get the position of your HUD relative to the center of the screen so you know what offset to apply.  Then get the size of your HUD so that you know how much its <0,0> corner is offset from the HUD's center.  Then scale the region position from llGetPos to the size of the HUD and place your marker.  Update every 5 seconds or so -- maybe faster if you are flying.

Link to comment
Share on other sites

 

I think you get the regional position kinda like this....

 

        key  id      = llGetOwner();
        list details = llGetObjectDetails(id, ([OBJECT_POS]) );
        vector pos =  llList2Vector(details, 0);

 

and you do something like this to show the position on a (square?) prim...

 

       vector myPos =   <pos.x*255, pos.y*255, 24>;

 

You could maybe use an invis texture with a dot at center, in front of your map prim

 and just adjust the dot texture offset, otherwise you will need to get the map prims

 position,& size and the marker prim position & size, etc....

 hope this helps,

 i have a sim map that zooms in to the touched point, and

 i use something like this :)

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 3532 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...