Reset "Total Play Time" While In Game?

AdamSakuru

[Null_Value]
Veteran
Joined
Mar 14, 2014
Messages
314
Reaction score
171
First Language
English
Primarily Uses
N/A
I evented a custom title screen and have it so that the default title screen is skipped over (it goes straight to a map where my title scene plays out.) The thing is, if the player wants to return to the title screen mid-game or through a game over, it'll go to the 'default' one (hitting 'New Game' from there will take you to the player's starting point, which is on that title map.)

I'd like to avoid this because it's an unnecessary step in-between. I thought of manually 'resetting' the game in an event that would get rid of all the items in the inventory, reset the party, gold, etc. but I don't know how to reset the total in game time while in a game. And I realized that if the player sits on the custom title screen for an hour, that hour would be included in the 'New Game' they'd start. So that's another instance where I'd need to reset it.

Is this possible through a script call or something?
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,056
Reaction score
13,685
First Language
English
Primarily Uses
RMMV
Why don't you address the actual problem and make it go to your evented title screen instead of the real one?
 

AdamSakuru

[Null_Value]
Veteran
Joined
Mar 14, 2014
Messages
314
Reaction score
171
First Language
English
Primarily Uses
N/A
Why don't you address the actual problem and make it go to your evented title screen instead of the real one?
How would I do that?
Originally I was using a plugin (DK Skip Title Screen) but I didn't realize until much testing later that it would actually go to the default title screen if you returned to the title screen Mid-game/with a game over. Currently I stopped using that plugin and I've produced the same effect by commenting out some lines in one of the base JS files (rpg_scenes).

Code:
Scene_Boot.prototype.start = function() {            ///SKIP TITLE SCREEN EDIT
    Scene_Base.prototype.start.call(this);
    SoundManager.preloadImportantSounds();
    if (DataManager.isBattleTest()) {
        DataManager.setupBattleTest();
        SceneManager.goto(Scene_Battle);
        } else if (DataManager.isEventTest()) {
            DataManager.setupEventTest();
            SceneManager.goto(Scene_Map);
        } else {this.checkPlayerLocation();
            DataManager.setupNewGame();
            SceneManager.goto(Scene_Map);
    }
    this.updateDocumentTitle();
};

Edit: Is there a more efficient way to remove the default title screen entirely?
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,056
Reaction score
13,685
First Language
English
Primarily Uses
RMMV
in rpg_scenes.js find the function Scene_Menu.prototype.commandGameEnd and replace its contents with

DataManager.setupNewGame();
SceneManager.goto(Scene_Map);

I haven't tested this, so it might not work quite right.

Also, be careful with changing the default scripts - if you get a new version of MV and want to update your project, you'll need to know what changes you made, and redo them.
 

AdamSakuru

[Null_Value]
Veteran
Joined
Mar 14, 2014
Messages
314
Reaction score
171
First Language
English
Primarily Uses
N/A
in rpg_scenes.js find the function Scene_Menu.prototype.commandGameEnd and replace its contents with

DataManager.setupNewGame();
SceneManager.goto(Scene_Map);

I haven't tested this, so it might not work quite right.

Also, be careful with changing the default scripts - if you get a new version of MV and want to update your project, you'll need to know what changes you made, and redo them.
For sure, I haven't touched the base ones otherwise. I have MV on Steam. It has updated a number of times and this particular thing wasn't affected yet, but I'll keep that in mind.

This worked! You also taught me enough to answer what my next question for you was!

I wanted to modify it slightly because putting it where you initially suggested would immediately return to the title screen if you chose that command. I was just thinking of a player becoming potentially frustrated if they hit this command accidentally, so I thought the best place to have this occur would be in scene_GameEnd when choosing 'To Title'

Code:
Scene_GameEnd.prototype.commandToTitle = function() {
    this.fadeOutAll();                    //New content
    DataManager.setupNewGame();           
    SceneManager.goto(Scene_Map);
    //this.fadeOutAll();                //Original Contents
    //SceneManager.goto(Scene_Title);
};

Thanks for the help!
 
Last edited:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,056
Reaction score
13,685
First Language
English
Primarily Uses
RMMV
Steam will update MV itself, which will affect future projects, but it will not update your existing projects - you need to do that manually if you want the benefit of the updates. It is this manual update of your existing projects that you will need to take care with - it involves copying the latest version of those core files over your existing ones, and you could wipe out your changes.

You are better off creating a new .js file in the plugins folder, copying the methods you want to change into that new file, and changing them there. Then add it to your project as a plugin. This way you can safely update your project's core files, but your plugin still remains and will override those functions.
 

Llareian

Jack of All Trades, Master of None
Veteran
Joined
Jan 26, 2017
Messages
604
Reaction score
1,421
First Language
English
Primarily Uses
RMMV
While this isn't exactly in line with your original post, in your last post you noted that you don't want the player to accidentally restart the game. I'd like to point out a plugin I discovered today...LadyBaskerville's Confirm Reload. If your player unwittingly hits F5, it will ask them to confirm whether they want to reload the game rather than simply reloading on one key press.
 

AdamSakuru

[Null_Value]
Veteran
Joined
Mar 14, 2014
Messages
314
Reaction score
171
First Language
English
Primarily Uses
N/A
Okay, I can do that!

Edit:
I had a small issue pop up but I managed to resolve it.
 
Last edited:

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

YES! officially released my games soundtrack on Itunes, Spotify, and Amazon..... kinda cool!

Another old age version of Reid. Trying out different style.
Hey everyone! Not sure how many people know about Cafofo Music on Itch.io, but I highly recommend their Sound Effects! It is amazing quality AND quantity and best of all, they are having a 50% sale! I can't express how much I love sales.
Wow.... My last map GIF got 47 likes, 16 retweet and 2,105 views on Twitter in 24 hours. My game thread here's only got 3k views in 6-7 months. I guess building my Twitter was insanely worth it. :LZSexcite:

Forum statistics

Threads
105,594
Messages
1,014,876
Members
137,264
Latest member
ZeoValinferno
Top