0 Favourites

How do I Create Smart Spawner System

  • Hi everyone

    I have been tinkering with spawn event system for a while yet found a best solution for my situation. Maybe experts here have some suggestion / idea / workaround for the problem i had come into.

    Situation:

    • I have 5 different enemies.
    • I have 5 spawner (spawn point)

    What i try to achieve:

    1. Randomly choose 5 different enemies to randomly spawn at 4 different spawner only, at the same time.

    2. For every #seconds, randomly choose 5 different enemies to spawn at 2 different spawner only.

    3. Randomly spawn 5 different enemies at 5 different spawner, but never a spawner spawn at same time.

    4. Controlling which enemies can be spawn at 5 different spawner (such as, an event / trigger point / control).

    (I hope this is not too much. But if it is just focus on the number one. Thanks guys)

    What have i tried:

    By creating group, i can make it enable/disable triggered and spawned enemies, but, at some point, enemies will spawn at 5 different spawner at the same time, which i don't really want. Its kind a hard to figure which event should be put into.

    Can you guys sheds some light.

    *Sorry if my english bad. Do ask if need clarification.

  • This is (kinda sorta) every possible spawn combination in 1 capx.

  • You can randomize your time after each spawn which would give less chance of duplication.

    Use a global variable for SpawnTime instead of every 5 seconds and randomize that after each spawn.

  • This is (kinda sorta) every possible spawn combination in 1 capx.

    Thanks, will definitely look into it.

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • You can randomize your time after each spawn which would give less chance of duplication.

    Use a global variable for SpawnTime instead of every 5 seconds and randomize that after each spawn.

    I think your suggestion will fit perfectly for Q no 3, but i'm a little bit lost here.

    You mean that:

    • I create global variable for SpawnTime.
    • Randomize after each spawn (that will refer to SpawnTime) is this correct?

    If so, (sorry for noob question) what type and value should i put for SpawnTime?

  • > You can randomize your time after each spawn which would give less chance of duplication.

    >

    > Use a global variable for SpawnTime instead of every 5 seconds and randomize that after each spawn.

    >

    I think your suggestion will fit perfectly for Q no 3, but i'm a little bit lost here.

    You mean that:

    - I create global variable for SpawnTime.

    - Randomize after each spawn (that will refer to SpawnTime) is this correct?

    If so, (sorry for noob question) what type and value should i put for SpawnTime?

    Yes- use a global variable for your spawn time instead of a set 5 second interval and randomize it at the first of the event and in each sub event following. That should reduce any duplication.

    There may still be an occasional duplication but it would be very rare.

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