Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Broken reading of a Save of The Sacred Tears TRUE #155

Closed
Zegeri opened this issue Sep 20, 2015 · 4 comments
Closed

Broken reading of a Save of The Sacred Tears TRUE #155

Zegeri opened this issue Sep 20, 2015 · 4 comments
Labels

Comments

@Zegeri
Copy link
Member

Zegeri commented Sep 20, 2015

This save file shared by @carstene1ns for EasyRPG/Player#579 is incorrectly parsed:
http://f4ke.de/dev/easyrpg/TSTT/Save03.lsd

When run with _DEBUG, it'll warn about multiple skipped chunks and it'll crash because of running out of bytes. What breaks liblcf is a keyinput_variable (0x16) at 0x3846, inside the SaveEventData of the 8th CommonEvent.

16 01 8C 17 01 01

should be parsed as:

keyinput_variable (size 01) (value 8c)
keyinput_all_directions (size 01) (value 01)

But it's actually parsed as:

keyinput_variable (size 01) (value 8c 17)
[crap]

keyinput_variable saves the variable used by the last KeyInputProc. Here's the funny part. In this case, the last KeyInputProc saves the input value in the variable 908. Now: 908 = 0x038C. So keyinput_variable seems to be actually saving the last byte, not the whole number.

@Ghabry
Copy link
Member

Ghabry commented Sep 20, 2015

I can't even get the KeyInput in a simple test case to work.

Have an Auto Start Common Event that reads Left/Right and then Waits 1.0 second and a map event that changes its look based on the button. The look never changes :(

@Zegeri
Copy link
Member Author

Zegeri commented Sep 20, 2015

That setup you've described works on my end. Try running it in TestPlay mode and looking at the table of variables during that second.

@Ghabry
Copy link
Member

Ghabry commented Sep 20, 2015

Yeah the problem I encountered was a different bug

Zegeri added a commit to Zegeri/liblcf that referenced this issue Sep 23, 2015
@CherryDT
Copy link

CherryDT commented Oct 12, 2018

This is a bug I knew about for a long time but not the cause. Turns out RM incorrectly saves this variable as boolean (which internally just copies 1 byte) instead of a var-len integer, probably a copy-paste error from the surrounding booleans.

Unfortunately this means it's hard to fix for me because if I would simply change this into an integer, then RPG_RT would encounter the same problem you had for certain saves and crash with a "stream read error" for bytes with the highest bit set. I'll see, maybe I'll save in a new chunk and load from both so that compatibility (at least for variables <128) is still okay.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

4 participants