Liblcf: init party bug

Hi guys, thank you for doing such a great job!

I faced a little problem when working with liblcf:
When I save the ldb, in saved file lost System, Init party, 1 Hero: (None) bytes.
After saving I open the editor, I see in the System tab in Init Party, sets next item in 1 Hero.
I compared byte-by-byte files before and after saving it and after save lost a chunk of byte responsible for (None), namely 15 01 00 16
If you set any other value, it is resaved correctly.
Here is an example of regularities:
15 01 00 16 = (None) <-- lost
16 02 01 = 1 item 1 Hero
16 02 02 = 2 item 1 Hero
16 02 64 = last item 1 Hero
15 01 02 16 04 01 00 02 = 1 Hero + 2 Hero, 1 and 2 values
15 01 02 16 04 64 00 63 = 1 Hero + 2 Hero, last values
15 01 03 16 06 01 00 02 00 03 = 1 Hero + 2 Hero + 3 Hero
15 01 04 16 08 01 00 02 00 03 00 04 = 1 Hero + 2 Hero + 3 Hero + 4 Hero

How can I fix this? What do I need to enter in the fields.csv instead of
System,party,t,Int16,0x15,0,Integer
System,party,f,Vector,0x16,0,Array - Short
?

ldb file: https://files.catbox.moe/6sm7u6.7z

Welcome Fox. Sorry for the late quick reply, most of us are in holidays and not in front of a computer.

When you say you are saving ldb, are you saving without party members from the original RPG Maker editor or from your own implementation?

I’d suggest to check data from xml with the lcf2xml tool, it uses the liblcf writer to export xml then check with ease how structure is being saved parsed by liblcf.

When you say you are saving ldb, are you saving without party members from the original RPG Maker editor or from your own implementation?

I do not know how they saved the original ldb (which I have attach here), but I tried to open the resaved ldb in RPG Maker 2000 editor, changed there 1 Hero to (None) and after the re-saving (using liblcf) party bytes again disappeared.

version info

version info

I’d suggest to check data from xml with the lcf2xml tool, it uses the liblcf writer to export xml then check with ease how structure is being saved parsed by liblcf.

<party></party>
It’s empty.

I think that “feature” is on purpose. My guess is, due to the (bad) dropdown design in database editor, you may empty the first value, but this removes all other values. This means if you want to remove, for example, the first value, other values must be shifted by hand, editor is not rebuilding this structure, so it may not have empty values between filled slots or the structure construction seems to stop reading on the first empty value when saving.

Maybe you misunderstood me. I need to keep the value “(None)” accounted for in liblcf and bytes 15010016 not lost, as they affect the game (I use rtp_rt_fatalmix2010 for run game, and liblcf is used to fix file paths in ldb)!
The loss of these bytes breaks compatibility.
In the absence of these bytes, rtp_rt_fatalmix2010 and editor perceive as if the first item (after “(None)”).
hero

So, to be clear:

  1. Original LDB file has a party chunk with nothing in it.

  2. Saving this in liblcf causes the chunk to be deleted.

  3. And loading that in RPG Maker causes it to effectively contain [1] (that is, just the first Actor in the database).

If this is the case, then the issue is liblcf removing arrays with nothing in. (Which it shouldn’t do, because arrays can have complex default values too - menuCommands is a similar case.)

Correct?

Yes. Also, to exclude some other factors, I changed by editor “1 Hero” to “(None)” in the already saved (liblcf) ldb, these bytes were added there, but after re-saving through liblcf they again disappeared.
Editor stores the empty “init party” value as these bytes and it must be keep in ldb.

Tracked issue with 20kdc’s patch: https://github.com/EasyRPG/liblcf/issues/229