the index of a location / coordinates record has no meaning, you can have holes or duplicated values, it doesn't matter, they are displayed but don't exist in file.
the index of .smod (or .wav) is important and does matter.
each section contains a list of names (String255) where implicit identifier is the index in the list; then each coordinate record contains the index of a named item to which it applies.
consequently, if you delete one name (smod, ...) all coordinates with index higher than the deleted one will be corrupted; until significant changes (rewrite) of this, do *not* delete item (only delete coordinates if an item must no longer be in the field).
the item-bag list is postponed (the drag-manager of the tree-list must be recoded).
delete, delete an item, it removes it from its container list; all lists that support deletion (meaning models list, .itm, .mlt, .mon; coordinates or vertices records in .3D?, .WLD; etc) do not contain index fields; the displayed index of an item is simply its order in the file.
erase, erase an item, it fills it with null; it is mainly used with the item.sdata file that must always contains 255 items per bank. (255 consecutives items sharing the same Type value).
when the ps_game reads all items, it doesn't care about the read Type & TypeID, the item 3-4 is simply the 514th records returned by the base. it is so forbidden to make a hole and erase is used (can be used) to clear (forget) an item definition.
Edit: I feel it's be useful to insist on the consequences of deletion of an item.
as explained, all lists (but the item.sdata fil) contain items that don't store / define themselves an unique identifier (such as an unique name or unique numerical ident (GUID) or even a hash); instead the order of the item in its container-list defines its identifier; for instance the gears and the weapons of the items.sdata file define their models (the appareance of the gear or the weapon) by the index of that model in a .MLT or .ITM file.
this is obviously very very weak (the shaiya data organisation is not smart at all, that's not a surprise); if you delete an model from a .MLT list, the (effective) indexes of all subsequent models will be descreased by one when the game will load the list, and thus all gears using these indexes will be corrupted.
of course the same is true for the .MON lists; the deletion and insertion (as well as reordering) is possible in these lists but don't forget that such changes can impact all items using that list.
the index of .smod (or .wav) is important and does matter.
each section contains a list of names (String255) where implicit identifier is the index in the list; then each coordinate record contains the index of a named item to which it applies.
consequently, if you delete one name (smod, ...) all coordinates with index higher than the deleted one will be corrupted; until significant changes (rewrite) of this, do *not* delete item (only delete coordinates if an item must no longer be in the field).
the item-bag list is postponed (the drag-manager of the tree-list must be recoded).
delete, delete an item, it removes it from its container list; all lists that support deletion (meaning models list, .itm, .mlt, .mon; coordinates or vertices records in .3D?, .WLD; etc) do not contain index fields; the displayed index of an item is simply its order in the file.
erase, erase an item, it fills it with null; it is mainly used with the item.sdata file that must always contains 255 items per bank. (255 consecutives items sharing the same Type value).
when the ps_game reads all items, it doesn't care about the read Type & TypeID, the item 3-4 is simply the 514th records returned by the base. it is so forbidden to make a hole and erase is used (can be used) to clear (forget) an item definition.
Edit: I feel it's be useful to insist on the consequences of deletion of an item.
as explained, all lists (but the item.sdata fil) contain items that don't store / define themselves an unique identifier (such as an unique name or unique numerical ident (GUID) or even a hash); instead the order of the item in its container-list defines its identifier; for instance the gears and the weapons of the items.sdata file define their models (the appareance of the gear or the weapon) by the index of that model in a .MLT or .ITM file.
this is obviously very very weak (the shaiya data organisation is not smart at all, that's not a surprise); if you delete an model from a .MLT list, the (effective) indexes of all subsequent models will be descreased by one when the game will load the list, and thus all gears using these indexes will be corrupted.
of course the same is true for the .MON lists; the deletion and insertion (as well as reordering) is possible in these lists but don't forget that such changes can impact all items using that list.