Need help activating HUD message devices on round end events

Hello!

I am building a Prop Hunt Minigame and am using the UEFN Prop Hunt example island as a foundation for my Verse code. I am struggling to figure out how to use a HUD message device to display a victory screen before the round is ended.

I can see in the code that there are 3 separate round end conditions defined and they are triggered using a race function, so the first event to occur ends the round. The 3 conditions are prop team player count is equal to zero, hunter team player count is equal to zero, and game timer ends the round.

I have been trying to define the scenarios in which either the props team or the hunters team wins, and then triggering a HUD device to show a victory message of either “props win” or “hunters win” using this to modify the EndRound function:


EndRound():void=
Sleep(4.0)
PropTeam.HeartBeat.DisableAll()
# Get any player to pass to EndRound
Players:player = GetPlayspace().GetPlayers()
if (RoundEndInstigator := Players[0]):
Logger.Print(“Round ended.”)

        if (PropTeam.Count() = 0): # Corrected for UEFN Verse syntax
            HuntersWinMessage.Show()
        else: # If hunters are eliminated or timer ends, props win
            PropsWinMessage.Show()

        RoundSettings.EndRound(RoundEndInstigator)

I already have HUD devices referenced as editables and I have added a Sleep(4.0) modifier to delay the round end screen to give time for the custom victory screen to appear, but nothing seems to trigger the HUD devices I have set up.

Any help is appreciated, thank you.

If you put a print next to the show HUD message function will the print show?

Also if you set the hud message devices to show at the start will they work then?

There’s no way for me to check the logs for an end game event because it’s just me in the game test.

I’ve adjusted the code to this:

EndRound()<suspends>:void=
        PropTeam.HeartBeat.DisableAll()
        # Get any player to pass to EndRound
        PropTeamEmpty := PropTeam.TeamEmptyEvent.Await()
        HunterTeamEmpty := HunterTeam.TeamEmptyEvent.Await()
        RoundEnded := RoundTimer.AwaitEnd()
        Players:[]player = GetPlayspace().GetPlayers()
        if (RoundEndInstigator := Players[0]):
            Logger.Print("Round ended.")
            if (PropTeamEmpty = true):
                HuntersWinMessage.Show()
                Logger.Print("Hunter Team wins.")
            if (HunterTeamEmpty = true or RoundEnded = true):
                PropsWinMessage.Show()
                Logger.Print("Prop Team wins.")

            RoundSettings.EndRound(RoundEndInstigator)

I get no errors in the code, but nothing happens when I test the game with a friend.

So the game just doesn’t end now? when using the end round device?

I figured it out.

I was triggering a HUD message device and ending the round at the same time.

The solution was to delay the round end by 5 seconds.