Tuesday 24 January 2012

Spawner - Spawn More Enemies


It's started to look like 2012 is the year of giving from us, here at Corrupted Smile Studio. Coming this week is a Spawner system for spawning enemies. We have taken a previous released Spawner script that Garth made a couple years ago and done some upgrades and additions.

Some details about the system to follow.

Version: 1.0
Source Code: C#
Unity Version: 3.4.1 Free
Price: Free

Features:
  • Works with Unity free
  • Spawn Modes
    • Continual (keeps the number of spawned units at the total number of units)
    • Once (spawns up to the total only once)
    • Wave (spawns in waves, once all are dead, spawns again)
    • Timed Waves (spawns in waves, once the time is up, spawns again)
    • Time Split Waves (spawns in waves, once all are dead, waits time then spawns)
  • Supports 4 different unit levels (Allows easy switching of difficulty)
  • Has a custom inspector to ease usage
Custom Inspector
Regards,
Garth

4 comments:

  1. Hey I downloaded your Spawner. It works great, but I get an error from the Spawner.cs file, it says that Send Message has no reciever.

    I was wondering how to fix that? if you could post an example or the solution to the problem.

    Thanks for your help.

    ReplyDelete
    Replies
    1. Included with the system is a file called ISpawnable.cs this contains an interface (which is similar to a class but does not contain any actual definitions to the methods, http://msdn.microsoft.com/en-us/library/ms173156.aspx).

      ISpawnable contains two required methods to be available on a GameObject that is being spawned (Remove and SetID). When a object is spawned there is a message sent to the object for the method SetID.

      Now, what is happening is that the object you are spawning doesn't contain the method SetID(int ID).

      The easiest way to fix this will be to simply place a SpawnAI.cs component on the object, then when you wish to destroy the object remember to call the Remove() method on the SpawnAI component.

      However, if you extend from ISpawnable and implement the required methods in one of your already made classes, that should also do the trick.

      I will post up a full tutorial for setting up and using the Spawner system hopefully this week still.

      Regards,
      Garth

      Delete
  2. Thanks Garth that works!, sorry for the very late reply, I
    never got a email about your reply.

    Keep up the great work! :D

    ReplyDelete
  3. Is there a way to make it spawn weak, then medium then strong then boss?

    ReplyDelete