PDA

View Full Version : Filepack Fun, Itemdata



ZoriaRPG
06-06-2017, 10:01 PM
I'm having more absolutely lovely fun with the filepack format not doing what I tell it to do.

This time, it;s with the itemdata struct, and aye, I did feed it specific version information, and I did bump V_ITEMS.

Does anyone want to have a look at this?

https://github.com/ZoriaRPG/ZeldaClassic/tree/ItemdataExp

The key files are:

qst.cpp, zfdefs.h, zq_class.cpp

The affected functions are readitems() and writeitems().

I commented out the sections that I was adding, and you can search for the string:

//! I need help with this.

to quickly find them.

The ZScript side of this is fine, and the jwin side seems to also be fine. I tried to create a debug build, but MSVC crashes outright when I do that.

Here is what happens when I try to build for debug.
-=SPOILER=-

Full MVSC log (http://timelord.insomnia247.nl/zc/zc_dev/msvc_debug_errors.txt)

DarkDragon
06-07-2017, 01:29 AM
I gave you some tips on Skype, but I'll post here as well to help others:

1. You have to read and write data in exactly the same order in qst.cpp and zq_class.cpp.
2. You must use a consistent pair of read and write commands. You cannot write a 8-bit char and try to read it in as a 32-bit integer.

Please be extremely careful when making changes anywhere near the quest loading and saving code. Errors here cause quest corruption, which in the worse case goes undetected for several betas, and can cause quest authors to lose weeks or months of work.

ZoriaRPG
06-07-2017, 04:21 AM
Solved. Thank you <!-- BEGIN TEMPLATE: dbtech_usertag_mention -->
@<a href="http://www.armageddongames.net/member.php?u=1" target="_blank">DarkDragon</a>
<!-- END TEMPLATE: dbtech_usertag_mention --> for proving that I'm a blind idiot.

For future reference, don't try storing char and loading long.


https://youtu.be/TvsFDoriKV4

We will merge this soon. For the present, it is in this branch:

https://github.com/ZoriaRPG/ZeldaClassic/tree/ItemdataWeaponEditor