Hey Truong,
I was trying out this code, but it still seems to forget value after a round. Any additional insights you can share? ![]()
I’m trying to make a scoreboard that increments on elimination and consistent between rounds.
The score increases correctly, but after a round, the score is reset again
var ScoreTeamOne : weak_map(session, int) = map{}
var ScoreTeamTwo : weak_map(session, int) = map{}
HUDScoreboard := class(creative_device):
@editable EM_eliminationManager_TeamOne :elimination_manager_device = elimination_manager_device {}
@editable EM_eliminationManager_TeamTwo :elimination_manager_device = elimination_manager_device {}
# Runs when the device is started in a running game
OnBegin<override>()<suspends>:void=
Print("TEST DEVICE")
EM_eliminationManager_TeamOne.EliminatedEvent.Subscribe(PlayerEliminatedTeamOne)
EM_eliminationManager_TeamTwo.EliminatedEvent.Subscribe(PlayerEliminatedTeamTwo)
PlayerEliminatedTeamOne(Agent : agent) : void =
X := if (Y := ScoreTeamOne[GetSession()]) then Y + 1 else 1
if:
set ScoreTeamOne[GetSession()] = X
Print("Elminated Team 1: {X}")
PlayerEliminatedTeamTwo(Agent : agent) : void =
X := if (Y := ScoreTeamTwo[GetSession()]) then Y + 1 else 1
if:
set ScoreTeamTwo[GetSession()] = X
Print("Elminated Team 2: {X}")