v3.2.2: Hybrid HUD Upgrade - Personal HUD for humans (ATTACH_HUD_CENTER_2) and in-world floaters for bots

This commit is contained in:
RebeccaNod1 2026-04-05 10:07:55 -06:00
parent afc2fda6b9
commit a8dcf17b27
2 changed files with 37 additions and 1 deletions

View file

@ -171,6 +171,12 @@ default {
llSleep(0.2); llSleep(0.2);
llRegionSay(ch, "SET_NAME:" + name); llRegionSay(ch, "SET_NAME:" + name);
// --- HUD UPGRADE: Attach to Humans ---
// If it's a valid avatar key and NOT a bot name, signal the float to attach
if (avKey != NULL_KEY && llSubStringIndex(name, "(Bot)") == -1) {
llRegionSay(ch, "ATTACH_TO:" + (string)avKey);
}
// Initial update to populate text/life display // Initial update to populate text/life display
llMessageLinked(LINK_SET, MSG_UPDATE_FLOAT, name, avKey); llMessageLinked(LINK_SET, MSG_UPDATE_FLOAT, name, avKey);
} else { } else {

View file

@ -22,10 +22,34 @@ default {
if (listenHandle != -1) llListenRemove(listenHandle); if (listenHandle != -1) llListenRemove(listenHandle);
listenHandle = llListen(start_param, "", NULL_KEY, ""); listenHandle = llListen(start_param, "", NULL_KEY, "");
myName = ""; myName = "";
// Correct LSL function name is llSetRemoteScriptAccessPin
llSetRemoteScriptAccessPin(1337); llSetRemoteScriptAccessPin(1337);
} }
attach(key id) {
if (id != NULL_KEY) {
// HUD MODE: Stop following target in-world
llSetTimerEvent(0.0);
// HUD Scaling & Rotation (Center 2 focus)
// Smaller scale, reset rotation to face screen
llSetLinkPrimitiveParamsFast(LINK_THIS, [
PRIM_SIZE, <0.05, 0.05, 0.05>,
PRIM_ROTATION, ZERO_ROTATION,
PRIM_POSITION, <0.0, 0.0, 0.0>
]);
dbg("📊 [Status Float] HUD Mode Activated for " + llKey2Name(id));
} else {
// BACK TO WORLD: Restore size and follow logic
llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_SIZE, <0.2, 0.2, 0.2>]);
}
}
experience_permissions(key av) {
// ATTACH_HUD_CENTER_2 = 31
llAttachToAvatarTemp(31);
}
listen(integer channel, string name, key id, string message) { listen(integer channel, string name, key id, string message) {
// Universal Floater API - Format: CMD:avKey|T=Text|G=Glow|C=Color|H=HeartTexture // Universal Floater API - Format: CMD:avKey|T=Text|G=Glow|C=Color|H=HeartTexture
if (llSubStringIndex(message, "CMD:") == 0) { if (llSubStringIndex(message, "CMD:") == 0) {
@ -67,6 +91,12 @@ default {
else if (message == "CLEANUP") { else if (message == "CLEANUP") {
llDie(); llDie();
} }
else if (llSubStringIndex(message, "ATTACH_TO:") == 0) {
key avKey = (key)llGetSubString(message, 10, -1);
if (avKey != NULL_KEY) {
llRequestExperiencePermissions(avKey, "");
}
}
else if (llSubStringIndex(message, "SET_NAME:") == 0) { else if (llSubStringIndex(message, "SET_NAME:") == 0) {
myName = llGetSubString(message, 9, -1); myName = llGetSubString(message, 9, -1);
llSetObjectDesc(myName); llSetObjectDesc(myName);