// SPDX-License-Identifier: MIT // Copyright (c) 2026 Incoprea // Shuttle with endpoint dwell // Not compiled or tested in-world // Setup: Put in a child at the first stop. Travel is 0.6 meters along root X. Owner-touch begins a repeating 12-second cycle. // Stop / restore: Owner-touch to stop and restore the captured starting pose before removing, resetting, or relinking. // 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. Each leg takes four seconds with a two-second dwell at each end. The movement is time-based, so lag does not accumulate as extra steps. // License: see LICENSE in this distribution. // Original Incoprea. MIT. Not compiled or tested in-world. vector home; rotation rest; integer active; integer valid=TRUE; default { state_entry() { home=llGetLocalPos(); rest=llGetLocalRot(); } touch_start(integer count) { if(llDetectedKey(0)!=llGetOwner()||!valid||llGetLinkNumber()<2||llGetStatus(STATUS_PHYSICS))return; active=!active; if(active) { llResetTime(); float t=llGetTime(); t-=12.0*llFloor(t/12.0); float f=0.0; if(t<4.0)f=t/4.0; else if(t<6.0)f=1.0; else if(t<10.0)f=1.0-(t-6.0)/4.0; llSetLinkPrimitiveParamsFast(LINK_THIS,[PRIM_POS_LOCAL,home+<0.6*f,0.0,0.0>]); llSetTimerEvent(0.2); } else { llSetTimerEvent(0.0); llSetLinkPrimitiveParamsFast(LINK_THIS,[PRIM_POS_LOCAL,home,PRIM_ROT_LOCAL,rest]); } } timer() { if(llGetLinkNumber()<2||llGetStatus(STATUS_PHYSICS)) { llSetTimerEvent(0.0); active=FALSE; return; } float t=llGetTime(); t-=12.0*llFloor(t/12.0); float f=0.0; if(t<4.0)f=t/4.0; else if(t<6.0)f=1.0; else if(t<10.0)f=1.0-(t-6.0)/4.0; llSetLinkPrimitiveParamsFast(LINK_THIS,[PRIM_POS_LOCAL,home+<0.6*f,0.0,0.0>]); } changed(integer change) { if(change&CHANGED_LINK) { valid=FALSE; active=FALSE; llSetTimerEvent(0.0); llOwnerSay("Links changed; stopped without restoring. Reposition and reset before reuse."); } } }