Issues With Timers

● ARCHIVED · READ-ONLY
Started by Fangzarie 7 posts View original ↗
  1. So I've been trying to get into working with timers recently but I can't seem to get them to work. I either have one or two problems. Either the timers do not start or show up at all or the timer does not stop despite whatever conditional branch I have used. I have once tried setting up an event with switches in a common event set to parallel, one being "trap timer on" that starts the timer and the other "trap timer off" that stops the timer. I have even tried having a second parallel event running ready to stop the timer under a conditional branch but still no luck. I am unsure if it is a plugin that makes my timers not even show up or if I am formatting my events wrong? Can someone please help me out?

    The event I am trying to accomplish is simple, or so I thought it was simple. I want to make an event that is triggered via player touch. When the player steps on the tile it will display a message and slow the player character down for a determined amount of time. After the time has stopped the players speed will return to normal.

    I included two pictures of what I have currently done with the event. This is on an empty map and the only other event present is the player starting position.
  2. Looking at the event as you have it, you set the timer to 30 seconds, then immediately check if it's 30 seconds or less and stop the timer. So the effect will not happen at all.

    Is this a button the player can keep pressing, and each time they press it, it will cause the same thing to happen?

    If so, delete the If Timer ... test and everything inside it, and put that on the second page. Add a Wait 2 Frames above it all (not inside the condition), change the condition to test for 0 instead of 30, and set the page to Parallel Process. Instead of turning the self switch ON there, turn it OFF. Then go back to the first page, where you set the timer, and also turn the self switch ON.

    So it'll be something like this:
    Code:
    PAGE 1:
    
    Change Speed to 2
    Set Timer to 30 seconds
    Turn on self switch A
    
    
    PAGE 2:
    
    (conditioned by self switch A, set to Parallel Process)
    
    Wait 2 Frames
    If Timer <= 0 then
      Stop Timer
      Change Speed to 4
      Turn off self switch A
    End
  3. Shaz said:
    Looking at the event as you have it, you set the timer to 30 seconds, then immediately check if it's 30 seconds or less and stop the timer. So the effect will not happen at all.

    Is this a button the player can keep pressing, and each time they press it, it will cause the same thing to happen?

    If so, delete the If Timer ... test and everything inside it, and put that on the second page. Add a Wait 2 Frames above it all (not inside the condition), change the condition to test for 0 instead of 30, and set the page to Parallel Process. Instead of turning the self switch ON there, turn it OFF. Then go back to the first page, where you set the timer, and also turn the self switch ON.

    @Shaz you're an absolute life saver I swear! I don't know how you did it but that seems to have worked perfectly! I think what I was getting mixed up on was the fact that I was trying to put the entire event on one page because I think I'd heard somewhere that if you put a timer on a parallel it will keep resetting itself. Plus the whole 30 sends check was absolutely wrong as well. This was a huge aspect of my game because the trap tiles do many things like poison characters or add a burn status for a short time.

    Either way you solved my problem super quick so thanks a ton! This question is closed for me, thanks again!
  4. Fangzarie said:
    I think I'd heard somewhere that if you put a timer on a parallel it will keep resetting itself.
    That is correct as well - you just mixed up two different things:
    The start of a timer and the check for a timer.

    If you put the start for a timer on parallel, it will keep restarting and resetting itself.
    But the check for a timer usually (not always) needs to be repeated because you have to wait until the timer is done.
    There are a few exceptions to this but the check for a timer is mostly done with a parallel process.

    That is why you have to split timing control into two parts, start and end can't be checked in the same event structure.
  5. If your issue is resolved, just report your first post and say so, and the mods will lock the thread for you :) It's faster doing it that way than waiting/hoping for them to see your last post.
  6. @Andar right I'll be sure to keep that in mind.

    @Shaz Thanks again and also I did not know that, thanks for telling me. I'll report it right away.
  7. This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.