Make a counter not reset to zero when frame restarts

Welcome to our brand new Clickteam Community Hub! We hope you will enjoy using the new features, which we will be further expanding in the coming months.

A few features including Passport are unavailable initially whilst we monitor stability of the new platform, we hope to bring these online very soon. Small issues will crop up following the import from our old system, including some message formatting, translation accuracy and other things.

Thank you for your patience whilst we've worked on this and we look forward to more exciting community developments soon!

Clickteam.
  • I made a checkpoint system where when the character overlaps a checkpoint, a counter is set to a certain number, then, at the start of the frame, the character spawns at that checkpoint depending on what number the counter is on. It worked when I set the numbers individually, but when I try it in practice, the counter keeps getting set to zero whenever the frame restarts. I even tried making the counter a global object and then moving the checkpoint code to the global event editor and that didn’t fix it. Is there a way to make it so that the counter stays at the same value when the frame restarts?

  • You can use a global value in place of the counter. Global values remain regardless of a frame reset. You would just replace the counter with that global value.

    If the counter object is absolutely required, you can use the global value to hold the checkpoint number and then set the counter to that global value.

    Beyond that, I do not think it is possible to retain local object data on a frame reset without the assistance of outside data.

    Edited once, last by spellsword0 (August 24, 2020 at 9:40 PM).

  • Instead of using a counter, use a global value. They are saved across frames and also if a frame is restarted.

    If you want to display it, then just set a counter to always equal the global value.

    Edit: Okay - so what Spellsword0 said - but you can also save it in an ini file, an array or as an alterable value of a global object.

    Casual games: Please login to see this link.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!