// SPDX-License-Identifier: MIT // Copyright (c) 2026 Incoprea // Landmark distance preview // Not compiled or tested in-world // Setup: Add a landmark to the script prim. Owner-touch requests its location data. // Stop / restore: Remove/disable; no teleport or inventory offer occurs. // Notes: A landmark location is returned relative to this region origin, including cross-region offsets on compatible grids. Hypergrid behavior is grid-specific. Keep example captions and notecard lines short, preferably ASCII. Character clipping is not UTF-8 byte-budget clipping: multibyte text may reach hover-text or chat limits sooner and be truncated. // License: see LICENSE in this distribution. // Original Incoprea. MIT. Not compiled or tested in-world. key request; default { touch_start(integer n) { if(llDetectedKey(0)!=llGetOwner()||request!=NULL_KEY)return; if(!llGetInventoryNumber(INVENTORY_LANDMARK)) { llOwnerSay("Add a landmark."); return; } request=llRequestInventoryData(llGetInventoryName(INVENTORY_LANDMARK,0)); llSetTimerEvent(15.0); } dataserver(key id,string data) { if(id!=request)return; request=NULL_KEY; llSetTimerEvent(0.0); vector target=(vector)data; vector origin=llGetPos(); target.z=0.0; origin.z=0.0; llOwnerSay("Horizontal landmark distance: "+(string)llVecDist(target,origin)+" meters."); } timer() { request=NULL_KEY; llSetTimerEvent(0.0); llOwnerSay("Landmark lookup timed out."); } }