View Single Post
Azhrei
Senior Member
 
Join Date: Sep 2015
Posts: 435

Old May 19th, 2016, 07:14 AM
Quote:
Originally Posted by ShadowChemosh View Post
So to take a look you can open up a .por file with any zip tool like 7-zip.
Been there, done that.

Quote:
If you take a look inside the "data" you can read is less than what the custom output does. Basically the readable part of the por file is just a basic statblock. The custom output actually gives more information.
Generally, yes. But the containers have an ID associated with them and the contained items have attributes that reference that ID. It would be very simple to relate the two of them together.

Sample snippet is below. Note that the backpack has index="1001" and the caltrops have holder="1001":
Code:
<pick thing="fBackpack" index="1001" batchindex="835" refcount="0" fieldcount="5" source="gTable">
<field id="slOriPrice" text="50 {size 32}GP{size 40}"></field>
<field id="usrChosen1"></field>
<field id="usrChosen2"></field>
<field id="usrChosen3"></field>
<field id="usrChosen4"></field>
</pick>
<pick thing="fCaltrops" index="998" batchindex="832" refcount="0" fieldcount="5" source="gTable" holder="1001">
<field id="slOriPrice" text="50 {size 32}GP{size 40}"></field>
<field id="usrChosen1"></field>
<field id="usrChosen2"></field>
<field id="usrChosen3"></field>
<field id="usrChosen4"></field>
</pick>
I can find all pick's with an attribute of holder with //pick[@holder], then iterate through those and pull out the values. Then another //pick[@index=value] for each value gives me the containers themselves. Easy stuff.

My plan is to make the .por file optional. If it's there, the JS will only use it to construct the container hierarchy -- the rest of the file will be ignored.

I have some time off next week so I'll look into this more pretty soon; I'd like this sheet to work as completely as possible. My main concern is performance: will reading the ZIP in an interpreted language be too slow to be usable?

(As an aside, I am pretty impressed with the design work LW did with the XML data. They broke a few rules, but probably for expediency. For example, the text attribute in those two picks contain presentation information (font size) and it really should be two separate fields (perhaps "amount" and "unit"?), then the software should control the presentation by reducing the font size for the unit. But as I said, I'm being pedantic and overall they did a great job with it.)

Last edited by Azhrei; May 19th, 2016 at 07:25 AM.
Azhrei is offline   #8 Reply With Quote