Enemies do not respawn.

0 favourites
  • 14 posts
From the Asset Store
2D fighting template based in the game that defined the fighting games genre.
  • I am creating a survival horror, there are many enemies, especially when you go out on the streets.

    Is there a way to make enemies not spawn when you switch scenes?

  • It's matter of flagging condition by a boolean or any other parameter that meets condition. You can also compare things to decide an action that needs to be performed. Depends on how the spawning system you are set, adding extra condition probably the way to go.

  • I tried that at first, but having a dictionary key for each enemy is crazy, there are too many.

    Despite doing it with a family variable, but it doesn't work.

  • Can't do much without really seeing how things structured. An example of summoning: dropbox.com/s/1ng5la2xx3yjyvr/summon_random.capx

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • The streets are infested with zombies, there are a lot of them. That is why it is so difficult for me.

  • You can limit how much enemies on screen or within layout by add comparison: enemies.Count < 10 for example at spawning/create condition.

  • My problem is not the number of enemies, the problem is that the enemies respawn when you change scenes. If you kill a zombie, when you go back to the street, the zombie has respawned.

  • Maybe if just before you switch the scene, you do a loop on all zombies there, save their X, Y and health in an array.

    After, when you go back in this scene, the array must be loaded on start of the layout.

    Like this, the same zombies on same positions are still there. However, keep in mind that can be annoying if a zombie is camping near the door used by the player for coming back there.

    You can check the Construct 3 plugin here: construct.net/make-games/addons/319/savestate

    To be use at your own risk since it's made by the community and not Construct 3. So, community plugin always has a risk to break your game, but this addons got no angry devs so far.

    Good luck :)

  • Thanks for sharing the plugin, I didn't know about it. I'll do some tests.

  • I have done many tests with this plugin, and I have not achieved anything. I think, or don't know how to do it, that the plugin doesn't support families.

  • I have the same problem with items. If bullets are found, when the player returns, the bullets also respawn, always fix this with the dictionary, but there are too many objects, to assign a key to each 1.

  • How are you spawning the zombies and items? Depending on how you spawn them, there are different solutions.

  • In reality the zombies and the objects are placed in the design of the game.

  • If they're placed in layout, you could try keeping track of the zombies/items NOT to spawn.

    For example, whenever a zombie is destroyed, add the zombie UID to an array. When the player enters a room, at the start of the layout, loop through the array and destroy any zombies with UID on that list. The same can be done with items.

    There's probably a more efficient way to do this (like creating one array per layout), but the general idea here is to keep track of just what's been destroyed.

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