// Trading card: plays a sprite-sheet animation on the art face, under a transparent overlay (the holo layer). // Faces: 0 back, 1 edge, 2 art (animated), 3 overlay (use a texture with transparency), 4 spacer (kept invisible). // To use your own animation: put frames in a grid on one texture (e.g. 4 x 4 = 16 frames, left to right, top to // bottom), drop it on face 2, and set COLS/ROWS/FRAMES below (or say "card grid 4 4 16" on channel 7). // Touch: pause / play. Owner on /7: card fps N | card grid COLS ROWS FRAMES | card overlay on|off. // One animation per object: SL plays llSetTextureAnim on a single face. Made by Tessel (an AI) for a friend, 2026-10-12. // Free to use, copy and change. integer COLS = 4; integer ROWS = 4; integer FRAMES = 16; float FPS = 8.0; integer ART = 2; integer OVERLAY = 3; integer SPACER = 4; integer playing = TRUE; apply() { llSetLinkAlpha(LINK_THIS, 0.0, SPACER); if (playing) llSetTextureAnim(ANIM_ON | LOOP, ART, COLS, ROWS, 0, FRAMES, FPS); else llSetTextureAnim(FALSE, ART, COLS, ROWS, 0, FRAMES, FPS); } default { state_entry() { apply(); llListen(7, "", llGetOwner(), ""); if (llGetAttached() == 0) llOwnerSay("Trading card: touch to pause/play. Face 2 = animated art (a " + (string)COLS + "x" + (string)ROWS + " sprite sheet), face 3 = overlay with transparency, face 0 = back. On /7: card fps N, card grid COLS ROWS FRAMES, card overlay on|off."); } on_rez(integer p) { apply(); } touch_start(integer n) { playing = !playing; apply(); } changed(integer c) { if (c & CHANGED_TEXTURE) apply(); } listen(integer ch, string name, key id, string msg) { list w = llParseString2List(llToLower(llStringTrim(msg, STRING_TRIM)), [" "], []); if (llList2String(w, 0) != "card") return; string op = llList2String(w, 1); if (op == "fps") FPS = llList2Float(w, 2); else if (op == "grid") { COLS = llList2Integer(w, 2); ROWS = llList2Integer(w, 3); FRAMES = llList2Integer(w, 4); } else if (op == "overlay") llSetLinkAlpha(LINK_THIS, (float)(llList2String(w, 2) != "off"), OVERLAY); apply(); llOwnerSay("card: " + (string)COLS + "x" + (string)ROWS + ", " + (string)FRAMES + " frames at " + (string)FPS + " fps"); } }