Don't click here unless you want to be banned.

LSL Wiki : llMapDestination

HomePage :: PageIndex :: RecentChanges :: RecentlyCommented :: UserSettings :: You are crawl423.us.archive.org
llMapDestination(string simname, vector position, vector lookat)

Shows a given location on the map.
Works in attachments, or during touch events. Currently the function will open the map window whenever it is called. There is no way to simply set the map position without opening the window.

The vertical (.z) axis of position is constrained to the 0 - 1000 range.
The lookat value is currently not in use, but will be in a later version.

GlobalMapDestination(vector position, vector lookat)
{
    vector c = llGetRegionCorner();
    llMapDestination(llGetRegionName(), position - c, lookat - c);
}

default
{
    touch_start(integer moocow)
    {
        llMapDestination("Coda", <128, 128, 25>, ZERO_VECTOR); // this loads the map to region "Coda" at the position <128,128,25>.
    }
}

key request;
string name;
string sim_name;
vector pos;

default
{
    state_entry()
    {
        llAllowInventoryDrop(1);
        if(llGetInventoryNumber(INVENTORY_LANDMARK))
        {
            name = llGetInventoryName(INVENTORY_LANDMARK,0);
            request = llRequestInventoryData(name);
        }
        else
            llWhisper(0,"Please drop a landmark on me");
    }
    dataserver(key id, string data)
    {
        if(id == request)
        {
            pos = (vector)data;
            sim_name = llGetRegionName();
            llSetText("Touch to show \""+name+"\" on the map.",<1.0,1.0,1.0>,1.0);
        }
    }
    touch_start(integer a)
    {
        if(name != "")
            llMapDestination(sim_name, pos, pos);
    }
    changed(integer a)
    {
        if(a & (CHANGED_INVENTORY | CHANGED_ALLOWED_DROP))
            if(llGetInventoryNumber(INVENTORY_LANDMARK))
                request = llRequestInventoryData(name = llGetInventoryName(INVENTORY_LANDMARK,0));
    }
}


This article wasn't helpful for you? Maybe the related article at the LSL Portal is able to bring enlightenment.

Functions | Teleport
Comments [Hide comments/form]
A clarification:

When you drop the landmark on your object, the vector of the landmark returned by the dataserver is relative to the sim the script operates from. That's why you need to store the original sim on which the landmark was dropped on the object and use it in subsequent calls to the function.
-- BlueVale (2006-11-15 00:33:40)
This is a well written script! A change to improve it might go some what like the following for the touch_start event:

touch_start(integer a)
{
if(name != "")
llMapDestination(sim_name, pos, pos);
else
{
llWhisper(0, "No Landmarks found");
llResetScript(); this will cover grid crashes and upgrades for static prims
}
}
-- YohanAlthouse (2006-11-15 22:07:16)
Please wrap code appropriately in the future %%(lsl) your code here %%
-- BlindWanderer (2006-11-20 06:56:08)
cd
-- 60.190.240.76 (2007-10-01 01:58:48)
Attach a comment to this page: