Hello. I've been using a script called "Pets and Summons" which allows my character to temporarily transform into another one for a limited amount of turns.
However, I run into an issue. When the transformed character wins a battle, everything works as intended. They transform back into the original actor, not the summoned actor. Everything actually works perfectly, except that when the summoned character wins a battle, the save file gets corrupted and deletes itself. This doesn't even happen 100% of the time too. It happens about 90% of the time or so.
I'm so confused, what about this script could cause it to corrupt the save file? I'll post the script in question too. Not sure what causes this, especially since it is not 100% of the time, but most of the time.
EDIT: After further testing it seems like only a select number of troops cause this issue? Certain troops don't corrupt the file but then on the other hand, some do. This is honestly the weirdest error I've ever encountered.
saving doesn't work that way - you are missing at least one additional component here.
either the actual destroying of the file happens from a third program (antivirus getting false-positive, cloudsync removing file after a bad sync, harddrive short of failure or a few other options), or a few other possibilities.
It might be a problem with constructing the save data? For example, maybe there are unhandled circular references. I know MV/MZ avoid this by making temporary backups of any existing file before attempting to overwrite, but I'm not familiar with VXAce's scripts/structure.
I’ve been trying to see if anything else causes the issue but it seems to be just this script. I’ll give it a go, and I’ll provide an update if this works or not
EDIT: Tried this, still no dice. I put that line underneath the script. Maybe I put it wrong?
Okay, have done some more testing. I think it corresponds to certain rooms. I don't have this issue in certain rooms but in other rooms the save file gets corrupted.
Is there something that could potentially conflict with the script in a room that corrupts the save file?
Maybe one of your events are doing something, setting a switch or variable on, changing data.
does your map notes have anything written in it for scripts. Are there parallel processes running?
There aren't any parallel processes running. Also, I don't think it is by room anymore. I tried one room and one encounter worked fine, while another corrupted the save file.
It's definitely by troop.
So then are there any commands in your troop?
There are not. They're all blank.
Update: Now it seems to be happening randomly. It doesn't matter the troop I fight, it will start to save in the beginning, but then afterwards the save file will corrupt.
I know of one script that tries to put a sprite into the Game_Character or Game_Event class (don't remember the name, just know there was one). This would cause errors with saving games, which would then cause the save file to be deleted.
Edit - yep, this is not the script I'm thinking of, but this script adds a sprite to the Game_Pet class, and adds pets to Game_Actor. So that's exactly what its doing - trying to add a sprite to the game data. Because that's in the Game_Actor class (or $game_actors by this stage), its automatically covered by the Data Manager.
The sprite should be completely separate, not a part of the Game_Pet class. This will need someone to do a bit of a rewrite, but ideally you'd go back to the developer and ask them to create a separate Sprite_Pet class as needed. Their contact details are in the script.
btw - please don't put other people's scripts into your post. Give a link to them instead.
I may have it working for you. Sent you a message with the fix.
Fortunately a small change seems to work.
adding in a few lines before Game_Pet and changing one line in Game_Pet
no luck yet. Shaz was right it's the data in game_actors.
Changing this works but the summon is not returned when the timer runs out or the battle ends, leaving you with the summon permently.
working on it.