Add EasyRPG custom LSD chunks to fix RPG_RT save game bugs
The following behaviors don't load correctly in rm2k3:
- [ ] No chunk for flash screen period, needed for continuous flashing
- [ ] No chunk for waited number of frames for timed keyinputrpoc
- [ ]
keyinputproc_variableis saved as auint8_tand the value is truncated to 1 byte. #155 and https://github.com/EasyRPG/Player/issues/1674 We create a second chunk with Player will use and save both for compatibility.
They don't work because there not enough state in the LSD data to implement loading them. Fixing these requires creating some custom EasyRPG LSD chunks.
Which state is missing? I want to check what's the internal representation of that state in RAM so that we can store it in the same way, meaning I can simply add the chunk to real RM as well. (The chunks mirror fields in RAM, usually without any conversion.)
By the way I see a mistake in the chunks in that respect: Chunk 20 (0x14), "flash_continuous", is listed as boolean, but actually it can have three values: 0 (once), 1 (continuous), 2 (continuous ceasing). It simply gets the value of the corresponding event command parameter in the "flash screen" command when it's executed. Looks like that at least... (although, I'm not sure if the 2 exists long enough to ever be saved... but I can't rule it out right now)
Ah I see now... There is another field that is also initialized with the value of the shake duration, and it is not saved.
We can save it in chunk 26 (0x1A), I'll note it in case I ever come around to fix this in real RM2k3.
There is another missing chunk with keyinput proc. It doesn't save the number of frames waiting for keyinputproc to complete.
Setup EV01 parallel
KeyInputProc: To Var1, Shift, Wait, Count time until key pressed into Var2
EraseEvent
Start a new game, wait a while, save, and then immediately press shift. Var2 will be some large value like 70.
Now load that saved game, and immediately press shift. Var2 will be 0. :exclamation:
Also, what are these chunks? They don't appear to be used from my tests?
- 0x1D
keyinput_value_right - 0x1E
keyinput_value_up
@CherryDT more rm2k3 bugs. If we add chunks to fix this in player we should coordinate with you to match future patches to RPG_RT.
Start a new game, wait a while, save, and then immediately press shift. Var2 will be some large value like 70. Now load that saved game, and immediately press shift. Var2 will be 0. ❗️
Sounds like https://github.com/EasyRPG/Player/issues/1674
That's a different issue which works on rm2k and rm2k3e.
This one is because there is no keyinput_wait_frames chunk to store how long you waited for a keypress.