How do I cannot reset the global variable ???

Get help using Construct 2

Post » Fri Oct 09, 2015 7:03 pm

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
B
4
Posts: 50
Reputation: 290

Post » Sat Oct 10, 2015 9:25 am

i guess you could save the variable to local storage?
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Sat Oct 10, 2015 9:35 am

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...
B
78
S
23
G
69
Posts: 1,353
Reputation: 44,005


Return to How do I....?

Who is online

Users browsing this forum: Artcadev and 20 guests