How do I "remember" variables after a checkpoint?

Get help using Construct 2

Post » Wed Feb 04, 2015 3:01 am

Hi guys,
I recently learned how to create physical checkpoints (I can show you how to do it). My question is, how can I make it so that the checkpoint remembers certain things like ammo, or fuel, or rare items collected?

In my game you only find one checkpoint halfway through the stage, but you need 2 out of 3 rare items collected. Once you get to the checkpoint, and then die, you respawn at the checkpoint but your rares are also reset.

Does anyone know how to make the checkpoint keep track of the fuel and rares?
B
5
Posts: 38
Reputation: 301

Post » Wed Feb 04, 2015 3:25 am

Update:
I used the "persist" behavior. This allows the rares not to respawn after dying, and if I use the R button (which resets the layout, including the checkpoint variable), this also resets the objects which have "persist", but this won't help with the fuel. Any other ideas?
B
5
Posts: 38
Reputation: 301

Post » Wed Feb 04, 2015 5:16 am

I would imagine, you make the fuel and ammo either Global or instance variables. Then have the checkpoint check and remember the instances. The .Capx would make it easier to fix though.
B
7
S
1
Posts: 57
Reputation: 728

Post » Wed Feb 04, 2015 6:49 am

Are you resetting the global variables?
If so, you could create an invisible object with an instance variable "Fuel" that is set at checkpoint, and persists.
B
11
S
4
Posts: 152
Reputation: 1,236

Post » Wed Feb 04, 2015 5:03 pm

@jweickum

https://www.dropbox .com/s/ul24eeaf2cwpe2q/Jetpack_Freefall .capx?dl=0
I'd like the checkpoint to remember the drones collected and the fuel remaining. For this though, I'd have to modify what happens if you're killed by any of the 3 enemies too.
B
5
Posts: 38
Reputation: 301

Post » Fri Feb 06, 2015 2:45 am

The .capx didn't work. You can add the file straight from your computer.

I re-read your problem, and I don't think that the variables, will work.
Once we get your .capx, then we might be able to figure it out. How are you resetting your layout?
B
7
S
1
Posts: 57
Reputation: 728

Post » Fri Feb 06, 2015 7:54 pm

@jweickum the .capx is in the link above your post, you just need to delete the spaces.
B
5
Posts: 38
Reputation: 301

Post » Fri Feb 13, 2015 5:26 am

PixelBoss wrote:@jweickum the .capx is in the link above your post, you just need to delete the spaces.


I deleted the spaces, got a 404.
B
7
S
1
Posts: 57
Reputation: 728


Return to How do I....?

Who is online

Users browsing this forum: brunopalermo, MrQuickGame and 11 guests