updated lsl scripts to be preprocessed

This commit is contained in:
RebeccaNod1 2026-03-23 09:48:00 -06:00
parent 38aa4f2ba8
commit 5d83283be3
23 changed files with 263 additions and 261 deletions

View file

@ -6,7 +6,7 @@
// =============================================================================
// Base channel offset - should match Main.lsl
integer CHANNEL_BASE = -77000;
#define CHANNEL_BASE -77000
// Calculate channels dynamically to avoid hardcoded conflicts
integer calculateChannel(integer offset) {
@ -35,16 +35,16 @@ initializeChannels() {
// Configuration
integer LISTEN_CHANNEL; // Will be set dynamically
integer MSG_SYNC_GAME_STATE = 107;
#define MSG_SYNC_GAME_STATE 107
// Listen handle management
integer listenHandle = -1;
// Bot timing configuration to prevent dialog system overload
float BOT_RESPONSE_DELAY = 1.5; // Delay before bot responds to commands
#define BOT_RESPONSE_DELAY 1.5 // Delay before bot responds to commands
// Memory monitoring
float MEMORY_WARNING_THRESHOLD = 0.8; // Warn when using >80% of memory
#define MEMORY_WARNING_THRESHOLD 0.8 // Warn when using >80% of memory
// Track game state to validate bot commands
list names = [];

View file

@ -4,21 +4,21 @@
// Verbose logging control
integer VERBOSE_LOGGING = TRUE; // Global flag for verbose debug logs
integer MSG_TOGGLE_VERBOSE_LOGS = 9998; // Message to toggle verbose logging
#define MSG_TOGGLE_VERBOSE_LOGS 9998 // Message to toggle verbose logging
// Memory monitoring system
float MEMORY_WARNING_THRESHOLD = 0.8; // Warn at 80% usage
float MEMORY_CRITICAL_THRESHOLD = 0.9; // Critical at 90% usage
#define MEMORY_WARNING_THRESHOLD 0.8 // Warn at 80% usage
#define MEMORY_CRITICAL_THRESHOLD 0.9 // Critical at 90% usage
integer lastMemoryCheck = 0; // Track last memory check time
integer MEMORY_CHECK_INTERVAL = 60; // Check every 60 seconds
#define MEMORY_CHECK_INTERVAL 60 // Check every 60 seconds
// Message constants for inter-script communication
integer MSG_MEMORY_CHECK = 6001;
integer MSG_MEMORY_STATS = 6002;
integer MSG_MEMORY_CLEANUP = 6003;
integer MSG_MEMORY_REPORT = 6004;
integer MSG_EMERGENCY_CLEANUP = 6005;
integer MSG_MEMORY_STATS_REQUEST = 6006;
#define MSG_MEMORY_CHECK 6001
#define MSG_MEMORY_STATS 6002
#define MSG_MEMORY_CLEANUP 6003
#define MSG_MEMORY_REPORT 6004
#define MSG_EMERGENCY_CLEANUP 6005
#define MSG_MEMORY_STATS_REQUEST 6006
// Track main controller stats for comprehensive reporting
list mainControllerStats = [];

View file

@ -4,7 +4,7 @@
// Verbose logging control
integer VERBOSE_LOGGING = TRUE; // Global flag for verbose debug logs
integer MSG_TOGGLE_VERBOSE_LOGS = 9998; // Message to toggle verbose logging
#define MSG_TOGGLE_VERBOSE_LOGS 9998 // Message to toggle verbose logging
// Memory reporting function
reportMemoryUsage(string scriptName) {
@ -20,16 +20,16 @@ reportMemoryUsage(string scriptName) {
}
// Message constants for communication with main controller
integer MSG_REQUEST_PLAYER_DATA = 8001;
integer MSG_REQUEST_PICK_DATA = 8002;
integer MSG_REQUEST_LIFE_DATA = 8003;
integer MSG_PICK_ACTION = 8004;
integer MSG_DICE_TYPE_REQUEST = 8005;
integer MSG_LEAVE_GAME_REQUEST = 8006;
integer MSG_OWNER_MESSAGE = 9030; // Send formatted owner message
integer MSG_PUBLIC_MESSAGE = 9031; // Send formatted public message
integer MSG_REGION_MESSAGE = 9032; // Send formatted region message
integer MSG_DIALOG_REQUEST = 9033; // Send formatted dialog
#define MSG_REQUEST_PLAYER_DATA 8001
#define MSG_REQUEST_PICK_DATA 8002
#define MSG_REQUEST_LIFE_DATA 8003
#define MSG_PICK_ACTION 8004
#define MSG_DICE_TYPE_REQUEST 8005
#define MSG_LEAVE_GAME_REQUEST 8006
#define MSG_OWNER_MESSAGE 9030 // Send formatted owner message
#define MSG_PUBLIC_MESSAGE 9031 // Send formatted public message
#define MSG_REGION_MESSAGE 9032 // Send formatted region message
#define MSG_DIALOG_REQUEST 9033 // Send formatted dialog
// Game state data synchronized from Main Controller
list players = [];
@ -43,17 +43,17 @@ integer roundStarted = FALSE; // Track if the game round has started
// Message constants from Main Controller (synchronized)
integer MSG_SYNC_GAME_STATE = 107;
integer MSG_SYNC_PICKQUEUE = 2001;
#define MSG_SYNC_PICKQUEUE 2001
// Channel constants for scoreboard updates
integer SCOREBOARD_CHANNEL_1;
integer SCOREBOARD_CHANNEL_2;
integer FLOATER_BASE_CHANNEL;
integer MSG_CLEANUP_FLOAT = 104;
integer MSG_UPDATE_FLOAT = 103;
#define MSG_CLEANUP_FLOAT 104
#define MSG_UPDATE_FLOAT 103
// Dynamic channel calculation (matches Main Controller)
integer CHANNEL_BASE = -77000;
#define CHANNEL_BASE -77000
integer calculateChannel(integer offset) {
// Use BOTH owner's key AND object's key to make channels unique per game instance

View file

@ -34,7 +34,7 @@ list LINKSET_SPECIFIC_SCRIPTS = [
"XyzzyText_Dice_Bridge_Linkset.lsl" // Link 83
];
string XYZZY_SCRIPT = "xyzzy_Master_script.lsl"; // Links 35-82 (48 prims)
#define XYZZY_SCRIPT "xyzzy_Master_script.lsl" // Links 35-82 (48 prims)
// Scan results
integer totalPrims = 0;

View file

@ -1,25 +1,25 @@
// === FloatManager (Consolidated) ===
// This version enforces a maximum of 10 players.
integer MSG_SHOW_DIALOG = 101;
integer MSG_ROLL_RESULT = 102;
integer MSG_UPDATE_FLOAT = 103;
integer MSG_CLEANUP_FLOAT = 104;
integer MSG_REZ_FLOAT = 105;
integer MSG_REGISTER_PLAYER = 106;
integer MSG_SYNC_GAME_STATE = 107;
integer MSG_CLEANUP_ALL_FLOATERS = 212;
#define MSG_SHOW_DIALOG 101
#define MSG_ROLL_RESULT 102
#define MSG_UPDATE_FLOAT 103
#define MSG_CLEANUP_FLOAT 104
#define MSG_REZ_FLOAT 105
#define MSG_REGISTER_PLAYER 106
#define MSG_SYNC_GAME_STATE 107
#define MSG_CLEANUP_ALL_FLOATERS 212
// Debug control message constants
integer MSG_DEBUG_PICKS_ON = 7001;
integer MSG_DEBUG_PICKS_OFF = 7002;
#define MSG_DEBUG_PICKS_ON 7001
#define MSG_DEBUG_PICKS_OFF 7002
// =============================================================================
// DYNAMIC CHANNEL CONFIGURATION FOR FLOATERS
// =============================================================================
// Base channel offset - should match Main.lsl
integer CHANNEL_BASE = -77000;
#define CHANNEL_BASE -77000
// Calculate channels dynamically to avoid hardcoded conflicts
integer calculateChannel(integer offset) {
@ -47,7 +47,7 @@ initializeChannels() {
}
// Maximum number of players allowed in the game
integer MAX_PLAYERS = 10;
#define MAX_PLAYERS 10
// Debug control - set to TRUE for verbose pick debugging, FALSE for normal operation
integer DEBUG_PICKS = FALSE;

View file

@ -5,7 +5,7 @@
// Verbose logging control
integer VERBOSE_LOGGING = TRUE; // Global flag for verbose debug logs
integer MSG_TOGGLE_VERBOSE_LOGS = 9998; // Message to toggle verbose logging
#define MSG_TOGGLE_VERBOSE_LOGS 9998 // Message to toggle verbose logging
// Memory reporting function
reportMemoryUsage(string scriptName) {
@ -20,13 +20,13 @@ reportMemoryUsage(string scriptName) {
llGetSubString((string)percentUsed, 0, 4) + "% used)");
}
integer MSG_GET_DICE_TYPE = 1001;
integer MSG_DICE_TYPE_RESULT = 1005;
integer MSG_GET_PICKS_REQUIRED = 1002;
integer MSG_GET_PICKER_INDEX = 1003;
integer MSG_SERIALIZE_GAME_STATE = 1004;
integer MSG_SYNC_GAME_STATE = 107;
integer MSG_SYNC_PICKQUEUE = 2001;
#define MSG_GET_DICE_TYPE 1001
#define MSG_DICE_TYPE_RESULT 1005
#define MSG_GET_PICKS_REQUIRED 1002
#define MSG_GET_PICKER_INDEX 1003
#define MSG_SERIALIZE_GAME_STATE 1004
#define MSG_SYNC_GAME_STATE 107
#define MSG_SYNC_PICKQUEUE 2001
list lives;
list picksData;
@ -35,7 +35,7 @@ list names;
list pickQueue;
// List of supported dice sizes; ensure the last entry can accommodate 10 players × 3 picks = 30
list STANDARD_DICE = [6, 12, 20, 30];
#define STANDARD_DICE [6, 12, 20, 30]
// Determine which die to use based on player count.
// Each player should have at least 3 numbers available to choose from.

View file

@ -11,10 +11,10 @@ string getPlayerName(key id) {
}
// Game timing settings
float BOT_PICK_DELAY = 2.0;
float HUMAN_PICK_DELAY = 1.0;
float DIALOG_DELAY = 1.5;
float STATUS_DISPLAY_TIME = 8.0;
#define BOT_PICK_DELAY 2.0
#define HUMAN_PICK_DELAY 1.0
#define DIALOG_DELAY 1.5
#define STATUS_DISPLAY_TIME 8.0
// Game state - synced from Main Controller
list players = [];
@ -95,16 +95,16 @@ reportMemoryUsage(string scriptName) {
integer VERBOSE_LOGGING = FALSE;
// Message constants
integer MSG_SHOW_DIALOG = 101;
integer MSG_SHOW_ROLL_DIALOG = 301;
integer MSG_GET_DICE_TYPE = 1001;
integer MSG_DICE_TYPE_RESULT = 1005;
integer MSG_SYNC_GAME_STATE = 107;
integer MSG_SYNC_PICKQUEUE = 2001;
integer MSG_PLAYER_WON = 551;
integer MSG_UPDATE_FLOAT = 2010;
integer MSG_DIALOG_FORWARD_REQUEST = 9060; // Request dialog forwarding from Player_RegistrationManager
integer MSG_CONTINUE_ROUND = 998; // Continue round after roll processing
#define MSG_SHOW_DIALOG 101
#define MSG_SHOW_ROLL_DIALOG 301
#define MSG_GET_DICE_TYPE 1001
#define MSG_DICE_TYPE_RESULT 1005
#define MSG_SYNC_GAME_STATE 107
#define MSG_SYNC_PICKQUEUE 2001
#define MSG_PLAYER_WON 551
#define MSG_UPDATE_FLOAT 2010
#define MSG_DIALOG_FORWARD_REQUEST 9060 // Request dialog forwarding from Player_RegistrationManager
#define MSG_CONTINUE_ROUND 998 // Continue round after roll processing
continueCurrentRound() {
// MEMORY OPTIMIZED: Skip complex validation - trust game state

View file

@ -8,57 +8,57 @@
// Verbose logging control
integer VERBOSE_LOGGING = FALSE; // Global flag for verbose debug logs - DISABLED to save memory
integer MSG_TOGGLE_VERBOSE_LOGS = 9998; // Message to toggle verbose logging
#define MSG_TOGGLE_VERBOSE_LOGS 9998 // Message to toggle verbose logging
// Message constants for link communication
// Scoreboard messages (from link 1 - controller)
integer MSG_GAME_STATUS = 3001;
integer MSG_PLAYER_UPDATE = 3002;
integer MSG_CLEAR_GAME = 3003;
integer MSG_REMOVE_PLAYER = 3004;
integer MSG_UPDATE_PERIL_PLAYER = 3005;
integer MSG_UPDATE_WINNER = 3006;
#define MSG_GAME_STATUS 3001
#define MSG_PLAYER_UPDATE 3002
#define MSG_CLEAR_GAME 3003
#define MSG_REMOVE_PLAYER 3004
#define MSG_UPDATE_PERIL_PLAYER 3005
#define MSG_UPDATE_WINNER 3006
// Leaderboard messages (to link 35)
integer MSG_GAME_WON = 3010;
integer MSG_GAME_LOST = 3011;
integer MSG_RESET_LEADERBOARD = 3012;
#define MSG_GAME_WON 3010
#define MSG_GAME_LOST 3011
#define MSG_RESET_LEADERBOARD 3012
// Dice messages (to link 83)
integer MSG_DICE_ROLL = 3020;
integer MSG_CLEAR_DICE = 3021;
#define MSG_DICE_ROLL 3020
#define MSG_CLEAR_DICE 3021
// Prim indices (UPDATED after overlay prim insertion - overlays are links 2-11)
integer BACKGROUND_PRIM = 13; // Now link 13 (backboard)
integer ACTIONS_PRIM = 14; // Now link 14 (title/action)
integer FIRST_PROFILE_PRIM = 15; // Profile prims start at 15
integer LAST_PROFILE_PRIM = 34; // Profile/life prims end at 34
integer FIRST_OVERLAY_PRIM = 2; // Overlay prims start at 2
integer LAST_OVERLAY_PRIM = 11; // Overlay prims end at 11
#define BACKGROUND_PRIM 13 // Now link 13 (backboard)
#define ACTIONS_PRIM 14 // Now link 14 (title/action)
#define FIRST_PROFILE_PRIM 15 // Profile prims start at 15
#define LAST_PROFILE_PRIM 34 // Profile/life prims end at 34
#define FIRST_OVERLAY_PRIM 2 // Overlay prims start at 2
#define LAST_OVERLAY_PRIM 11 // Overlay prims end at 11
// Heart texture UUIDs - REPLACE WITH YOUR ACTUAL TEXTURE UUIDs
string TEXTURE_0_HEARTS = "7d8ae121-e171-12ae-f5b6-7cc3c0395c7b"; // 0 hearts (dead)
string TEXTURE_1_HEARTS = "6605d25f-8e2d-2870-eb87-77c58cd47fa9"; // 1 heart
string TEXTURE_2_HEARTS = "7ba6cb1e-f384-25a5-8e88-a90bbd7cc041"; // 2 hearts
string TEXTURE_3_HEARTS = "a5d16715-4648-6526-5582-e8068293f792"; // 3 hearts
#define TEXTURE_0_HEARTS "7d8ae121-e171-12ae-f5b6-7cc3c0395c7b" // 0 hearts (dead)
#define TEXTURE_1_HEARTS "6605d25f-8e2d-2870-eb87-77c58cd47fa9" // 1 heart
#define TEXTURE_2_HEARTS "7ba6cb1e-f384-25a5-8e88-a90bbd7cc041" // 2 hearts
#define TEXTURE_3_HEARTS "a5d16715-4648-6526-5582-e8068293f792" // 3 hearts
// Default textures - REPLACE WITH YOUR ACTUAL TEXTURE UUIDs
string TEXTURE_DEFAULT_PROFILE = "1ce89375-6c3c-3845-26b1-1dc666bc9169"; // Default avatar
string TEXTURE_BOT_PROFILE = "62f31722-04c1-8c29-c236-398543f2a6ae"; // Bot avatar picture
string BLANK_TEXTURE = "5748decc-f629-461c-9a36-a35a221fe21f"; // White texture UUID
string TEXTURE_BACKGROUND = "5748decc-f629-461c-9a36-a35a221fe21f"; // Background texture (blank + black color)
string TEXTURE_ACTIONS = "6aac8dce-1b83-f931-abe3-286f4f2faa29"; // Punishment texture
#define TEXTURE_DEFAULT_PROFILE "1ce89375-6c3c-3845-26b1-1dc666bc9169" // Default avatar
#define TEXTURE_BOT_PROFILE "62f31722-04c1-8c29-c236-398543f2a6ae" // Bot avatar picture
#define BLANK_TEXTURE "5748decc-f629-461c-9a36-a35a221fe21f" // White texture UUID
#define TEXTURE_BACKGROUND "5748decc-f629-461c-9a36-a35a221fe21f" // Background texture (blank + black color)
#define TEXTURE_ACTIONS "6aac8dce-1b83-f931-abe3-286f4f2faa29" // Punishment texture
// Status textures - REPLACE WITH YOUR ACTUAL TEXTURE UUIDs
string TEXTURE_PERIL = "c5676fec-0c85-5567-3dd8-f939234e21d9"; // Elimination texture
string TEXTURE_PERIL_SELECTED = "a53ff601-3c8a-e312-9e0e-f6fa76f6773a"; // Peril Selected texture
string TEXTURE_VICTORY = "ec5bf10e-4970-fb63-e7bf-751e1dc27a8d"; // Victory texture
string TEXTURE_PUNISHMENT = "acfabed0-84ad-bfd1-cdfc-2ada0aeeaa2f"; // Punishment texture (fallback)
string TEXTURE_DIRECT_HIT = "ecd2dba2-3969-6c39-ad59-319747307f55"; // Direct Hit texture
string TEXTURE_NO_SHIELD = "2440174f-e385-44e2-8016-ac34934f11f5"; // No Shield texture
string TEXTURE_PLOT_TWIST = "ec533379-4f7f-8183-e877-e68af703dcce"; // Plot Twist texture
string TEXTURE_TITLE = "624bb7a7-e856-965c-bae8-94d75226c1bc"; // Title texture
string TEXTURE_ELIMINATED_X = "90524092-03b0-1b3c-bcea-3ea5118c6dba"; // Red X overlay for eliminated players
#define TEXTURE_PERIL "c5676fec-0c85-5567-3dd8-f939234e21d9" // Elimination texture
#define TEXTURE_PERIL_SELECTED "a53ff601-3c8a-e312-9e0e-f6fa76f6773a" // Peril Selected texture
#define TEXTURE_VICTORY "ec5bf10e-4970-fb63-e7bf-751e1dc27a8d" // Victory texture
#define TEXTURE_PUNISHMENT "acfabed0-84ad-bfd1-cdfc-2ada0aeeaa2f" // Punishment texture (fallback)
#define TEXTURE_DIRECT_HIT "ecd2dba2-3969-6c39-ad59-319747307f55" // Direct Hit texture
#define TEXTURE_NO_SHIELD "2440174f-e385-44e2-8016-ac34934f11f5" // No Shield texture
#define TEXTURE_PLOT_TWIST "ec533379-4f7f-8183-e877-e68af703dcce" // Plot Twist texture
#define TEXTURE_TITLE "624bb7a7-e856-965c-bae8-94d75226c1bc" // Title texture
#define TEXTURE_ELIMINATED_X "90524092-03b0-1b3c-bcea-3ea5118c6dba" // Red X overlay for eliminated players
// Player data - used for BOTH current game display AND leaderboard
list playerNames = []; // Current game players for display
@ -849,7 +849,7 @@ updatePlayerDisplay(string playerName, integer lives, string profileUUID) {
// }
// Request profile picture via HTTP (will update later)
string URL_RESIDENT = "https://world.secondlife.com/resident/";
#define URL_RESIDENT "https://world.secondlife.com/resident/"
key httpRequestID = llHTTPRequest(URL_RESIDENT + profileUUID, [HTTP_METHOD, "GET"], "");
// Store the HTTP request mapping: requestID -> playerIndex

View file

@ -9,15 +9,15 @@
// Verbose logging control
integer VERBOSE_LOGGING = TRUE; // Global flag for verbose debug logs
integer MSG_TOGGLE_VERBOSE_LOGS = 9998; // Message to toggle verbose logging
#define MSG_TOGGLE_VERBOSE_LOGS 9998 // Message to toggle verbose logging
// Message constants for link communication
// Leaderboard messages (from link 12 - scoreboard)
integer MSG_GAME_WON = 3010;
integer MSG_GAME_LOST = 3011;
integer MSG_RESET_LEADERBOARD = 3012;
#define MSG_GAME_WON 3010
#define MSG_GAME_LOST 3011
#define MSG_RESET_LEADERBOARD 3012
integer DISPLAY_STRING = 204000;
#define DISPLAY_STRING 204000
// Bank assignments based on actual link testing - UPDATED FOR LINKSET:
// Original links were 1-48, now they are 35-82 (offset by +34)

View file

@ -20,82 +20,82 @@ string getPlayerName(key id) {
// =============================================================================
// Target link numbers (UPDATED after overlay prim insertion)
integer SCOREBOARD_LINK = 12; // Scoreboard manager cube
integer LEADERBOARD_LINK = 35; // Leaderboard manager (first XyzzyText prim)
integer DICE_LINK = 83; // Dice display manager (first dice prim)
#define SCOREBOARD_LINK 12 // Scoreboard manager cube
#define LEADERBOARD_LINK 35 // Leaderboard manager (first XyzzyText prim)
#define DICE_LINK 83 // Dice display manager (first dice prim)
// Message constants for link communication
// Scoreboard messages (to link 12)
integer MSG_GAME_STATUS = 3001;
integer MSG_PLAYER_UPDATE = 3002;
integer MSG_CLEAR_GAME = 3003;
integer MSG_REMOVE_PLAYER = 3004;
integer MSG_UPDATE_PERIL_PLAYER = 3005;
integer MSG_UPDATE_WINNER = 3006;
#define MSG_GAME_STATUS 3001
#define MSG_PLAYER_UPDATE 3002
#define MSG_CLEAR_GAME 3003
#define MSG_REMOVE_PLAYER 3004
#define MSG_UPDATE_PERIL_PLAYER 3005
#define MSG_UPDATE_WINNER 3006
// Leaderboard messages (to link 35)
integer MSG_GAME_WON = 3010;
integer MSG_GAME_LOST = 3011;
integer MSG_RESET_LEADERBOARD = 3012;
#define MSG_GAME_WON 3010
#define MSG_GAME_LOST 3011
#define MSG_RESET_LEADERBOARD 3012
// Dice messages (to link 83)
integer MSG_DICE_ROLL = 3020;
integer MSG_CLEAR_DICE = 3021;
#define MSG_DICE_ROLL 3020
#define MSG_CLEAR_DICE 3021
// Legacy message constants (keep for internal controller communication)
integer MSG_SHOW_DIALOG = 101;
integer MSG_ROLL_RESULT = 102;
integer MSG_UPDATE_FLOAT = 103;
integer MSG_CLEANUP_FLOAT = 104;
integer MSG_REZ_FLOAT = 105;
integer MSG_REGISTER_PLAYER = 106;
integer MSG_REGISTER_PLAYER_REQUEST = 9050; // New dedicated message to Player_RegistrationManager
integer MSG_SYNC_GAME_STATE = 107;
integer MSG_SHOW_MENU = 201;
integer MSG_TOGGLE_READY = 202;
integer MSG_QUERY_READY_STATE = 210;
integer MSG_READY_STATE_RESULT = 211;
integer MSG_CLEANUP_ALL_FLOATERS = 212;
integer MSG_QUERY_OWNER_STATUS = 213;
integer MSG_OWNER_STATUS_RESULT = 214;
integer MSG_SHOW_ROLL_DIALOG = 301;
integer MSG_GET_CURRENT_DIALOG = 302;
integer MSG_PLAYER_WON = 551;
integer MSG_GET_PICKS_REQUIRED = 1002;
integer MSG_GET_PICKER_INDEX = 1003;
#define MSG_SHOW_DIALOG 101
#define MSG_ROLL_RESULT 102
#define MSG_UPDATE_FLOAT 103
#define MSG_CLEANUP_FLOAT 104
#define MSG_REZ_FLOAT 105
#define MSG_REGISTER_PLAYER 106
#define MSG_REGISTER_PLAYER_REQUEST 9050 // New dedicated message to Player_RegistrationManager
#define MSG_SYNC_GAME_STATE 107
#define MSG_SHOW_MENU 201
#define MSG_TOGGLE_READY 202
#define MSG_QUERY_READY_STATE 210
#define MSG_READY_STATE_RESULT 211
#define MSG_CLEANUP_ALL_FLOATERS 212
#define MSG_QUERY_OWNER_STATUS 213
#define MSG_OWNER_STATUS_RESULT 214
#define MSG_SHOW_ROLL_DIALOG 301
#define MSG_GET_CURRENT_DIALOG 302
#define MSG_PLAYER_WON 551
#define MSG_GET_PICKS_REQUIRED 1002
#define MSG_GET_PICKER_INDEX 1003
// Memory monitoring handled by Controller_Memory.lsl helper script
integer MSG_MEMORY_CHECK = 6001;
integer MSG_MEMORY_STATS = 6002;
integer MSG_MEMORY_CLEANUP = 6003;
integer MSG_MEMORY_REPORT = 6004;
integer MSG_EMERGENCY_CLEANUP = 6005;
integer MSG_MEMORY_STATS_REQUEST = 6006;
#define MSG_MEMORY_CHECK 6001
#define MSG_MEMORY_STATS 6002
#define MSG_MEMORY_CLEANUP 6003
#define MSG_MEMORY_REPORT 6004
#define MSG_EMERGENCY_CLEANUP 6005
#define MSG_MEMORY_STATS_REQUEST 6006
// Unified Timer System - prevents conflicts between multiple timer needs
integer TIMER_IDLE = 0;
integer TIMER_STATUS = 1;
integer TIMER_VICTORY_DELAY = 2; // Timer mode for victory glow display
#define TIMER_IDLE 0
#define TIMER_STATUS 1
#define TIMER_VICTORY_DELAY 2 // Timer mode for victory glow display
integer currentTimerMode = 0; // Track what the timer is currently doing
float timerInterval = 1.0; // How often timer() is called for checks
integer victoryDelayTimer = 0; // Track victory delay timing
// Debug control - set to TRUE for verbose pick debugging, FALSE for normal operation
integer DEBUG_PICKS = FALSE;
#define DEBUG_PICKS FALSE
// Verbose logging moved to dedicated Verbose_Logger.lsl script to save memory
// Message constants for verbose logging
integer MSG_VERBOSE_LOG = 9020;
integer MSG_VERBOSE_TOGGLE = 9010;
#define MSG_VERBOSE_LOG 9020
#define MSG_VERBOSE_TOGGLE 9010
// Script ID for Main Controller (used by Verbose_Logger for prefixes)
integer SCRIPT_ID_MAIN = 0;
#define SCRIPT_ID_MAIN 0
// Message handling constants (delegate to Controller_MessageHandler)
integer MSG_OWNER_MESSAGE = 9030;
integer MSG_PUBLIC_MESSAGE = 9031;
integer MSG_REGION_MESSAGE = 9032;
integer MSG_DIALOG_REQUEST = 9033;
#define MSG_OWNER_MESSAGE 9030
#define MSG_PUBLIC_MESSAGE 9031
#define MSG_REGION_MESSAGE 9032
#define MSG_DIALOG_REQUEST 9033
// Memory reporting function
reportMemoryUsage(string scriptName) {
@ -115,7 +115,7 @@ reportMemoryUsage(string scriptName) {
// REMOVED: Heavy message forwarding functions - too memory intensive
// Status message timing
float STATUS_DISPLAY_TIME = 8.0; // How long to show status messages on scoreboard
#define STATUS_DISPLAY_TIME 8.0 // How long to show status messages on scoreboard
integer statusTimer = 0; // Track when status messages were sent
string lastStatus = ""; // Track last status sent
@ -143,28 +143,28 @@ integer gameStarting = FALSE; // Track when game is in startup sequence
// Prevent duplicate registration by tracking pending registrations
list pendingRegistrations = []; // Keys of players who have registration in progress
integer REGISTRATION_TIMEOUT = 10; // Seconds to keep pending registration
#define REGISTRATION_TIMEOUT 10 // Seconds to keep pending registration
// Display configuration
integer CONTROLLER_FACE = 1; // Face to display start image on (front face)
string TEXTURE_START = "title_start"; // Start image texture
string TEXTURE_GAME_ACTIVE = "game_active"; // Optional: different texture during game
#define CONTROLLER_FACE 1 // Face to display start image on (front face)
#define TEXTURE_START "title_start" // Start image texture
#define TEXTURE_GAME_ACTIVE "game_active" // Optional: different texture during game
// Maximum number of players allowed (including test players)
integer MAX_PLAYERS = 10;
#define MAX_PLAYERS 10
// Timeout system removed - using owner kick functionality instead
key currentPicker;
// Game timing settings
float BOT_PICK_DELAY = 2.0;
float HUMAN_PICK_DELAY = 1.0;
float DIALOG_DELAY = 1.5;
#define BOT_PICK_DELAY 2.0
#define HUMAN_PICK_DELAY 1.0
#define DIALOG_DELAY 1.5
integer gameTimer = 0;
// Dynamic channel system for floaters and dialogs (still needed for external communication)
integer CHANNEL_BASE = -77000;
#define CHANNEL_BASE -77000
integer calculateChannel(integer offset) {
string ownerStr = (string)llGetOwner();

View file

@ -1,18 +1,18 @@
// === Dialog Handler (Updated for Peril Dice - Paginated Multiple Picks) ===
integer MSG_SHOW_DIALOG = 101;
integer MSG_GET_CURRENT_DIALOG = 302;
#define MSG_SHOW_DIALOG 101
#define MSG_GET_CURRENT_DIALOG 302
// Verbose logging control
integer VERBOSE_LOGGING = TRUE; // Global flag for verbose debug logs
integer MSG_TOGGLE_VERBOSE_LOGS = 9998; // Message to toggle verbose logging
#define MSG_TOGGLE_VERBOSE_LOGS 9998 // Message to toggle verbose logging
// =============================================================================
// DYNAMIC CHANNEL CONFIGURATION
// =============================================================================
// Base channel offset - should match Main.lsl
integer CHANNEL_BASE = -77000;
#define CHANNEL_BASE -77000
// Calculate channels dynamically to avoid hardcoded conflicts
integer calculateChannel(integer offset) {
@ -58,7 +58,7 @@ integer picksNeeded = 1;
list currentPicks = [];
list globallyPickedNumbers = []; // Numbers already picked by other players
integer currentPage = 0;
integer NUMBERS_PER_PAGE = 9; // Leave room for navigation buttons
#define NUMBERS_PER_PAGE 9 // Leave room for navigation buttons
// Memory reporting function
reportMemoryUsage(string scriptName) {

View file

@ -5,12 +5,12 @@
// It downloads scripts from GitHub and installs them into the game
// ====================================================================
string CURRENT_VERSION = "2.8.8";
string GITHUB_API_URL = "https://api.github.com/repos/RebeccaNod1/Peril/releases/latest";
string GITHUB_RAW_URL = "https://raw.githubusercontent.com/RebeccaNod1/Peril/main/";
#define CURRENT_VERSION "2.8.8"
#define GITHUB_API_URL "https://api.github.com/repos/RebeccaNod1/Peril/releases/latest"
#define GITHUB_RAW_URL "https://raw.githubusercontent.com/RebeccaNod1/Peril/main/"
// Communication channels
integer UPDATER_CHANNEL = -7723847; // Must match Update_Receiver.lsl
#define UPDATER_CHANNEL -7723847 // Must match Update_Receiver.lsl
// State tracking
key targetGame = NULL_KEY;

View file

@ -16,7 +16,7 @@ string myName;
// Listen handle management
integer listenHandle = -1;
integer MSG_SYNC_GAME_STATE = 107;
#define MSG_SYNC_GAME_STATE 107
list lives;
list picksData;

View file

@ -18,7 +18,7 @@ string getPlayerName(key id) {
// =============================================================================
// Base channel offset - should match Main.lsl
integer CHANNEL_BASE = -77000;
#define CHANNEL_BASE -77000
// Calculate channels dynamically to avoid hardcoded conflicts
integer calculateChannel(integer offset) {
@ -73,20 +73,20 @@ rotation controller_rot;
list foundDisplays; // Store found display info: [type, key, offset, rotation, ...]
integer scanInProgress = FALSE;
integer MSG_SHOW_MENU = 201;
integer MSG_PICK_ACTION = 204;
integer MSG_PLAYER_LIST_RESULT = 203;
integer MSG_PICK_LIST_RESULT = 205;
integer MSG_LIFE_LOOKUP = 207;
integer MSG_REGISTER_PLAYER = 106;
integer MSG_REZ_FLOAT = 105;
integer MSG_TOGGLE_READY = 202;
integer MSG_QUERY_READY_STATE = 210;
integer MSG_READY_STATE_RESULT = 211;
integer MSG_CLEANUP_ALL_FLOATERS = 212;
integer MSG_QUERY_OWNER_STATUS = 213;
integer MSG_OWNER_STATUS_RESULT = 214;
integer MSG_GET_CURRENT_DIALOG = 302;
#define MSG_SHOW_MENU 201
#define MSG_PICK_ACTION 204
#define MSG_PLAYER_LIST_RESULT 203
#define MSG_PICK_LIST_RESULT 205
#define MSG_LIFE_LOOKUP 207
#define MSG_REGISTER_PLAYER 106
#define MSG_REZ_FLOAT 105
#define MSG_TOGGLE_READY 202
#define MSG_QUERY_READY_STATE 210
#define MSG_READY_STATE_RESULT 211
#define MSG_CLEANUP_ALL_FLOATERS 212
#define MSG_QUERY_OWNER_STATUS 213
#define MSG_OWNER_STATUS_RESULT 214
#define MSG_GET_CURRENT_DIALOG 302
// Categorized owner menu system
list mainOwnerOptions = ["👥 Player Management", "🔄 Reset Options", "🛠️ Troubleshooting", "⬅️ Back to Game"];
@ -105,7 +105,7 @@ integer pendingMenuIsOwner = FALSE;
integer pendingMenuRequestID = 0; // Unique ID for each menu request
integer currentRequestID = 0; // Counter for generating unique request IDs
float pendingMenuTimestamp = 0.0; // Timeout for pending requests
float MENU_REQUEST_TIMEOUT = 5.0; // 5 second timeout for menu requests
#define MENU_REQUEST_TIMEOUT 5.0 // 5 second timeout for menu requests
// Lockout system - when TRUE, only owner can access menus
integer isLocked = FALSE;

View file

@ -3,30 +3,30 @@
// This script takes over the memory-heavy player management operations
// Message constants for communication
integer MSG_REGISTER_PLAYER_REQUEST = 9050; // Dedicated message from Main Controller for registration
integer MSG_OWNER_MESSAGE = 9030;
integer MSG_PUBLIC_MESSAGE = 9031;
integer MSG_REGION_MESSAGE = 9032;
integer MSG_SHOW_MENU = 201;
integer MSG_UPDATE_MAIN_LISTS = 9040; // Optimized message to update main controller lists
integer MSG_SYNC_GAME_STATE = 107;
#define MSG_REGISTER_PLAYER_REQUEST 9050 // Dedicated message from Main Controller for registration
#define MSG_OWNER_MESSAGE 9030
#define MSG_PUBLIC_MESSAGE 9031
#define MSG_REGION_MESSAGE 9032
#define MSG_SHOW_MENU 201
#define MSG_UPDATE_MAIN_LISTS 9040 // Optimized message to update main controller lists
#define MSG_SYNC_GAME_STATE 107
// Scoreboard and display message constants
integer SCOREBOARD_LINK = 12;
integer MSG_PLAYER_UPDATE = 3002;
#define SCOREBOARD_LINK 12
#define MSG_PLAYER_UPDATE 3002
// Dialog forwarding constants
integer MSG_SHOW_DIALOG = 101;
integer MSG_SHOW_ROLL_DIALOG = 301;
integer MSG_DIALOG_FORWARD_REQUEST = 9060; // New message for dialog forwarding requests
#define MSG_SHOW_DIALOG 101
#define MSG_SHOW_ROLL_DIALOG 301
#define MSG_DIALOG_FORWARD_REQUEST 9060 // New message for dialog forwarding requests
// Game state tracking (synced from Main Controller)
list players = [];
list names = [];
list lives = [];
list readyPlayers = [];
integer MAX_PLAYERS = 10;
integer FLOATER_BASE_CHANNEL = -86000;
#define MAX_PLAYERS 10
#define FLOATER_BASE_CHANNEL -86000
integer roundStarted = FALSE;
integer gameStarting = FALSE;

View file

@ -1,23 +1,23 @@
// === Roll and Confetti Module (with Roll Dialog Handler) ===
integer MSG_SHOW_DIALOG = 101;
integer MSG_ROLL_RESULT = 102;
integer MSG_UPDATE_FLOAT = 103;
integer MSG_CLEANUP_FLOAT = 104;
integer MSG_REZ_FLOAT = 105;
integer MSG_SYNC_GAME_STATE = 107;
integer MSG_SHOW_ROLL_DIALOG = 301;
#define MSG_SHOW_DIALOG 101
#define MSG_ROLL_RESULT 102
#define MSG_UPDATE_FLOAT 103
#define MSG_CLEANUP_FLOAT 104
#define MSG_REZ_FLOAT 105
#define MSG_SYNC_GAME_STATE 107
#define MSG_SHOW_ROLL_DIALOG 301
// Dice messages (sent to Main Controller)
integer MSG_DICE_ROLL = 3020;
integer MSG_CLEAR_DICE = 3021;
#define MSG_DICE_ROLL 3020
#define MSG_CLEAR_DICE 3021
// =============================================================================
// DYNAMIC CHANNEL CONFIGURATION
// =============================================================================
// Base channel offset - should match Main.lsl
integer CHANNEL_BASE = -77000;
#define CHANNEL_BASE -77000
// Calculate channels dynamically to avoid hardcoded conflicts
integer calculateChannel(integer offset) {

View file

@ -3,9 +3,9 @@
// Verbose logging control
integer VERBOSE_LOGGING = TRUE; // Global flag for verbose debug logs
integer MSG_TOGGLE_VERBOSE_LOGS = 9998; // Message to toggle verbose logging
#define MSG_TOGGLE_VERBOSE_LOGS 9998 // Message to toggle verbose logging
integer MSG_SYNC_GAME_STATE = 107;
#define MSG_SYNC_GAME_STATE 107
list validatePicksData(list picksData, list names) {
list allPicksFlat = [];

View file

@ -3,8 +3,8 @@
// ====================================================================
// Simple test to see if llRemoteLoadScriptPin works at all
string TEST_VERSION = "1.0.0";
integer UPDATER_CHANNEL = -7723847;
#define TEST_VERSION "1.0.0"
#define UPDATER_CHANNEL -7723847
// Test state
key targetGameKey = NULL_KEY;
@ -12,7 +12,9 @@ integer testPin = 0;
integer testStep = 0;
// Simple test script content
string TEST_SCRIPT = "default {\n state_entry() {\n llOwnerSay(\"✅ Test script installed successfully!\");\n llOwnerSay(\"📝 This proves llRemoteLoadScriptPin is working.\");\n }\n}";
#define TEST_SCRIPT "default {
state_entry() {
llOwnerSay(\"✅ Test script installed successfully!\")\n llOwnerSay(\"📝 This proves llRemoteLoadScriptPin is working.\");\n }\n}";
default {
state_entry() {

View file

@ -19,9 +19,9 @@
// - Link 84: "dice col 2" - no script needed
// ====================================================================
string CURRENT_VERSION = "2.8.7";
string GITHUB_API_URL = "https://api.github.com/repos/RebeccaNod1/Peril/releases/latest";
string GITHUB_RAW_URL = "https://raw.githubusercontent.com/RebeccaNod1/Peril/main/";
#define CURRENT_VERSION "2.8.7"
#define GITHUB_API_URL "https://api.github.com/repos/RebeccaNod1/Peril/releases/latest"
#define GITHUB_RAW_URL "https://raw.githubusercontent.com/RebeccaNod1/Peril/main/"
// VERIFIED Link 1 Scripts (from actual scan of "Peril Dice Controller V2")
list LINK1_SCRIPTS = [
@ -48,7 +48,7 @@ list LINKSET_SPECIFIC_SCRIPTS = [
];
// XyzzyText system - VERIFIED 48 prims (Links 35-82)
string XYZZY_SCRIPT = "xyzzy_Master_script.lsl";
#define XYZZY_SCRIPT "xyzzy_Master_script.lsl"
// Essential documentation files
list ESSENTIAL_DOCS = [
@ -63,9 +63,9 @@ integer downloadMode = FALSE;
string downloadingFile = "";
// Message constants - following existing Peril Dice patterns
integer MSG_ADMIN_MENU_RESPONSE = 888; // Integration with admin menu
integer MSG_UPDATE_CHECK_REQUEST = 2100; // Request from admin menu
integer MSG_TOGGLE_VERBOSE_LOGS = 9999; // Verbose logging toggle
#define MSG_ADMIN_MENU_RESPONSE 888 // Integration with admin menu
#define MSG_UPDATE_CHECK_REQUEST 2100 // Request from admin menu
#define MSG_TOGGLE_VERBOSE_LOGS 9999 // Verbose logging toggle
// Internal verbose logging (follows existing pattern)
integer VERBOSE_LOGGING = FALSE;

View file

@ -12,11 +12,11 @@
// ====================================================================
string CURRENT_VERSION = "2.8.8";
string GITHUB_API_URL = "https://api.github.com/repos/RebeccaNod1/Peril/releases/latest";
#define GITHUB_API_URL "https://api.github.com/repos/RebeccaNod1/Peril/releases/latest"
// External updater communication
integer UPDATER_CHANNEL = -7723847; // Must match Peril_Dice_Updater.lsl
integer SENSOR_RANGE = 96; // meters to scan for updater boxes
#define UPDATER_CHANNEL -7723847 // Must match Peril_Dice_Updater.lsl
#define SENSOR_RANGE 96 // meters to scan for updater boxes
list nearbyUpdaters = [];
key selectedUpdater = NULL_KEY;
@ -30,12 +30,12 @@ key currentHttpRequest = NULL_KEY;
string currentOperation = "";
// Message constants - following existing Peril Dice patterns
integer MSG_ADMIN_MENU_RESPONSE = 888;
integer MSG_UPDATE_CHECK_REQUEST = 2100;
integer MSG_TOGGLE_VERBOSE_LOGS = 9999;
#define MSG_ADMIN_MENU_RESPONSE 888
#define MSG_UPDATE_CHECK_REQUEST 2100
#define MSG_TOGGLE_VERBOSE_LOGS 9999
// Update dialog constants
integer UPDATE_DIALOG_CHANNEL = -77401; // Unique channel for update dialogs
#define UPDATE_DIALOG_CHANNEL -77401 // Unique channel for update dialogs
integer updateDialogHandle = -1;
key pendingUpdateUser = NULL_KEY;

View file

@ -7,11 +7,11 @@ integer VERBOSE_LOGGING = FALSE;
// Loop protection - prevent rapid toggle spam
float lastToggleTime = 0.0;
float TOGGLE_COOLDOWN = 2.0; // Minimum 2 seconds between toggles
#define TOGGLE_COOLDOWN 2.0 // Minimum 2 seconds between toggles
// Message constants for verbose logging system
integer MSG_VERBOSE_TOGGLE = 9010; // Toggle verbose logging on/off
integer MSG_VERBOSE_BROADCAST = 9011; // Broadcast logging state to all modules
#define MSG_VERBOSE_TOGGLE 9010 // Toggle verbose logging on/off
#define MSG_VERBOSE_BROADCAST 9011 // Broadcast logging state to all modules
// Report memory status of this script
reportMemoryStatus() {

View file

@ -9,18 +9,18 @@
// Verbose logging control
integer VERBOSE_LOGGING = TRUE; // Global flag for verbose debug logs
integer MSG_TOGGLE_VERBOSE_LOGS = 9998; // Message to toggle verbose logging
#define MSG_TOGGLE_VERBOSE_LOGS 9998 // Message to toggle verbose logging
// Message constants for link communication
// Dice messages (from link 1 - controller)
integer MSG_DICE_ROLL = 3020;
integer MSG_CLEAR_DICE = 3021;
#define MSG_DICE_ROLL 3020
#define MSG_CLEAR_DICE 3021
integer DISPLAY_STRING = 204000;
#define DISPLAY_STRING 204000
// Dice prim links
integer DICE_PRIM_1 = 83; // First dice prim (characters 0-9)
integer DICE_PRIM_2 = 84; // Second dice prim (characters 10-19)
#define DICE_PRIM_1 83 // First dice prim (characters 0-9)
#define DICE_PRIM_2 84 // Second dice prim (characters 10-19)
// Function to display dice text across both prims
displayDiceText(string text) {

View file

@ -11,29 +11,29 @@
/////////////// CONSTANTS ///////////////////
// XyText Message Map.
integer DISPLAY_STRING = 204000;
integer DISPLAY_EXTENDED = 204001;
integer REMAP_INDICES = 204002;
integer RESET_INDICES = 204003;
integer SET_CELL_INFO = 204004;
integer SET_THICKNESS = 204006;
integer SET_COLOR = 204007;
#define DISPLAY_STRING 204000
#define DISPLAY_EXTENDED 204001
#define REMAP_INDICES 204002
#define RESET_INDICES 204003
#define SET_CELL_INFO 204004
#define SET_THICKNESS 204006
#define SET_COLOR 204007
// This is an extended character escape sequence.
string ESCAPE_SEQUENCE = "\\e";
#define ESCAPE_SEQUENCE "\e"
// This is used to get an index for the extended character.
string EXTENDED_INDEX = "123456789abcdef";
#define EXTENDED_INDEX "123456789abcdef"
// Face numbers.
integer FACE_1 = 3;
integer FACE_2 = 7;
integer FACE_3 = 4;
integer FACE_4 = 6;
integer FACE_5 = 1;
#define FACE_1 3
#define FACE_2 7
#define FACE_3 4
#define FACE_4 6
#define FACE_5 1
// Used to hide the text after a fade-out.
key TRANSPARENT = "701917a8-d614-471f-13dd-5f4644e36e3c";
#define TRANSPARENT "701917a8-d614-471f-13dd-5f4644e36e3c"
// This is a list of textures for all 2-character combinations.
list CHARACTER_GRID = [
"00e9f9f7-0669-181c-c192-7f8e67678c8d",