8
edits
Alivebacon (talk | contribs) m (More of my "world-famous" making articles sound less clumsy.) |
Alivebacon (talk | contribs) (→Item lists: more minor fies) |
||
Line 14: | Line 14: | ||
==Item lists== | ==Item lists== | ||
Item lists in the save data follow a specific format. | |||
Lists have entries of 2 bytes each | Lists have entries of 2 bytes each as well as a capacity. The total size of the list data in bytes, is <code>Capacity * 2 + 2</code>. | ||
For example, the player's pocket inventory can hold 20 item entries, so the size of | For example, the player's pocket inventory can hold 20 item entries, so the size of the list is <code>20 * 2 + 2 = 42</code> bytes. | ||
{| class="roundy" cellpadding="2" style="text-align: center; background: #c1e3ff; padding: 3px; border: 2px solid #88c8ff; margin-bottom: 10px; border-spacing: 1px" | {| class="roundy" cellpadding="2" style="text-align: center; background: #c1e3ff; padding: 3px; border: 2px solid #88c8ff; margin-bottom: 10px; border-spacing: 1px" | ||
Line 40: | Line 40: | ||
===Count=== | ===Count=== | ||
The number of item entries actually being represented in the list. Note that count and capacity are | The number of item entries actually being represented in the list. Note that count and capacity are separate. | ||
===Entries=== | ===Entries=== | ||
The exact data for each item entry in the list | The exact data for each item entry in the list. | ||
===Terminator=== | ===Terminator=== | ||
The byte following the last item entry, according to ''Count'', must always be a terminator, which is byte value <code>0xFF</code>. | The byte following the last item entry, according to ''Count'', must always be a terminator, which is byte value <code>0xFF</code>. | ||
This spare byte is present at the end of the list data | This spare byte is present at the end of the list data to handle the list being filled to capacity. | ||
===Entry format=== | ===Entry format=== | ||
Line 69: | Line 69: | ||
====Count==== | ====Count==== | ||
The amount of that particular item. | The amount of that particular item. This value must be between 1 and 99 inclusive. | ||
====Index==== | ====Index==== |
edits