Hi All,
I’m having an issue with the Score Manager and can’t seem to get past it. It’s either a bug or I’m doing something super obviously wrong that I can’t see it with my limited Verse knowledge.
Here’s my isolated code (I have this issue replicating in a much wider scope in another project and it’s causing me so much grief):
–
hello_world_device := class(creative_device):
@editable var SM : score_manager_device = score_manager_device{}
var Score : int = 0
var ScoreDefault : int = 1000
PopulatePlayers() : void=
Print("Beginning to populate players")
AllPlayers := GetPlayspace().GetPlayers()
for (Agent : AllPlayers, Player := player[Agent], FortCharacter := Player.GetFortCharacter[]):
SM.SetScoreAward(ScoreDefault)
SM.Activate(Agent)
set Score = SM.GetCurrentScore(Agent)
Print("Player loaded score is {Score}")
# Runs when the device is started in a running game
OnBegin<override>()<suspends>:void=
PopulatePlayers()
–
As far as I can see - Score should print with the 1000 value. But it prints back with Zero value, however the Scoreboard (Map Key in game) and the Score Manager device (phyiscally in game) show 1000.
What is happening?
Thank you in advance.