Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

[Resolved] Timer Help

Here's the situation. My game uses a mining/crafting system, (or at least, it will, once i get the hang of it) and when you find a rock that you can mine, you enter a mining minigame in which your character enters a room full of shiny rocks, which may or may not have ores in them. You have 30 seconds to run around the room and collect as much ore as you can. I used a parallel process event:
Code:
@Control Timer: Startup (0 min. 30 sec.)
            @Conditional Branch: timer 0 min 0 sec or less
             @Text: Time's up, nice mining!!!
             @Control Self Switch: A =ON
             @Transfer Player: [015: Tree Cave-Treasure Room], (017,012)
             @
            :else
           @
               :Branch End
@
Problem is, this event just starts the timer, and then the timer stops at 29 seconds for some reason. I have no other events that interfere with the timer in any way (unless you count the conditional branch on this event) so i cannot figure out why this timer stops at 29 seconds... Anybody know why?
 
Firstly, the way you set up the script has the trouble of simply skipping the conditional branch...always.
You should set up the first page as a parallel process saying

startup timer (blah time)
Control self switch A: ON

Then a second page, with the condition that self switch A is on which does

conditional branch: timer 0 min 0 sec or less
  Text: Time's up, nice mining!!!
  Control timer: Stop
  control self switch: A = OFF
  Transfer Player: [015: Tree Cave-Treasure Room], (017,012)
Branch end

It also needs to parallel process (you can just remove the "else" bit, by unticking the "set handling when conditions do not apply" option in the conditional branch window)
That SHOULD work
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top