Need Help With Something

I have 2 questions but ill ask them one at a time. First question: So I've made 2 maps. One is my title screen that has my title image and an event that shows a picture i use as my "Press Start" and the other is my options screen (New Game, Load Game, Etc). See image below.
1649695973579.png

So on the left is where you do a new game, right? So when you step on the circle thing it will ask you if you want to start a new game. Then it will do a check on whether you have an existing file already and if so, it will show text stating a warning that if you continue past this point, your existing game save will be deleted and asks if you are sure. Everything at this point works great. Now the problem is so i had a game save already. I had backed it up onto the main folder of my game outside of the save folder and left the original in the save folder. Ok so i play test and when it gives me the warning about starting a new game will delete the existing save file and clicked yes, i went to my saves folder and the save is still there. How do i do this? The following is the code i use:
1649696874579.png


edited: Btw I want to thank Hime for their Pretitle plugin which allows me to do what im trying to do
I'm not entirely sure, but shouldn't the deleted ID be 0? That's usually where save files start.
JavaScript:
StorageManager.remove(1);
Save IDs start from 1 for MV. (MZ uses ID 0 for autosave.)
ok i created a save file but now its not detecting it. could a plugin prevent it?
DataManager.isAnySavefileExists checks for save files via the global save info (as they appear in-game), not by directly checking for file existence. If you literally just copied the file into the game's save folder mid-session then these sources may not be equal. Invalid records are purged from the global info, but by default the engine does not check for newly-added save files.

Since it looks like you're only using one save file, you could try replacing DataManager.isAnySavefileExists in your Conditional Branch with this:

StorageManager.exists(1)
This should check directly to see if the save file exists.

For multiple save files this may work:

var exists = false; for (var n = DataManager.maxSavefiles(); --n;) if (StorageManager.exists(n)) { exists = true; break; }; exists
I.e. "loop through all save IDs and return true iff at any of them exist".
ya i figured that out. now my second question: What command for saving in a file works with, $gameSystem.onAfterLoad(); DataManager.loadGame(1); StorageManager.cleanBackup(1); $gamePlayer.reserveTransfer($gameMap.mapId(), $gamePlayer.x, $gamePlayer.y); $gamePlayer.requestMapReload();
Examples for RMMV:
Spoiler: Save
JavaScript:
// Save to slot 1; on success/failure, play suitable sounds
$gameSystem.onBeforeSave();
if (DataManager.saveGame(1)) {
  StorageManager.cleanBackup(1);
  SoundManager.playSave();
} else {
  SoundManager.playBuzzer();
}
Spoiler: Load/Continue
JavaScript:
// Continue from save slot 1
if (DataManager.loadGame(1)) {
  $gameSystem.onAfterLoad();
  SceneManager._scene.fadeOutAll();
  if ($gameSystem.versionId() !== $dataSystem.versionId) {
    $gamePlayer.reserveTransfer(
      $gameMap.mapId(), $gamePlayer.x, $gamePlayer.y, $gamePlayer.direction(), 0
    );
    $gamePlayer.requestMapReload();
  }
  SceneManager.goto(Scene_Map);
}
For reference:
These Save/Continue calls can be found on the Related Scripting sheet. (I'm thinking about merging "Event Commands" and "Related Scripting" into one "Script Calls" sheet soon, since a lot of people seem to be thinking the first sheet is all there is.)
ok it just sends me back to title. Here is the event:
Spoiler
1649773691941.png
I hope i did it right

edited:
Spoiler
oh wait i feel stupid. I made a saving kiosk and it has an option to save and quit.
1649774672203.png


I forgot that it still continues the event even after loading the save and so it it makes u go back to title. How would i fix this?
In your first screenshot the load game script part looks OK, but the event itself looks like it might be misordered? You have the remove(savefileId: 1) thing there (is that your own custom function?), then it shows the "load success" message, does a bunch of stuff, then tries to load save file 1. Shouldn't the load game stuff be between the "Loading..." and "Success!" messages? [Edit: just realised that wouldn't work because anything after a successful load would be skipped. 😴]

Also, it's possible for load game to fail even if the file exists, e.g. corrupted or otherwise invalid save data. That's why the loadGame call is used as an if condition, so you can specify a different response for failure in the else branch. Hope that makes sense! 👋

I made a saving kiosk and it has an option to save and quit. View attachment 223010

I forgot that it still continues the event even after loading the save and so it it makes u go back to title. How would i fix this?
There are two cases here: loaded from save, and not. You'd need some way to set a value that is only there in one of the cases, e.g.
  1. Use a plugin like SwitchOnLoad.js by Yoji Ojima (ships with MV, under <RMMV install folder>/dlc/KadokawaPlugins); or

  2. Use a Script command to set a value on $gameTemp, like described here:
    $gameTemp is a good candidate for this kind of thing because it gets initialised on new/load game, but is not included in save files. 😤
Awesome thanks for the help! Btw do u know where i can learn how to use javascript for making plugins?
Awesome thanks for the help! Btw do u know where i can learn how to use javascript for making plugins?
👋 There are many pinned threads about that sort of thing on the Learning JavaScript board:
Note that plugins build on the core scripts, so you should be familiar with at least the basics of both JS and [relevant parts of] the core scripts.

Original thread: https://forums.rpgmakerweb.com/threads/need-help-with-something.146663/