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.

Time Event!?

Hello guys,
I am a newbie to RPG Maker VX and I have a question about an event...


How can i mak a time countdown to death?

So I try to explain that:


Try to imagine it is a game about an agent and he puts an trigger, after that he has only 15 seconds left to jump to another place. If he can't he probably gets killed by the explode.

I know that you can make a timer but it doesn't works for my plans wink.gif I also know that I have to make a "if" & "then" code, but still don't know how (yes with after that, the game is over, called "GameOver").

Hope some of you guys can help me. Maybe it isnt't that complicated and I am just stupid unsure.gif ???

Thanks in advance
 
Do this.

>Control Timer: Startup (0 min 15 sec)

Create that after whatever he does after he plants the bomb. Now, create a new event page. An autorun event.

Conditional Branch: Timer 0 min 1 sec or less
@>
Else
@>
Branch end

EXAMPLE:
Conditional Branch: Timer 0 min 1 sec or less
@> Text -,-, Normal, Bottom
:      : Oh no! I'm out of time!
@> Game over
Else
@>
Branch end


Do whatever you need there.
 
Well, if you want a timer that the player can't see, try this script. Just insert it above main and below the default scripts. THen, uyse the following instructions:

Make the event use a script call, and add the following:
Code:
$game_temp.game_timer.start(seconds,timer_number)
seconds must be the number of seconds, and timer number is the number you use to look up that timer.

Then, add a command to that event that changes a self switch to on, and add a new page to the event.

The new page should activate with the self switch you activated, and run on parallel process. Set conditional branch with the following code:
Code:
$game_temp.game_timer.check(timer_number)
where timer_number is the same number you used in the first page.

then, the inside of the conditional branch should be whatever you want to happen if the timer runs out.

Finally, if they escape before the timer runs out, you should add the following code to tyhe event that lets them escape:

Code:
$game_temp.game_timer.kill_timer(timer_number)

timer_number should be the same number you used before. This is supposed to remove the timer, so that you can use the same number again, and so that you can remove useless processing.

Edit: Kylebot2000, he said that the default timer doesn't work for what he needs.
 
Kylebot2000":2psxczvf said:
Do this.

>Control Timer: Startup (0 min 15 sec)

Create that after whatever he does after he plants the bomb. Now, create a new event page. An autorun event.

Conditional Branch: Timer 0 min 1 sec or less
@>
Else
@>
Branch end

EXAMPLE:
Conditional Branch: Timer 0 min 1 sec or less
@> Text -,-, Normal, Bottom
:      : Oh no! I'm out of time!
@> Game over
Else
@>
Branch end


Do whatever you need there.

Can't move my character then. Doesn't work for me,  thanks anyway.

@Glitchfinder: Will try the code, thanks...
 
Kylebot's code is accurate, except for one thing. Rather than using an Autorun event, use Parallel Processing, as that allows the player to move around and interact while the event checks the timer.
 
Regi":2bafi2as said:
Kylebot's code is accurate, except for one thing. Rather than using an Autorun event, use Parallel Processing, as that allows the player to move around and interact while the event checks the timer.

Hmmm tried that, too. I don't know why it isn't working xD?
 

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