Status
Not open for further replies.

Lunesis

Veteran
Veteran
Joined
Oct 4, 2015
Messages
91
Reaction score
33
First Language
English
Primarily Uses
RMMZ
I am trying to set up a battle in MZ on a timer. You will have 10 seconds to answer a question, and if you run out of time you get a failure message and the battle aborts. Don't know how to order this event. I know I need to make a loop of some sort to check the timer but not sure how exactly:

1628217531504.png

What happens currently is the timer will reach 0 but the choice window will still be open, and it waits for you to choose an answer and then aborts the battle with no comment.
 

Winshifter

Veteran
Veteran
Joined
Feb 24, 2017
Messages
88
Reaction score
59
First Language
Spanish
Primarily Uses
RMMV
You will need a plugin for this.
By default, in battle, when the timer reaches 0, the battle is aborted. Also, by default, choices in MZ takes as much time as the player wants.

Tsukihime had a plugin but for MV, I don't think there is an MZ version though.

EDIT
There is a plugin by Galv, MZ Message Timer, probably that should work for you.
 

Lunesis

Veteran
Veteran
Joined
Oct 4, 2015
Messages
91
Reaction score
33
First Language
English
Primarily Uses
RMMZ
You will need a plugin for this.
By default, in battle, when the timer reaches 0, the battle is aborted. Also, by default, choices in MZ takes as much time as the player wants.

Tsukihime had a plugin but for MV, I don't think there is an MZ version though.
Aww, alright. I figured I would have to find a way to break the choices scene somehow. Thanks for reply! There are a few out there like https://galvs-scripts.com/2020/10/11/mz-message-timer/ but I was having trouble getting it to work in battle. Maybe I'll try again.
 

Syberduh

Villager
Member
Joined
Jul 26, 2021
Messages
21
Reaction score
8
First Language
English
Primarily Uses
RMMZ
Here's something that sort of does what you want. It uses a $gameTimer.pause() script call to keep the timer from counting down while the choice menu is displayed and penalizes the player by wasting 2 seconds when they choose a wrong answer (in this case "no" or "maybe"). It triggers the "Time's Up!" text at 1 second in order to get around the battle automatically ending at 0.

It doesn't have the time pressure during the actual choice, which is too bad, but it does have ticking clock mechanic and doesn't require any plugins.

The way it's written right now, the player can't take any battle actions until making the right choice.

Note: this is really not elegant code but it shouldn't light anything on fire. But no warranties etc.

Code:
◆Text:None, None, Window, Bottom
:    :Hurry up and choose!
◆Control Timer:Start, 0 min 10 sec
◆Label:CCC
◆Script:$gameTimer.resume()
◆Wait:120 frames
◆If:Timer ≥ 0 min 3 sec
  ◆Script:$gameTimer.pause()
  ◆Show Choices:Yes, No, Maybe (Window, Right, #1, -)
  :When Yes
    ◆Control Timer:Stop
    ◆Jump to Label:BBB
    ◆
  :When No
    ◆Text:None, None, Window, Bottom
    :    :WRONG!
    ◆Jump to Label:CCC
    ◆
  :When Maybe
    ◆Text:None, None, Window, Bottom
    :    :WRONG!
    ◆Jump to Label:CCC
    ◆
  :End
  ◆
:End
◆Label:AAA
◆Wait:6 frames
◆If:Timer ≤ 0 min 1 sec
  ◆Script:$gameTimer.pause()
  ◆Text:None, None, Window, Bottom
  :    :Time's up!
  ◆Script:$gameTimer.resume()
  ◆
:Else
  ◆Jump to Label:AAA
  ◆
:End
◆Label:BBB

Here's what it looks like in action:

 
Last edited:

Lunesis

Veteran
Veteran
Joined
Oct 4, 2015
Messages
91
Reaction score
33
First Language
English
Primarily Uses
RMMZ
Here's something that sort of does what you want. It uses a $gameTimer.pause() script call to keep the timer from counting down while the choice menu is displayed and penalizes the player by wasting 2 seconds when they choose a wrong answer (in this case "no" or "maybe"). It triggers the "Time's Up!" text at 1 second in order to get around the battle automatically ending at 0.

It doesn't have the time pressure during the actual choice, which is too bad, but it does have ticking clock mechanic and doesn't require any plugins.

The way it's written right now, the player can't take any battle actions until making the right choice.

Note: this is really not elegant code but it shouldn't light anything on fire. But no warranties etc.

Code:
◆Text:None, None, Window, Bottom
:    :Hurry up and choose!
◆Control Timer:Start, 0 min 10 sec
◆Label:CCC
◆Script:$gameTimer.resume()
◆Wait:120 frames
◆If:Timer ≥ 0 min 3 sec
  ◆Script:$gameTimer.pause()
  ◆Show Choices:Yes, No, Maybe (Window, Right, #1, -)
  :When Yes
    ◆Control Timer:Stop
    ◆Jump to Label:BBB
    ◆
  :When No
    ◆Text:None, None, Window, Bottom
    :    :WRONG!
    ◆Jump to Label:CCC
    ◆
  :When Maybe
    ◆Text:None, None, Window, Bottom
    :    :WRONG!
    ◆Jump to Label:CCC
    ◆
  :End
  ◆
:End
◆Label:AAA
◆Wait:6 frames
◆If:Timer ≤ 0 min 1 sec
  ◆Script:$gameTimer.pause()
  ◆Text:None, None, Window, Bottom
  :    :Time's up!
  ◆Script:$gameTimer.resume()
  ◆
:Else
  ◆Jump to Label:AAA
  ◆
:End
◆Label:BBB

Here's what it looks like in action:

Huh, interesting! I will try this out and see if it works for my situation. Thanks!
 

Lunesis

Veteran
Veteran
Joined
Oct 4, 2015
Messages
91
Reaction score
33
First Language
English
Primarily Uses
RMMZ
I managed to get Galv's message timers working for this to my satisfaction. Just put MT[10] in the text for the first choice. Also I have learned that a lot of plugins do not work in troop test. You can lock this thread.
 

slimmmeiske2

Little Red Riding Hood
Global Mod
Joined
Sep 6, 2012
Messages
8,947
Reaction score
5,856
First Language
Dutch
Primarily Uses
RMXP

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.

 
Status
Not open for further replies.

Latest Threads

Latest Profile Posts

seems absolutely WILD to me now all the hundreds of hours of work I used to do in 2k(3) over a decade ago with a resolution of 320x240. that seems so insanely TINY now, seemed so normal at the time!
Playing Aroma Indosiar theme song.
Aroma is an Indonesian TV show about cooking. :)
Working on a characteeer! (Why is it so hard to color hair?) ;-;
Silly-Sketches.png
Just finished eventing a couple simple puzzles in RMMV, for my very first game "Sample Quest." Just messing around, throwing things together, and calling it a story XD On a non-RM note, got my hair cut today!
I feel the need to inform everyone on the forums NOT to go with Web Hosting Canada for your hosting needs. It is by far the worst customer service and just overall experience I have ever had with hosting and I am Canadian...

Forum statistics

Threads
115,372
Messages
1,089,347
Members
150,067
Latest member
GutterRat
Top