Verse Library verse

01 Fragment

Manages game round start and end events, allowing custom setup and cleanup logic when rounds begin or conclude.

verse-library/fortnite-has-fort-round-manager-interface/01-fragment.verse

using /Fortnite.com/Game
using /Verse.org/Simulation

# This is our main script. It lives on the Simulation Entity.
# The 'interface' part tells Verse: "I am a Round Manager."
script RoundController implements IFortRoundManager:

    # This function runs once when the game starts.
    # Think of it as the "Pre-Game Lobby" setup.
    OnBegin<override>()<suspends>: void=
        # Wait for the round to actually start.
        # This pauses the script until the Round Manager says "Go!"
        await RoundStartedEvent

        # Now the round is live! Let's announce it.
        Print("Round Started! Good luck, survivors!")

    # This function runs when the round ends.
    OnEnd<override>()<suspends>: void=
        # Wait for the round to end.
        await RoundEndedEvent

        # Game over. Let's announce it.
        Print("Round Over! Time to respawn or restart.")

    # This is the event that fires when the round starts.
    # We don't call this; the Round Manager calls it for us.
    RoundStartedEvent: event()=
        # Just a placeholder. The system handles the timing.
        pass

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.

Sign in with Discord

Comments

    Sign in to vote, comment, or suggest an edit. Sign in