// SPDX-License-Identifier: MIT // Copyright (c) 2026 Incoprea // Child position nudge menu // Not compiled or tested in-world // Setup: Put in a nonphysical child; owner-touch opens X/Y/Z step buttons and Home. // Stop / restore: Use the Restore or Home action described in setup before removing or resetting if you want the startup appearance. Menu listeners expire after 45 seconds. // Notes: Local owner-only control. Saved snapshots live in script memory and are lost on reset. Actual geometry moves. Keep within link distances and do not relink while offset. // License: see LICENSE in this distribution. // Original Incoprea. MIT. Not compiled or tested in-world. integer channel; integer handle; close() { if(handle)llListenRemove(handle); handle=0; llSetTimerEvent(0.0); } menu(string prompt,list buttons) { if(!handle) { channel=-1000-(integer)llFrand(1000000.0); handle=llListen(channel,"",llGetOwner(),""); } llDialog(llGetOwner(),prompt,buttons,channel); llSetTimerEvent(45.0); } vector home; init() { home=llGetLocalPos(); } show() { menu("Child position: 5 cm root-local steps",["X+","X-","Y+","Y-","Z+","Z-","Home"]); } choose(string s) { if(llGetLinkNumber()<2||llGetStatus(STATUS_PHYSICS)) { llOwnerSay("Use a nonphysical child."); close(); return; } vector p=llGetLocalPos(); if(s=="Home")p=home; else if(s=="X+")p.x+=0.05; else if(s=="X-")p.x-=0.05; else if(s=="Y+")p.y+=0.05; else if(s=="Y-")p.y-=0.05; else if(s=="Z+")p.z+=0.05; else if(s=="Z-")p.z-=0.05; else return; llSetLinkPrimitiveParamsFast(LINK_THIS,[PRIM_POS_LOCAL,p]); show(); } default { state_entry() { init(); } touch_start(integer n) { if(llDetectedKey(0)!=llGetOwner())return; close(); show(); } listen(integer ch,string name,key id,string message) { if(!handle||ch!=channel||id!=llGetOwner())return; choose(message); } timer() { close(); } changed(integer change) { if(change&CHANGED_OWNER)llResetScript(); } }