Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

NPC Approach Battle Respawn?

Alright, as some of you may know I am currently developing a Zombie Survival RPG. In my game, there are Zombie NPC's shuffling around on the various maps that I will soon design and when a player is in the area, they will follow you trying to catch you. When they are successful of this, a battle will begin. When you defeat your enemies, the NPC is gone (due to the fact that you defeated it/them).  What I would first like to know is how can I make it so that in my game, the zombies respawn after a certain amount of time or something like that? Maybe even after a certain amount of steps, another one will appear and walk around.

My other question is that, is it possible to make it so that the zombies won't start following the player until they get within' a reasonable distance, or the zombies physically SEE the player? This would prevent the issue of walking around on a map with lets say... 10 zombies on it and even though you are behind walls they will ALL try to get to you in one area.

Thanks for taking the time to help me solve these issues. I appreciate it!
 
Ok, the respawn one is simple.  Just turn on a self switch when you defeat the zombie.  Make a new event page that requires the self switch to be on.  The new page should not have a graphic (unless you have a downed zombie or something).  Put that page on parallel process.  Insert a wait command (however many frames you want to wait before the enemy respawns), and then turn the self switch off.

The other one is either going to require a script or A LOT of variables.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top