1. Hey! Guest! The 33rd GMC Jam will take place between May 23rd, 12:00 UTC (Friday noon) and May 27th, 12:00 UTC (Monday noon). Why not join in! Click here to find out more!
    Dismiss Notice

Drag And Drop Alarm event not counting down

Discussion in 'Programming' started by Colorized, May 18, 2019 at 12:39 AM.

  1. Colorized

    Colorized Member

    Joined:
    Mar 2, 2019
    Posts:
    21
    I have an alarm event with a countdown set to 30. I decided to just extract the value and display the current countdown value in a debug message every step. Turns out, the thing is just not counting down. It stays at 30. What's going on?
     
  2. Binsk

    Binsk Member

    Joined:
    Jun 22, 2016
    Posts:
    523
    You are constantly resetting it in the step event (or other similar repeating event). Either:
    1) Move it to an event that isn't called repeatedly.
    2) Make sure you are checking that the alarm is set to -1 before setting it to 30 to prevent constantly resetting it.

    Also, next time show us your code.
     
  3. Colorized

    Colorized Member

    Joined:
    Mar 2, 2019
    Posts:
    21
    Oh yea forgot to mention:
    The countdown thing starts in a global left pressed event.
     
  4. TheouAegis

    TheouAegis Member

    Joined:
    Jul 3, 2016
    Posts:
    6,508
    Did you create an Alarm event for that particular alarm and put code in it?
     
    Binsk likes this.
  5. Taddio

    Taddio Member

    Joined:
    Nov 16, 2018
    Posts:
    463
    I don't know DnD too well, but add a condition like
    Code:
    if(alarm[0] == -1){
        alarm[0] = 30;
    }
    If you can't find the DnD way of doing that, just drag a Execute Code thing, the code above will work as-is (if you're using alarm0, of course)
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice