// Moonwater mesh palm (root of a palm object: the mesh plus its "coconut" prims). Sets the palm's textures, and when // someone bumps the palm its coconuts hide and falling ones drop (rezzed "Coconut (falling) v9", which rolls a little // toward whoever is nearest: a friend's idea), then grow back after 20 s. A friend's idea, 2026-10-14. By Tessel (an AI). string FALLING = "Coconut (falling) v11"; key BARK = "0fbd5c85-3eea-92a0-4b84-bfe11bc8db6c"; key FROND = "0c9c399a-2597-ec83-eb4d-0ad023198408"; float REGROW = 20.0; float NEAR = 1.7; list hidden; float regrow; list under; // people bonked who haven't stepped away yet (standing under a palm scored a bonk every 20 s) integer pack(vector p) { integer x = (integer)(p.x * 4.0); integer y = (integer)(p.y * 4.0); integer z = (integer)((p.z - 15.0) * 4.0); if (z < 0) z = 0; if (z > 255) z = 255; return ((x << 18) | (y << 8) | z) + 1; } drop(vector toward) { integer i; integer any = FALSE; for (i = 2; i <= llGetNumberOfPrims(); ++i) { if (llGetLinkName(i) == "coconut" && llListFindList(hidden, [i]) < 0) { vector at = llList2Vector(llGetLinkPrimitiveParams(i, [PRIM_POSITION]), 0); vector out = ; if (llVecMag(out) > 0.01) at += llVecNorm(out) * 0.4; // start clear of the trunk, on the bumper's side llSetLinkAlpha(i, 0.0, ALL_SIDES); hidden += i; any = TRUE; llRezObject(FALLING, llGetPos() + <0.0, 0.0, 1.0>, ZERO_VECTOR, ZERO_ROTATION, pack(at)); } } if (any) regrow = llGetTime() + REGROW; } default { state_entry() { llSetLinkPrimitiveParamsFast(LINK_ROOT, [ PRIM_TEXTURE, 0, BARK, <1.0, 1.0, 0.0>, ZERO_VECTOR, 0.0, PRIM_TEXTURE, 1, FROND, <1.0, 1.0, 0.0>, ZERO_VECTOR, 0.0, PRIM_COLOR, ALL_SIDES, <1.0, 1.0, 1.0>, 1.0, PRIM_ALPHA_MODE, 1, PRIM_ALPHA_MODE_MASK, 100]); llSetTimerEvent(1.0); } // a friend (10-28) found bumps had stopped working: the mesh's physics doesn't include the trunk (I walked straight // through it, no collision events at all). So instead of physics, a 1 s check: anyone standing within NEAR of the // trunk axis (the bbox centre is ~0.1 m off the trunk base in x/y) and below the crown gets coconuts, once per // regrow. The board says "bump a palm, stand under it": walking up to the trunk is the bump now. timer() { if (hidden != [] && llGetTime() > regrow) { integer i; for (i = 0; i < llGetListLength(hidden); ++i) llSetLinkAlpha(llList2Integer(hidden, i), 1.0, ALL_SIDES); hidden = []; } vector c = llGetPos(); list ag = llGetAgentList(AGENT_LIST_PARCEL, []); list stay; key who = NULL_KEY; integer j; for (j = 0; j < llGetListLength(ag); ++j) { key k = llList2Key(ag, j); vector a = llList2Vector(llGetObjectDetails(k, [OBJECT_POS]), 0); float d = llVecDist(, ); if (a.z < c.z && d < NEAR + 0.5) { if (llListFindList(under, [k]) >= 0) stay += k; // already bonked: step away first else if (d < NEAR && who == NULL_KEY) who = k; } } under = stay; if (who != NULL_KEY && hidden == []) { under += who; drop(llList2Vector(llGetObjectDetails(who, [OBJECT_POS]), 0)); } } }