// SPDX-License-Identifier: MIT // Copyright (c) 2026 Incoprea // Five-layer cutaway control // Not compiled or tested in-world // Setup: Name children layer1 through layer5. Put script in root. First touch hides layer5, then4,3,2,1; sixth restores all. // Stop / restore: Complete the six-touch cycle before removal; relinking invalidates stored link indices. // Notes: Use a spare modifiable build. Snapshot state is held only in script memory; restore before reset/removal. Do not relink during a preview. Only visibility changes; transparent parts still collide. PBR appearance and special alpha modes may differ. // License: see LICENSE in this distribution. // Original Incoprea. MIT. Not compiled or tested in-world. list saved; integer step; integer valid=TRUE; default { state_entry() { integer link; for(link=2;link<=llGetObjectPrimCount(llGetKey());++link) { string name=llGetLinkName(link); integer layer=llListFindList(["layer1","layer2","layer3","layer4","layer5"],[name])+1; if(layer) { integer f; for(f=0;f1||!valid)return; step=(step+1)%6; integer i; for(i=0;i5-step)alpha=0.0; llSetLinkPrimitiveParamsFast(llList2Integer(saved,i),[PRIM_COLOR,llList2Integer(saved,i+1),llList2Vector(saved,i+3),alpha]); } } changed(integer change) { if(change&CHANGED_LINK)valid=FALSE; } }