PDA

View Full Version : How can I put an extension field right the middle of an existing record?



Sterno
May 14th, 2020, 23:26
I'm trying to modify the AD&D 2E ruleset to support armor damage, per The Complete Fighter's Handbook.

To this end, I want add a "HP Lost" field to the item record. This is simple enough if I fully replace record_item.xml and looks correct:

https://i.imgur.com/aJeZoFT.jpg

Looks great! Except I don't want to replace all the xml... I just want to add my new fields. So I chop out all the duplicate stuff, do merge="join" in the xml file and just add my new fields, and end up with:

https://i.imgur.com/XjBT5Od.jpg

Crap! They ended up down at the bottom. I guess that makes sense because they're added last. Maybe I can do it with anchors, and anchor it to the bottom of the the Weight fields?

https://i.imgur.com/x8hx9mt.jpg

Nope! The thing below it just overlaps it now.

How do you deal with inserting new fields in the middle of an existing record with an extension, without replacing the whole thing? Is there some way to tell the elements underneath it to give it some space?

Sterno
May 15th, 2020, 03:10
After a lot of forum searching, I found out about the insertbefore attribute. I just needed to make sure I was using insertbefore on my new fields.

damned
May 15th, 2020, 04:48
Its because the record is using all relative anchoring. So yes you need to insertbefore.