Status
Not open for further replies.

Lunesis

Veteran
Veteran
Joined
Oct 4, 2015
Messages
94
Reaction score
37
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
94
Reaction score
37
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
94
Reaction score
37
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
94
Reaction score
37
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,000
Reaction score
5,889
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

Creating 3D CGs for Cutscenes. :kaosalute:

I keep wanting to post every song I make for the game and have to hold back on that because at this rate, I'll have spoiled all the really good stuff lol..
DerniBorges wrote on TSR's profile.
Is there any way this plugin works with the big character, and the QSprite plugin? Using RTP chars, everything works fine, but the big ones, with QSprite, it's like that in the image, it doesn't reflect right. And there is, in the settings, an option to fix it. Thanks.
bug2.png
Bengawan Solo with fantasy style arrangement. :D
So I just got my computer back (Was posting stuff on my phone) But now my dang monitor's broken! I'll need to get a new one, which means... JOBS! Yaaay... When I get a new monitor, I'll post picture of one of my RPGMMV projects.
Wish me luck... :kaodes:

Forum statistics

Threads
115,897
Messages
1,093,801
Members
151,141
Latest member
daisyiscute
Top