LSL Wiki Mirror 10-5-2006: llMapDestination

HomePage :: PageIndex :: RecentChanges :: RecentlyCommented :: UserSettings ::
llMapDestination(string simname, vector position, vector lookat)

Shows a given location on the map.
Works in attachments, or during touch events.

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);
}

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));
    }
}


Functions | Teleport
There is no comment on this page. [Display comments/form]