How do I reset some persistent objects?

0 favourites
  • 4 posts
From the Asset Store
Hand-painted tiles, objects, animated objects, and background to build a colorful Mayan civilization environment.
  • Hi, I’m currently working on a metroidvania in which enemies and doors and gates and many objects have the “persist” behavior. This way, when the player opens a gate and travels to another layout then comes back, the gate is still open. Similarly, I like for the enemies to stay dead. However, when a play saves, I want enemies to respawn. There is an event for “reset all persistent objects” but is there a way to only reset a family (such as an “enemy” family)?

    Thanks!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • If you want it so all enemies in the game reset upon a save then don't use persist on the gates and instead use variables to track if it should be open.

  • See I would do that, but there’s honestly way more things I want to stay persistent than there are enemies. Small things like pickups, chests, and gates. Adding all of those as variables would be very cumbersome I think so I’m trying to avoid doing that if possible.

  • Then take persist off the enemies and calculate it another way. Can't see the game, don't know how they spawn or act, but you should be able to detect them.

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