Verse Libraryverse

02 Snippet

Logs the active round number to the console when a new round begins for quick debugging.

extracted-snippets/community/learning/tutorials/mmbM/fortnite-0ebc5f/02-snippet.verse

# Source URL: https://dev.epicgames.com/community/learning/tutorials/mmbM/fortnite-0ebc5f
# Local doc:  epic-docs/community/learning/tutorials/mmbM/fortnite-0ebc5f.md
using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }
using { /Fortnite.com/Game }

print_current_round_device := class(creative_device):

    OnBegin<override>()<suspends>:void=
        if:
            SimulationEntity := GetSimulationEntity[]
            RoundManager := SimulationEntity.GetFortRoundManager[]
        then:
            CurrentRoundNumber := RoundManager.RoundNumber
            Print("Current Round Number is: {CurrentRoundNumber}")

Comments

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