Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Saves continued from an RPG_RT save become broken for RPG_RT (switches load improperly) #1360
Name of the game:
Witch's Heart (http://vgperson.com/games/witchheart.htm)
Attach files (as a .zip archive or link them)
Describe the issue in detail and how to reproduce it:
Load this save (made in EasyRPG), and the ladder exists. Load it in RPG_RT, and the ladder does not exist, and you can't progress the game. This is because Switch 5000, used by the game as an "is night" flag, is loaded as "on" in EasyRPG but "off" in RPG_RT. Though harder to demonstrate, switches 4992+ are probably all loaded as "off" in this situation.
This is because the problem save has written an incorrect switch size: the value in the 0x1F chunk is slightly smaller than the accurate length in 0x20. I'm guessing EasyRPG considers the 0x1F chunk irrelevant and thus has no problems, whereas that's what RPG_RT actually uses for the size.
The circumstances: I loaded an old save (made in RPG_RT) in EasyRPG. This save had the switch size A6 7F, or 4991. But it's not 4991 because the switch data count of 5000 used to be smaller - it turns out that in RPG_RT, the switch size is increased dynamically as higher switches are set, whereas EasyRPG simply starts it at the max value. I advanced a little, up to the point where Switch 5000 is first turned on, then saved right after. But EasyRPG did not update the old switch size, and so it remained A6 7F, which RPG_RT takes to mean "no need to load switch values past 4991."
No amount of switch setting in EasyRPG will fix a save that's like this, but RPG_RT will fix it as soon as 5000 is turned on, due to its dynamic increase behavior. I'm also going to guess variables work the same way.
added a commit
Aug 8, 2018
Note that this also means that you can use more switches or variables than "existing" (as in: having names and being selectable in the editor), by using a pointer variable. This is actually used in some games, for example there is a "self-switch-like" system somewhere which uses an "array" of variables above the named ones to store information for each event on each map.
For example, I could set variable #1234567 to 123 (which I could never select in the editor) simply using: