Whenever the player dies, I want a variable to be increased in the already-existing Save File, without overwriting it whole, so that I can tell how many times they have died, maybe even where they died, and act accordingly with whatever other function I want the death count to have
[RMXP] Alter Save File Data without overwriting the entire file
RGSS Script RequestsUse a game variable then. They get saved by the game every... single... time!
It wouldn't get saved after a game over, I want to change the variable directly from the Save File, so that when a player loads the save again, the change will persist and take effect
What would happen if the player loads another save file? Would that have a separate counter that counts loads?
A global save file would be a better solution...
Do you mean using only a single save file for the whole game, or a file that stores data that loads to all save files?
Nah, a single file separate from all save files. It'd only contain global stuff like times the player lost or whatever you wanna add to that list. The script would automatically load that file's data before or after loading the selected save file. It would be always available and you would have no need to alter already existing save files.
Do you have any script at hand that can do that
No worries. It can be made if it doesn't exist, yet.
Oh, alright then
But since you want to get such an extra file, what else would you like to feed it with?
Tentatively, I'd name the main variable stored there "losses" if you don't mind.
Tentatively, I'd name the main variable stored there "losses" if you don't mind.
Well, I suppose a switch just incase would be pretty useful
A very relevant question here, that you have completely ignored @NardBruh
Oh I'm sorry about that
Well, for the game I had this idea for? My main desire is for the deaths to be remembered even if they're in different saves, but I'm perfectly fine with the opposite too
Here's the first version of my code...
You just need to find the best place to call the Global.load_file method.
Global.save_file will be called right after the battle ended but before the map is loaded.
EDITED in order to include a clarification.
Version 0.1.1
You just need to find the best place to call the Global.load_file method.
Global.save_file will be called right after the battle ended but before the map is loaded.
EDITED in order to include a clarification.
Version 0.1.1
Ruby:
# * GlobalValues XP * #
# Scripter : Kyonides Arkanthes
# v0.1.1 - 2023-06-02
# * Outdated! * #
Well uh, winning a fight, escaping a fight and losing a fight lead to the game crashing, line 84 being stated as the issue by RPG Maker
Global.save_file works, but using load_file crashes the game, the same happens with the switch
No problem, I've come with an improved version of my script.
Version 0.2.1
Version 0.2.1
Ruby:
# * GlobalValues XP * #
# Scripter : Kyonides Arkanthes
# v0.2.1 - 2023-06-02
# * Outdated! * #
Oh sweet, it works now!
Tho I feel like there should be another counter added for the amount of game overs you get, since losses only registers battle losses where you have "Continue Even When Loser" on, it doesn't count getting game overs as losses, I think that would make this script absolutely perfect
=_= Why am I feeling like I am getting abused by someone here?
Yeah, I wonder why. 😛
By the way, you gotta call $global_data.gameover! if the player ever gets a Game Over screen...
Version 0.3.0
Yeah, I wonder why. 😛
By the way, you gotta call $global_data.gameover! if the player ever gets a Game Over screen...
Version 0.3.0
Ruby:
# * GlobalValues XP * #
# Scripter : Kyonides Arkanthes
# v0.3.0 - 2023-06-03
# * Go straight to its Dedicated Thread * #
I'm sorry for making you feel like that
But now this script is perfect! Thank you so so much!
Original thread: https://forums.rpgmakerweb.com/threads/rmxp-alter-save-file-data-without-overwriting-the-entire-file.157967/