// SPDX-License-Identifier: MIT // Copyright (c) 2026 Incoprea // Record a short child-position path // Not compiled or tested in-world // Setup: Put in a nonphysical child. Owner short touch records a position; holding a touch for at least two seconds starts replay. The first recorded point is the return location. // Stop / restore: Owner-touch during replay stops and returns to the first recorded point, which may differ from the startup pose. The final replay step also returns there. A topology or physical-state change halts without moving. // Notes: Use a small nonphysical rezzed build with clear space. Actual prim transforms change. Original poses live only in script memory. Do not change physical status or link topology during use. Records the object’s own local positions only, never avatars. Replay uses one-second steps; stop by owner-touch during playback. // License: see LICENSE in this distribution. // Original Incoprea. MIT. Not compiled or tested in-world. list points; integer index; integer playing; float pressed; integer skipEnd; stop() { playing=FALSE; llSetTimerEvent(0.0); if(llGetListLength(points))llSetLinkPrimitiveParamsFast(LINK_THIS,[PRIM_POS_LOCAL,llList2Vector(points,0)]); } default { touch_start(integer n) { if(llDetectedKey(0)!=llGetOwner())return; pressed=llGetTime(); skipEnd=FALSE; if(playing) { stop(); skipEnd=TRUE; } } touch_end(integer n) { if(llDetectedKey(0)!=llGetOwner()||llGetLinkNumber()<2||llGetStatus(STATUS_PHYSICS))return; if(skipEnd) { skipEnd=FALSE; return; } if(llGetTime()-pressed>=2.0) { if(llGetListLength(points)>1) { index=0; playing=TRUE; llSetTimerEvent(1.0); } return; } if(llGetListLength(points)<20) { points+=[llGetLocalPos()]; llOwnerSay("Recorded point "+(string)llGetListLength(points)); } } timer() { if(llGetLinkNumber()<2||llGetStatus(STATUS_PHYSICS)) { llSetTimerEvent(0.0); playing=FALSE; return; } if(index>=llGetListLength(points)) { stop(); return; } llSetLinkPrimitiveParamsFast(LINK_THIS,[PRIM_POS_LOCAL,llList2Vector(points,index++)]); } changed(integer change) { if(change&CHANGED_LINK) { llSetTimerEvent(0.0); playing=FALSE; points=[]; llOwnerSay("Links changed; path cleared without moving."); } } }