1
$\begingroup$

I'm making my first zombie game in the Blender Game Engine. It is a first-person-shooter style game with zombies and stuff like that.

I am having trouble making an enemy spawner for the zombies however. I got it working somewhat before but after a certain amount of time the zombies just start to stack up on top of each other because I cannot get it to only spawn the zombies at the start of the game and after one dies. I changed it up some but now they don't spawn at all.

It really would be nice to have zombies spawn randomly within a specific area of the game but far away from the player. I don't know how to code in python so I'm making my game only with logic bricks. I have an empty currently that is supposed to spawn the zombies but it doesn't work.

Can you please help? You can download the game here: Undead Fields

$\endgroup$
  • $\begingroup$ making a game only with logic bricks will be quite hard and challenging. $\endgroup$ – Tooniis Jul 22 '17 at 5:53
  • $\begingroup$ Luckily I've gotten pretty far over the past few days! I'm sure there's a way. I just dont know how. With a recent version I was able to get a spawner working pretty well. It would spawn a zombie if the player was far away and if there were no zombies by it. I however would prefer something that would detect if there was a max amount of zombies on screen and if not it would fill in for the extras by putting them in a random place in a set zone. If I need a script for this that's fine, as long as it's a copy/paste sort of thing. $\endgroup$ – Caden Mitchell Jul 22 '17 at 7:45
  • $\begingroup$ I also think you will find a way with logic bricks but you may want to learn using scripts because they will make your work much easier. GL $\endgroup$ – Tooniis Jul 22 '17 at 7:47
  • $\begingroup$ Is there a sensor to detect a max amount of objects? I would really probably only need that and it might work. $\endgroup$ – Caden Mitchell Jul 22 '17 at 7:49
  • $\begingroup$ I keep getting this error in the console Warning, object "Empty.014" from AddObject actuator "Edit Object" is not in a hidden layer. even after moving that object to a hidden layer $\endgroup$ – Tooniis Jul 22 '17 at 8:40
1
$\begingroup$

As non-python solution I suggest following:

  1. create an action with location keys. Each frame the action should contain a single spawn position. e.g frame 1 = position 1, frame 2 = position 2 ...

  2. when you want to spawn an enemy

    2.a. create an random integer number in a property via random actuator.

    2.b you play the action frame at the emitter (empty) via Action Actuator in property mode (using the random property).

    2.c with a collision/ray/near/radar sensor check if the spawn point is empty. If so add an enemy and continue with 2. If not continue with 2.a

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.