Why doesn’t this timer loop work?

Not favoritedFavorited Favorited 0 favourites
  • 8 posts
From the Asset Store
For Adventure, Action, Heroes, Sci-fi and Action-RPG games.
  • Hi Everyone,

    I'm trying to a timed spawn where ever 5 seconds it spawns 3 enemies 1 second apart. But for some reason it only spawns 1 enemy every 5 seconds.

    Thoughts on why this isn't working as intended?

    Edit: fixed the title

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • you should do a function structure and a bit more conditional then that.

    here is a example creature-spawn

    Also your title is not matching your question, is weird... please take your time and change it, so community members can answer about the correct issue you have.

    you are asking how to spawn a object every 5 seconds with 1 second apart from each other while title is saying "how do i export my game" xD confusing, is like opening a kinder egg.

    As for explaining why your code doesn't work, if you notice you are running a every 1 second loop under 1 time trigger? they don't go like that, you can't really run a loop with a wait in between under 1 time trigger cause the 1 time trigger only lasts 1 tick. where 1 second is 60 ticks or more in a second.

  • I tried opening your example but it says it's not a valid file for C3.

  • try open it with latest beta release editor.construct.net/r141-2

  • Still says the file is invalid.

  • try this link create_creatureR136

    try download it first then upload from computer location.

  • System Every 5 Seconds->

    -------Repeat 3 times -> Wait Loopindex Seconds

    -------------------------------Create Monster at x/y

    Every 5 seconds, it will create 3 monsters each 1 second apart

  • System Every 5 Seconds->

    -------Repeat 3 times -> Wait Loopindex Seconds

    -------------------------------Create Monster at x/y

    Every 5 seconds, it will create 3 monsters each 1 second apart

    that is what he did, and it's not how wait 1 inside a every 5 seconds and a repeat 3 works. you can try it and see what happens. :) the event logic block sounds like it, but when you add the waits and every seconds makes sense what actually happens.

    here is what happens in that example. no matter where you put that wait1 it won't work like that cause it just doesn't.

    wait_inside_loop_inside_delayed_loop

    and here is my "fix"

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