Update Score Value from Verse to Scoreboard

Hi,

using the following verse code, I am displaying a UIText on the screen. I would like to know how to update individuals score value by the same amount to the scoreboard data. Also if it’s possible to decrement the score as well.

Thank you.

(FortCharacter: fort_character).UpdateDistance(TextBlock: text_block, Player: player) <suspends>: void =
        loop:
            Sleep(0.4)
            DistanceVerticalMeters := FortCharacter.GetTransform().Translation.Z / 100.0
            if (RoundedDevice := Floor[DistanceVerticalMeters] - 22):
                TextBlock.SetText(UIText("- {RoundedDevice} m -"))
                // here add RoundedDevice value to scoreboard for current player

You should be able to use a Score Manager Device with Score Award Type set to Set and just call score_manager_device.SetScoreAward(:agent) then score_manager_device.Activate(:agent)

Maybe do some tests then, I use this for my map but it only updates the giant scoreboard (when pressing the map button), not the HUD Info Box scoreboard

Hi, thank for replying.

The function “SetScoreAward” expects only a type integer, maybe you’re referring to “SetToAgentScore” function, which expects only an agent type (but how can I get that out from Player type variable? ).

Yeah sorry, no I was actually referring to SetScoreAward(:int) then you call Activate(:agent) to set the score of the agent :+1:

1 Like