0 Favourites

How do I cannot reset the global variable ???

  • Hi, i have a problem with the global variables. I have a game that save the scores on hosting web mysql. the scores are saved when i add valua to variable score, but to know the player id where to assign the score, i pick the global variable IDPlayer when her is logged.

    To respawn the game whe the player lose, i reset all global variables, but also reset idplayer and then cannot to save the followings scores.

    How can i to asign the id player as other way?, or not reset this variable?

    In other words, how can i reset all variables except one?

    Thanks

  • Construct 3

    Buy Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Buy Now Construct 3 users don't see these ads
  • i guess you could save the variable to local storage?

  • try instead o resetting all variables to 0 using a dictionary? and clear dictionary but keep the userid outside the dictionary in a global variable? that way u only need to clear dictionary .. or same as dictionary u can use arrays ... if that is to complicated you can always set the variables u need to reset to initial value manually by setting the actions for each of them when player lose like this : variable 1 set value to 0 etc that way you have bigger control on what u reset and easy to understand...

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)
Similar Topics Posts Views Last Post
Unread hot topic
99 10,155
karshinkoff's avatar
karshinkoff
Unread hot topic
102 6,404
Ashley's avatar
Ashley Construct Team Founder
Unread hot topic
56 4,736
MPPlantOfficial's avatar
MPPlantOfficial