Display LeaderBoard at start .. (Persistance)

Hi,

I would like to have a Leaderboard (with Persistance), which shows the list of the players since start. My map is an escape game, and the infos i want persist, are if they “finish” Room1, Room2, etc…

Actually, it has simply the “Exemple Text”…. :’(

I used the code which can be find here : Persistent Player Statistics in Unreal Editor for Fortnite | Fortnite Documentation | Epic Developer Community

My questions :

  1. Can I have my function which update all the infos in this “player_stats_manager := class():” ?
  2. “InitializePlayer” is a special function, that launch at start ?
  3. How can I put a function that can show what i want … the list of the players and the scores.

For the moment, I cannot just display player name … (I start Verse…)

I have my billboard, which show scores with the other verse (player_stats_example := class(creative_device): )

But … in the player_stats_manager, when i try to do the same (and transform to a class(creative_device): ), it doesn’t work… I put the device insise , a print appears, but the device does nothing… I chose it in the Details.

I think I’m totally lost…

So could you help me to have a very simple example to :

  • Just print the display name at start …. only that plz
  • If you want, a second example to put it in the billboard (and in a “Print” too)

Sorry, maybe it’s simple …

Thx a lot… 3hours I just want to print my name when join :’( :’(

For Example …. I tried this .. and it doesn’t Work…. I dont’t know why :’( :

using { /Fortnite.com/Devices }

using { /Verse.org/Simulation }

using { /UnrealEngine.com/Temporary/Diagnostics }








# Manages and updates player_stat_tables for each player.

player_stats_manager := class(creative_device):




    @editable MyHUD:billboard_device = billboard_device{} # Displays the player's Score, High Score, Wins, and Losses




    Message1<localizes>(Agent:agent): message ="{Agent}... how..."




    OnBegin<override>()<suspends>:void =

        MyHUD.SetText(Message1(Agent))

It tells me : “Unknown identifier `Agent`.(3506)” on the last “Agent”

That is because You dont have any valid Agent mentioned in this line “MyHUD.SetText(Message1(Agent))”

You can replace it with this:

for(Agent:GetPlayspace().GetPlayers():
      MyHUD.SetText(Message1(Agent))

Oh nice ! Thx it Works !!

        for(Agent:GetPlayspace().GetPlayers()):

            MyHUD.SetText(Message1(Agent))

Now …

1. Show name + stats

In the game, each players has a score in a var …

And I actualise it with this code :

StatsMessage<localizes>(Player:agent, Score:int):message = "{Player}, Stats:\n Score: {Score}"

But here, it doesn’t Work. I think because it’s an issue between Player / Agent ?

I tried to read how it is really but ….

What I think :

  • Agent : is a Player, a NPC, an animal maybe.. ?
  • Player : is a real Player only, who can have some stats / var

My question is :

Can I show the stats at start, and refresh it with a “OnPlayerAdded” (or other ?)

I think I can’t have my “Score” stats (persistant) in the Agent, but I can retrieve it in the Player ? How could I have the both :slight_smile: ? (name + score)

  1. Update too

In my map, I would like when a player do anything, it refresh the same board. For ex : I finish a room in an escape, my score is now “2” (was 1 at start).
I would like the same board refresh the score

Maybe I can put only one function, and tell it to launch at 2 places ?

Thx a lot !

[EDIT] : I’m trying anything like this (I would appends the message, because here it will has only the last) :

 OnBegin<override>()<suspends>:void=


        for(Agent:GetPlayspace().GetPlayers()):
            if:
                Player := player[Agent]
                PlayerStatsTable := PlayerStatsMap[Player]
                CurrentScore := PlayerStatsTable.Score 
                Messagetotal : message = "{Player} : {CurrentScore}"

                

            MyHUD.SetText(Messagetotal)