Status
Not open for further replies.

Lunesis

Veteran
Veteran
Joined
Oct 4, 2015
Messages
96
Reaction score
42
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
96
Reaction score
42
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

Veteran
Veteran
Joined
Jul 26, 2021
Messages
31
Reaction score
17
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
96
Reaction score
42
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
96
Reaction score
42
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
9,018
Reaction score
5,903
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 Posts

Latest Profile Posts

New profile picture! This time, it's representative of my current project.
I suddenly feel like making a game for little kids: a pointless sandbox of cute animals, silly collectibles, and random mini games.
Anyone else just like, not bother to make games themed around specific holidays? I know I won't get them done in time for it to make sense.
time to enter the playtest dimension
Sherriff: This permit you're renewing expired two months ago, you haven't been concealing illegally have you?

Me, remembering the sheriff was at the range with me a couple weeks ago and unsure if he'd noted me draw from IWB: I plead the fifth.

Forum statistics

Threads
115,987
Messages
1,094,666
Members
151,273
Latest member
jackson1813
Top