# Import the necessary UEFN libraries
using /Fortnite.com/Devices
using /Verse.org/Simulation
using /Engine/Systems
# This is our main device. Think of it as the "Brain" of the island.
# It sits in the world and holds all the logic.
script class PropHuntBrain extends Device:
# --- VARIABLES (The State) ---
# These are like the settings on your controller. They define how the game behaves.
HunterCount: int = 2 # How many hunters per round?
PropCount: int = 8 # How many props per round?
RoundTime: float = 120.0 # 120 seconds per round (like the storm timer)
# --- EVENTS (The Triggers) ---
# We "subscribe" to these events. When they happen, our functions run.
# OnPlayerJoined is called automatically when a player enters the game.
OnPlayerJoined: Event<Player> = Event()
# OnRoundStart is a custom event we'll trigger when the round begins.
OnRoundStart: Event = Event()
# --- FUNCTIONS (The Actions) ---
# This function runs when the Brain first initializes.
# It's like pressing "Start Game" in the menu.
Initialize() -> void:
# Subscribe to the player join event.
# Whenever a player joins, call the 'HandlePlayerJoin' function.
Verse Library
verse
01 Fragment
Central device managing player joins, round settings, and core event subscriptions.
verse-library/prop-hunt-05-game-loop-and-round-management-in-unreal-editor-for-fortnite/01-fragment.verse
Sign in free to read the full source 🌴
This Verse Library file is members-only. Create a free account to view the complete source and download the .verse file.