Commit graph

11 commits

Author SHA1 Message Date
917448f2d3 added a diagram 2025-07-26 04:50:27 -05:00
89a364d2ec Summary of Today’s Work:
Issue Identified:

The main issue was that the floater was showing 0 as the player's pick even after they made a selection, and the correct pick was not being reflected in the float.

Steps Taken:

Improved Data Synchronization: We ensured that the picksData list, which holds player choices, was properly updated and synchronized across all parts of the system.

State Serialization: The game state, including updated picksData, was serialized correctly using the serializeGameState() function. This ensured that the floater was aware of the new state whenever a player's pick changed.

Immediate Float Updates: After updating a player's pick, we immediately sent the new game state (gameSync) to all linked objects to update their floats, ensuring the pick was reflected in the UI.

Key Modifications:

Main Peril Dice Controller: We improved the way we updated picksData and immediately synchronized this update with the floater using MSG_SYNC_GAME_STATE.

StatFloat: Adjustments were made to handle receiving and displaying updated pick data, ensuring that picks were displayed correctly on the float after each update.

Dialog Handling: Proper dialogs were shown to players for pick choices, and feedback on their picks was sent back to update the floats in real-time.

Outcome:

The game now correctly updates and displays the player’s picks on their respective floats immediately after making a choice.

The picks are reflected in the logs as well, with the correct updated pick being shown rather than 0.

Final Result:

The issue of picks not being displayed correctly has been resolved, and the flow of data between the scripts (game state synchronization, float updates, etc.) is working as intended.
2025-07-26 03:52:29 -05:00
f895f9851c
✅ Today's Completed Tasks Summary
🎯 Refactored the Game Architecture
We modularized the original Peril Dice controller into separate cohesive components:

Main Peril Dice Controller

Handles core logic: player join/leave, peril selection, game sync, and communication routing.

Broadcasts updates via MSG_SYNC_GAME_STATE after major state changes.

Applies llSleep(0.2) to improve message delivery reliability.

Dialog Handler Module

Manages the number-picking dialog.

Tracks player picks and updates picksData accordingly.

Sends state sync after every valid pick.

Fixed pick serialization bugs and ensured updates trigger correctly.

Float Rezzer Module

Registers player data and rezzes a StatFloat object beside each participant.

Applies llSetObjectDesc(name); before rezzing for easier identification.

On update, broadcasts llRegionSay messages including current lives, peril, and picks.

StatFloat (HUD Script)

Listens on assigned channel to receive floating text updates.

Parses synced game state from link_message to extract lives, picks, and peril data.

Dynamically follows the avatar.

Enhanced parsing reliability and fixed index mapping for correct player display.

Roll and Confetti Module

Performs dice rolls and checks for matches.

Transfers peril role on match or removes a life otherwise.

Triggers confetti on a miss and updates floats for all players.

🛠 Debugging and Enhancements
Added llOwnerSay debug statements across all modules.

Resolved multiple name not defined within scope (nndws) issues.

Verified and cleaned up serialized game data formats across modules.

Ensured consistent use of player indexing and life count mapping.
2025-07-21 03:22:32 -05:00
f26c0d2853
quick fix 2025-07-20 16:57:23 -05:00
1ab15f077b
update readme 2025-07-20 00:56:00 -05:00
c2a729739e
updated readme 2025-07-20 00:54:12 -05:00
20df6b2a8f
readded confetti 2025-07-20 00:20:59 -05:00
8e69688bff
✅ New Features Added
Sequential Player Picking Logic

Players now pick in order starting with the peril player.

Number of picks is determined by the peril player’s current lives.

Picks are tracked globally to prevent duplicates.

Dynamic Dice Type Adjustment

Dice size (diceType) now adjusts based on player count:

1–2 players = 6

3–4 players = 12

5–6 players = 18, etc.

Prompt for Dice Roll

After all players have made their picks, the peril player is prompted to roll via a dialog.

Dice Roll Resolution Logic

If another player matches the roll, they become the new peril player.

If no one matches or the peril player matches, the peril player loses a life.

🔄 Fixes & Improvements
Fixed syntax and scoping errors (resultStr, newPeril, and timer logic).

Prevented duplicate rezzing of StatFloat objects.

Restored and ensured 🔢 Picks: are shown on the floating stat displays.

Updated floaters dynamically after each pick using llSetTimerEvent.
2025-07-20 00:04:48 -05:00
af80271691 first commit 2025-07-18 23:30:23 -05:00
20a458ae8c first commit 2025-07-18 23:29:15 -05:00
2083469a13 Add Peril Dice Controller and StatFloat functionality with player management and UI updates 2025-07-18 23:28:18 -05:00