[RMMV] New Game Script Call

Discussion in 'RPG Maker MV' started by EmmaB, Aug 3, 2018.

  1. EmmaB

    EmmaB Veteran Veteran

    Messages:
    38
    Likes Received:
    56
    First Language:
    English
    Primarily Uses:
    RMMV
    Hi everyone,

    I was wondering if there is a new game script call that exists, as I am needing it for a game I am working on. I am wanting to use it for a custom title screen. Any help would really be appreciated.:)
     
    #1
  2. shockra

    shockra Slightly Crazy Programmer Veteran

    Messages:
    405
    Likes Received:
    177
    Location:
    US
    First Language:
    English
    Primarily Uses:
    RMMV
    DataManager.setupNewGame();

    That's the base you'll need, but odds are you'll need other things. The base code in the Scene_Title for a new game looks like this:

    Scene_Title.prototype.commandNewGame = function() {
    DataManager.setupNewGame();
    this._commandWindow.close();
    this.fadeOutAll();
    SceneManager.goto(Scene_Map);
    };

    This video should offer some insight as well:

     
    #2
  3. Prescott

    Prescott argggghhh Veteran

    Messages:
    445
    Likes Received:
    298
    Location:
    USA
    First Language:
    English
    Primarily Uses:
    RMMV
    So, what I do is just transfer them to a new map where the game starts. Depending on the way you've evented your title screen, it might just take them back to the title screen if they start a new game, since the default command of starting a new game will take you to the map your character is set to start on.
     
    #3
  4. EmmaB

    EmmaB Veteran Veteran

    Messages:
    38
    Likes Received:
    56
    First Language:
    English
    Primarily Uses:
    RMMV
    Thanks for the quick replies.

    @shockra I tried it and an error came up.

    In my game, when I start the game, bring up the menu and quit back to the main menu (I have made the quit button transfer the player back to the title screen map), and then press new game, the game transfers the player to the starting map. The problem is, that I have made an event on the starting map that copies events from a different map and pastes them randomly on the starting map. So when the player starts a second game, it spawns the events on the map a second time (if you get what I'm saying) so that, in this case, the starting map will have two sets of the events when it was only meant to have one.

    Sorry, this is very complex. If you don't understand, just let me know and I'll try to explain it better.

    So the reason that I need a New Game script command, is that it will reset the whole game (except for the saves) and start at the title screen.
     
    #4
  5. Prescott

    Prescott argggghhh Veteran

    Messages:
    445
    Likes Received:
    298
    Location:
    USA
    First Language:
    English
    Primarily Uses:
    RMMV
    If you have a skip title screen script, you can still use the default menu command for returning to the title because it is the equivalent of refreshing the game, not actually returning to the title. If you teleport to the title screen, then you're still running the same instance of the game.
     
    #5
  6. EmmaB

    EmmaB Veteran Veteran

    Messages:
    38
    Likes Received:
    56
    First Language:
    English
    Primarily Uses:
    RMMV
    Hi @Prescott,
    I tried using the default return to title screen command but it just went to a blank title screen with the different options (Not the first map). I am using Yami's Skip Title plugin. Is it the wrong skip title plugin to be using maybe? I'm not sure.
     
    #6
  7. BreakerZero

    BreakerZero Veteran Veteran

    Messages:
    569
    Likes Received:
    242
    First Language:
    English (USA)
    Primarily Uses:
    RMMV
    Not much of an answer to provide. Gave this a try myself, got errors from it and gave up (almost) immediately.

    As a workaround (and in case the OP still needs an alternative) I'm gonna risk necroposting and provide an idea of my own that I was debating for just this reason. What I ended up doing is to settle on a slideshow advanced by the player with the first slide set as the title itself. Then, using Hime's pre-title events I made my alternative menu screen (which should NOT be set as the title so leave that set to false and just put in the map ID you're using). Set the start game command as a goto for the normal title scene (the procedure is listed in the pre-title plugin help system if you need a reference point), set load game to push the load scene, exit command to close etc. The rest is particularly technical so make a backup and change only what I mention as the next part involves the source code (so you'd better know what you're doing beforehand... or else). From rpg_scenes.js change Scene_GameEnd.prototype.commandToTitle to call location.reload() instead of the default - this will hard reset immediately but I have not found a way to mitigate this for the sake of presentation so make what you will of it. However, this will also prevent you from going back to the opening slides that you're setting up for this. Finally, on the map where you set the player to start you can build out the rest of your opening sequence and then comment out the addCommand calls for continue and options from rpg_windows.js to finish the process. (Additionally, you should comment out anything and everything that also adds to the title menu in its source, plugin etc. or at least turn off its display from the plugin manager if you're allowed to do so.) You can also change the start game definition to read next page (or just next) and create show choices calls in the rest of the sequence to read likewise for an extra touch of professionalism.
     
    Last edited: Jan 22, 2019
    #7
    howaboutno likes this.
  8. EmmaB

    EmmaB Veteran Veteran

    Messages:
    38
    Likes Received:
    56
    First Language:
    English
    Primarily Uses:
    RMMV
    Thanks @BreakerZero. I think I've fixed the problem already :).
     
    #8
  9. BreakerZero

    BreakerZero Veteran Veteran

    Messages:
    569
    Likes Received:
    242
    First Language:
    English (USA)
    Primarily Uses:
    RMMV
    In that case (and in the event you can provide some insight of your own for improvements and such) then perhaps an idea of how you did it may be of use, either here or in MV tutorials (preferably the latter or subjective equivalent depending on method of resolution). Beyond that, you can elevate this to resolved and notify the mods via the report function if you're done with this.

    EDIT: My issue is that tilesetNames is being reported null. That is to say, it "cannot read property 'tilesetNames' of null".
     
    Last edited: Jan 23, 2019
    #9
  10. EmmaB

    EmmaB Veteran Veteran

    Messages:
    38
    Likes Received:
    56
    First Language:
    English
    Primarily Uses:
    RMMV
    I didn't exactly fix this problem, actually. I just found that I didn't need to use the New Game script call after all. :)
    Thanks for the help anyway.
    (If anyone knows how to fix this problem, you can still post it if you want to, as it may help someone else. :))
     
    #10

Share This Page