Manging game state

some_device := class(creative_device):
    var Counter: int = 0

    OnBegin<override>()<suspends> : void =
        Print("Counter value: {Counter}")
        set Counter += 1

The code above, will reset counter every round, as if the some_device class is being re-instantiated every round.

How do you suppose to maintain game state when every variable resets every round?

I saw the persistent data documentation, I need game state management, persistent between rounds, not between game sessions.

Also, persistent data documentation seem to revolve around mapping a player to some struct, what about data that is not player related?

You can’t store data that is not player related yet, a solution would be to either do your own round system, or to store things inside player data somehow

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.