How do I make a death counter keep past save/ load game

Get help using Construct 2

Post » Wed Nov 19, 2014 8:27 pm

I have implemented a save / load game feature in my platform game so that whenever you fall into the lava / get hit by falling lava then you will load back up at the previous checkpoint you just ran through, I have a problem though with my death counter as it i want it to count all of the deaths you acquire throughout the game but it deletes the +1 which gets added whenever you get put back at the checkpoint, i have tried using 'nosave' on the text but that doesnt work and have just completely ran out of ideas. the death counter is a global variable which adds onto text on-screen whenever you 'on-collision' with certain objects making them change your x and y co-ordinates to the previous checkpoint, this also loads the state of which the game was in whenever you ran through that checkpoint and in this case will be 0 deaths but i want it to ignore the death variable and make it +1 onto it over and over how many times you die

Help would be very much appreciated :)
B
3
Posts: 4
Reputation: 183

Post » Wed Nov 19, 2014 8:45 pm

One suggestion: after loading your checkpoint save, add 1 to your death count(to bring it back to where it was pre-load), then save again.
Moderator
B
113
S
41
G
20
Posts: 1,586
Reputation: 19,116

Post » Wed Nov 19, 2014 9:21 pm

i tried that but it doesnt seem to work :( you just do that by placing the +1 death after the checkpoint x+y load right
B
3
Posts: 4
Reputation: 183

Post » Wed Nov 19, 2014 9:43 pm

Putting it after the load action probably wouldn't work, no. The system object has a trigger called "On load complete" which is called when your game finishes loading a previous state -- that's probably what you want, so you can do your increment and save as an action there.
Moderator
B
113
S
41
G
20
Posts: 1,586
Reputation: 19,116

Post » Wed Nov 19, 2014 10:11 pm

ohhh i see :p didnt realize haha, i just tried that it will go up from 0 to 1 deaths but after that it wont go up to 2,3,4 etc when i die repeatidly :S
B
3
Posts: 4
Reputation: 183

Post » Wed Nov 19, 2014 10:15 pm

ohh now it works! i added the save after it like you suggested in your first post, just missed it out :p thanks alot for that buddy i really appreciate it, my game is pretty much nearly complete now :)
B
3
Posts: 4
Reputation: 183


Return to How do I....?

Who is online

Users browsing this forum: Blendi1223, kellehk and 27 guests