BoneCollectors

Dino Hazard: Chronos Blackout Dev
Veteran
Joined
Dec 6, 2017
Messages
62
Reaction score
15
First Language
Portuguese-BR
Primarily Uses
RMMV
Hi!

In our game, we have specific places to save the game and other places to load the game.

I am trying the edit the Save/Load scene because I want to limit the options depending on the load restrictions.

I am writing something wrong in the lines below.

JavaScript:
Window_SaveAction.prototype.makeCommandList = function() {

    var id = this.savefileId();

    var enabled = DataManager.isThisGameFile(id);

    var isLoadEnabled = DataManager.loadSavefileInfo(id);

/// Conditional Save/load menus

    function {

      if (this._mode !== 'save') return false;

      return this.addCommand(this.getCommandName('save'), 'save', this.isSaveEnabled()); && this.addCommand(this.getCommandName('delete'), 'delete', enabled);

      } else if (this._mode !== 'save') return true;

      return this.addCommand(this.getCommandName('load'), 'load', isLoadEnabled; && this.addCommand(this.getCommandName('delete'), 'delete', enabled);

  };

Can someone spare a minute to help me?
 

ShadowDragon

Realist
Veteran
Joined
Oct 8, 2018
Messages
7,513
Reaction score
3,022
First Language
Dutch
Primarily Uses
RMMV
I dont know why you set the condition in a function at all?

other that that you miss a closing brackets "}"

remove the "function {" as this is not required. as it isn't a function at all.
 

BoneCollectors

Dino Hazard: Chronos Blackout Dev
Veteran
Joined
Dec 6, 2017
Messages
62
Reaction score
15
First Language
Portuguese-BR
Primarily Uses
RMMV
Hi!
Thanks for your reply! I changed the code and still no success:

JavaScript:
Window_SaveAction.prototype.makeCommandList = function() {

    var id = this.savefileId();
    var enabled = DataManager.isThisGameFile(id);
    var isLoadEnabled = DataManager.loadSavefileInfo(id);

/// Conditional Save/load menus
    if (this._mode === 'save') {
    return this.addCommand(this.getCommandName('save'), 'save', this.isSaveEnabled());
    } else if (this._mode !== 'save') {
    return this.addCommand(this.getCommandName('load'), 'load', isLoadEnabled;
    }
    this.addCommand(this.getCommandName('delete'), 'delete', enabled);
};
 

BoneCollectors

Dino Hazard: Chronos Blackout Dev
Veteran
Joined
Dec 6, 2017
Messages
62
Reaction score
15
First Language
Portuguese-BR
Primarily Uses
RMMV

ShadowDragon

Realist
Veteran
Joined
Oct 8, 2018
Messages
7,513
Reaction score
3,022
First Language
Dutch
Primarily Uses
RMMV
maybe take a look at TSR_Save which is fully customizable, that also have a delete function
on it, and yo can make it more unique.

it does have everything that a save/load could have.
 

BoneCollectors

Dino Hazard: Chronos Blackout Dev
Veteran
Joined
Dec 6, 2017
Messages
62
Reaction score
15
First Language
Portuguese-BR
Primarily Uses
RMMV
Hi.

Just in case anyone is curious how I solved this, I just added a condition in the Yep Save Core to show different menu commands depending on a switch:

JavaScript:
Window_SaveAction.prototype.makeCommandList = function() {
    var id = this.savefileId();
    var enabled = DataManager.isThisGameFile(id);
    var valid = DataManager.loadSavefileInfo(id);
    
    if ($gameSwitches.value(177) == true) {
            this.addCommand(this.getCommandName('save'), 'save', this.isSaveEnabled());
      this.addCommand(this.getCommandName('delete'), 'delete', enabled);
  } else {
    this.addCommand(this.getCommandName('load'), 'load', valid);
    this.addCommand(this.getCommandName('save'), 'save', this.isSaveEnabled());
    this.addCommand(this.getCommandName('delete'), 'delete', enabled);
  }


};
 

kyonides

Reforged is laughable
Veteran
Joined
Nov 17, 2019
Messages
1,158
Reaction score
546
First Language
English
Primarily Uses
RMXP
I think this is the simplest way to achieve the same goal:

JavaScript:
Window_SaveAction.prototype.makeCommandList = function() {
  let id = this.savefileId();
  let enabled = DataManager.isThisGameFile(id);
  let valid = DataManager.loadSavefileInfo(id);
  if (!$gameSwitches.value(177)) {
    this.addCommand(this.getCommandName('load'), 'load', valid);
  }
  this.addCommand(this.getCommandName('save'), 'save', this.isSaveEnabled());
  this.addCommand(this.getCommandName('delete'), 'delete', enabled);
};
 

Latest Threads

Latest Posts

Latest Profile Posts

With this, I'm gonna have a good night sleep
Damn. We’ve gotten so close to 0 reports, 0 approvals a few times over the past couple weeks. Does it matter? No. Is it realistic. No? Do I rely on your reports and want everyone to keep posting. Yes. Do I 100% games? …sigh… Yes.

Ah yes, all three of my moods all at once.
Here's a tutorial I did on how I made my Leonardo A.I.-assisted artworks for my game's recent update. :rhappy:

Disclaimer: This is meant to be a band-aid solution for people like me who aren't good artists or don't have the financial means to hire an amazing artist. If you have the means, please buy commissions and support your fav artists.:yhappy:

Forum statistics

Threads
131,756
Messages
1,223,009
Members
173,518
Latest member
Tiagrun
Top