Timer help

This forum is currently in read-only mode.
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported.
  • I'm making a game which runs in real-time and not turn-based. With the help of this community and the S plugin I've managed to finish the guts of a semi-complicated ability system (yay, thanks!) but ran into an issue in putting finishing touches on it. I need to create a cast time for each ability. Each character and NPC can use one ability at a time that takes some pre-set time to use. I was wondering what the most accurate way to implement this would be.

    I've read about issues with frame-rate and timers, which I would like to avoid. In addition, I read that using the timer behavior can cause issues when dealing with multiple instances of an object, or something of that nature, and that "Every X" command botches picking.

    Not sure what other issues there are, but what would be the best way to implement a cast-time when an ability is used so that:

    1. The timer is as accurate as possible since it will be necessary for balancing issues

    2. The timer avoids known bugs

    3. The timer preserves the real-time nature of the game so that other events can run freely while the timer counts down.

    4. The timer works with instances of the same object.

    Thanks for your input :)

  • The timer behavior works fine. "on timer" is a triggered event, so it will be evaluated out of order of the rest of the event sheet. You also can't see how much time is left on the timer.

    You can also use a variable. Set it to the number of seconds you want and subtract TimeDelta from it every tick. The timer is done when it's less than or equal to 0. The main advantage this has over the behavior is you can see how much time is left.

    The only inaccurate way is using "every x milliseconds" to decrement a timer when x is close to 1000*TimeDelta.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I see, thanks for the input, sounds like I need to use a variable as you mentioned because I do need to see how much time is left. Thanks!

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