# Ship Arena Game Mode Script # This script coordinates devices to run a free-for-all match. using { /Fortnite.com/Devices } using { /Fortnite.com/Game } using { /Verse.org/Simulation } using { /UnrealEngine.com/Temporary/Diagnostics } # Define the main game manager as a creative_device so it # can be placed on the island and wired to other devices. ShipArenaGameMode := class(creative_device): # Wire these in the UEFN Details panel to the # player_spawner devices you placed on the ship deck. @editable PlayerSpawners : []player_spawner_device = array{} # Wire this to an end_game device placed on the island. # That device should be configured for "Last Player Standing." @editable EndGameDevice : end_game_device = end_game_device{} # Wire this to a timer device (optional) to enforce a # 10-minute match limit. Set the device duration to 600 s. @editable MatchTimerDevice : timer_device = timer_device{} # OnBegin runs automatically when the match starts. OnBegin() : void = # 1. Enable every player spawner so players appear on deck. for (Spawner : PlayerSpawners): Spawner.Enable() # 2. Start the optional match timer. # When it expires, the timer_device can be linked # in-editor to EndGameDevice.Activate() via device events. MatchTimerDevice.Start() # 3. Subscribe to the end_game_device so we know when # the game has ended (last player standing or time-out). EndGameDevice.GameEndedEvent.Subscribe(OnGameEnded) # Called by the end_game_device's GameEndedEvent. OnGameEnded(Activator : ?agent) : void = # The end_game_device handles declaring the winner and # returning players to the lobby automatically. # Add any custom end-of-match cleanup here if needed. Print("Ship Arena: match over!")