Porcelain

Veteran
Veteran
Joined
Oct 12, 2015
Messages
38
Reaction score
2
First Language
English
Primarily Uses
I have my Game_Timer run the following code on expire:
$gameTimer.stop();
SceneManager.goto(Scene_Gameover);

This removes the timer and gives the player a Game Over, but it only works in battle. I'm trying to get it to also work on the map screen. I tried running SceneManager.goto(Scene_Gameover); through a script call on the map, and it worked, so the problem isn't with my timer code.

It looks like both Scene_Map and Scene_Battle update the timer properly with:
var active = this.isActive();
$gameTimer.update(active);

I believe this is a bug with MV's default scripts, but it isn't normally noticed because the timer normally just does BattleManager.abort(); on expiration.

The code for the timer ticking down and expiring is:
Game_Timer.prototype.update = function(sceneActive) {
if (sceneActive && this._working && this._frames > 0) {
this._frames--;
if (this._frames === 0) {
this.onExpire();

The timer ticks down fine on the map, so it is running this code, it just will not do the
$gameTimer.stop();
SceneManager.goto(Scene_Gameover);
part that I've replaced BattleManager.abort(); with.

And is there a way to have the game close all windows on the timer expiring? As it is, it does not close the ActorCommand window or any message/choice windows. It closes the party status and party command windows just fine on going to Scene_Gameover in battle.

Thanks!
 

Yethwhinger

Veteran
Veteran
Joined
Jul 18, 2018
Messages
62
Reaction score
37
First Language
English
Primarily Uses
RMMV
I used an MV version 1.6.1 project with the following plugin based on your description, and it went to the gameover scene whether the timer expired in the battle scene or the map scene. Do you have any other plugins running?
Code:
// TimerGameover.js
// Created on 9/27/2018

/*:
* @plugindesc This plugin is meant to give a gameover
* when the timer expires.
*
* @help This plugin changes the code that runs when
* the game timer expires so that it causes the
* gameover condition.
*/

//----------------------------
// Changes to Game_Timer
//----------------------------

Game_Timer.prototype.onExpire = function () {
    this.stop();
    SceneManager.goto(Scene_Gameover);
};
 

Porcelain

Veteran
Veteran
Joined
Oct 12, 2015
Messages
38
Reaction score
2
First Language
English
Primarily Uses
My project files are version 1.0. Been putting off updating because they're heavily modified.

My code is missing the
this.stop();

so I'll try that. Thank you! If it doesn't work I already have a workaround.
 

Latest Threads

Latest Posts

Latest Profile Posts

100 likes.jpg

I reached 100 followers on my new twitter! It's not much but it's honest work
Made this sign for a you-know-what type of business, completely from scratch.
Gotta admit, i'm extremely proud of it.

image.png
After 7 months of really hard work and then 6 months of lazing around and procrastinating with adding the final touches my game is finally complete! Not bad considering that a year ago I didn't really even know about variables. Thanks to everyone who helped with questions and assets! Feels good to have a game under my belt! Ep2 (also self contained) may possibly come in the future!
I just made a breakthrough in my Battlecore problem where the Abort Battle command wouldn't work after using a Custom Action Sequence skill. It seems that Abort Battle can't be the last command in the event.
Before, the event was ordered (Dialogue -> Abort Battle). But having the message appear LAST fixed it.
(Abort Battle -> Dialogue)

Forum statistics

Threads
126,889
Messages
1,182,132
Members
166,685
Latest member
anxs
Top