public

Rpg Maker Developers Group

Simple enough for a child, powerful enough for a developer

2 Followers

How to know what savefile is loaded?

BMM Archive · July 15, 2026

Preserved forum archive. This topic stores the original first post and locally mirrored RPG Maker Web attachments when available. It is posted by the BMMPlay archive account, not by the original creator.

Original Source

  • Original title: How to know what savefile is loaded?
  • Original author: LunaLuma
  • Original date: March 19, 2019
  • Source thread: https://forums.rpgmakerweb.com/threads/how-to-know-what-savefile-is-loaded.106994/
  • Source forum path: Game Development Engines > RPG Maker Javascript Plugins > Learning Javascript

Summary

Hello! I'm new here and (I don't speak english very well, so I'll try my best to be understable) I wonder how to know what savefile is loaded with a script call. I'm trying to make if the player die somewhere, when he'll load the game again and go back where he was died, he'll be alble to see blood where he died before.

Archived First Post

Hello! I'm new here and
(I don't speak english very well, so I'll try my best to be understable)
I wonder how to know what savefile is loaded with a script call.

I'm trying to make if the player die somewhere, when he'll load the game again and go back where he was died, he'll be alble to see blood where he died before.
I already tried Jackkel's Persistent Switches , but it affect all savesfiles. (and i would like that switches and variables are saved only one the actual savefile used by the player)
Then I found Olivia's Meta Controls, but the problem is the same, because even <Local Meta> affect all the save in the same in playthrough.


So I almost found a solution by combine Meta Controls and Autosave:

I already know "$gameSystem.onBeforeSave();DataManager.saveGame(x);". But in fact, I would like to make a save on the last loaded file (the file used by the player)
I tried "$gameSystem.onBeforeSave();DataManager.saveGame(DataManager.latestSavefileId());", but it works only with the last saved file so if I save my game in 3 slots (so there are 3 savefiles), then if I quit the game and I load the 2nd file, and I make an autosave by event with this script call, it will be saved on the 3rd, because it is the last saved file.)
So to solve this problem, I should force a 2nd save when the player loaded his file (So it will be the last saved file). But how i could guess what file was loaded by the player?

So is it posible to make a sort of conditional call script like this?

If slot 2 is loaded
script call: $gameSystem.onBeforeSave();DataManager.saveGame(2)


If slot 1 is loaded
script call: $gameSystem.onBeforeSave();DataManager.saveGame(1)


If slot 3 is loaded
script call: $gameSystem.onBeforeSave();DataManager.saveGame(3)


Or is there another solution to save only switches and variables values by script call or something?

I think I should make only one save slot in the game but i think it would be annoying to make a new game to have another end...


Thanks for your answer.

Downloads / Referenced Files

Log in to download

Log in, then follow the RPG Maker Developers Group to see these download links.

Log in to download
Creator Claims / Removal

If you are the original creator and want this listing reassigned, edited, or removed, join BMMPlay and contact the moderators with proof that matches the original RPG Maker Web profile, linked GitHub, itch.io page, or another public creator identity.

#039#rpg-maker-archive#js-learning

Replies (0)

No replies yet.

0 replies 2 views

Log in to reply.

User Avatar