I was looking at the Object Reinitializer and Zalerinian mentioned there were a few issues to sort out.
While trying to figure out how to solve the issues, I wrote a couple tests to verify that it works.
Here's one tricky test:
class Game_Actor < Game_Battler alias :th_savepatcher_test_init :initialize def initialize(*args) @test_value = 9999 th_savepatcher_test_init(*args) end alias :th_savepatcher_test_param_base 😛aram_base def param_base(*args) th_savepatcher_test_param_base(*args) + @test_value endendThis test simulates the addition of a new instance variable that will be used in the script from now on.The expected result is that when you open the menu, you'll see your actors with 9999 HP and MP.
Old save files will break because they do not properly initialize that value, because the objects were created in a version of the game when that variable did not exist.
The object re-initializer's goal is initialize that value so that older save files can be used in newer versions of the game (ie: patching the save file)
I failed this test immediately when I tried writing my own script, and the re-initializer passes it just fine.
If you can think of any strange cases that would be good for testing that would be great.
While trying to figure out how to solve the issues, I wrote a couple tests to verify that it works.
Here's one tricky test:
class Game_Actor < Game_Battler alias :th_savepatcher_test_init :initialize def initialize(*args) @test_value = 9999 th_savepatcher_test_init(*args) end alias :th_savepatcher_test_param_base 😛aram_base def param_base(*args) th_savepatcher_test_param_base(*args) + @test_value endendThis test simulates the addition of a new instance variable that will be used in the script from now on.The expected result is that when you open the menu, you'll see your actors with 9999 HP and MP.
Old save files will break because they do not properly initialize that value, because the objects were created in a version of the game when that variable did not exist.
The object re-initializer's goal is initialize that value so that older save files can be used in newer versions of the game (ie: patching the save file)
I failed this test immediately when I tried writing my own script, and the re-initializer passes it just fine.
If you can think of any strange cases that would be good for testing that would be great.