How do I "remember" variables after a checkpoint?

0 favourites
  • 8 posts
From the Asset Store
Easily store, modify, read and manipulate colors with Color Variables!
  • 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?

  • 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?

  • 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.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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.

  • 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.

  • 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?

  • jweickum the .capx is in the link above your post, you just need to delete the spaces.

  • jweickum the .capx is in the link above your post, you just need to delete the spaces.

    I deleted the spaces, got a 404.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)