Verse Library verse

01 Fragment

Ends rounds or matches, assigns a winner, and executes when a timer event fires.

verse-library/using-end-game-devices-in-fortnite-creative/01-fragment.verse

# This is a simplified conceptual representation of the End Game logic.
# In real UEFN, you drag and drop devices, but this shows the relationships.

end_game_device := End_Game()

# 1. Set the scope: Do we end just this round, or the whole game?
# Think of this like choosing between "Restart Match" or "Return to Lobby"
end_game_device.Set_End_Scope(End_Scope::Round)

# 2. Define the winner.
# If the timer runs out, who takes the trophy?
# Let's say Team 1 (Blue) wins by default if time runs out.
end_game_device.Set_Winner(Team::Team1)

# 3. The Trigger.
# We need to connect this to a Timer.
# In Verse, this is an "Event." An event is like a "Ping" on the minimap.
# When the Timer fires, it pings the End Game device.

# This is the "Binding" part.
# When Timer_Device.Timer_Ends_Event fires, call end_game_device.End()
Timer_Device.Timer_Ends_Event.OnEvent += func(event: Timer_Ends_Event_Data):
    end_game_device.End()

Comments

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