User:O11c/save
This is some notes on the save formats of TMWA. It is not intended to authorative, but rather a porting tool.
It does NOT document the config formats - which includes login/save/gm_account.txt - or the script formats.
General[edit]
Save files generally consist of a number of tab separated fields, each of which may consist of a number of space and/or comma-separated fields.
Any line starting with //, or being empty, is usually ignored. But, any line not matching for format correctly is also usually ignored.
If there are any C0 control characters, funny stuff might happen.
integer[edit]
All integers stored at this level are in base 10.
/0|-?[1-9][0-9]*/
bool[edit]
A bool is just an integer that is expected to have the value 0 or 1 only.
string[edit]
A string is a sequence of non-control characters.
word[edit]
A word is a string containing no spaces.
char[edit]
a char is maybe a word of length 1. Bad things would happen if it were length 0 instead.
item[edit]
An item - which is usually in a space-separated list, which is itself between tabs - consists of:
Comma-separated fields:
- int id
- int nameid
- int amount
- int equip
- int identify
- int refine
- int attribute
- int card0
- int card1
- int card2
- int card3
- optional int borken
Add new common types here[edit]
login/save/account.txt[edit]
The standard 12 or 13 tab separated fields form, followed by a final "special" field:
- int account_id
- string userid
- string pass
- string lastlogin
- char sex
- int logincount
- int state
- string email
- string error_message
- int connect_until_time
- string last_ip
- string memo
- optional int ban_until_time
- account_reg2 variables (##) (there may be from 0 to 16 of these, separated by spaces)
- variable entries - the key and value are comma separated.
- string-nocomma key
- int value
- variable entries - the key and value are comma separated.
There is an older version with 5-7 fields, plus the variables again:
- int account_id
- string userid
- string pass
- string lastlogin
- char sex
- optional int logincount
- optional int state
- account_reg2 variables again ...
Finally, there is a sentinel:
- int account_id
- literal string "%newid%"
char/save/athena.txt[edit]
It may be a sentinel:
- int char_id_count
- literal string %newid%
Or it may contain data:
- int char_id
- comma-separated:
- int account_id
- int char_num
- string name
- comma-separated:
- int class
- int base_level
- int job_level
- comma-separated:
- int base_exp
- int job_exp
- int zeny
- comma-separated:
- int hp
- int max_hp
- int sp
- int max_sp
- comma-separated:
- int str
- int agi
- int vit
- int int
- int dex
- int luk
- comma-separated:
- int status_point
- int skill_point
- comma-separated:
- int option
- int karma
- int manner
- comma-separated:
- int party_id
- int guild_id
- optional int pet_id
- comma-separated:
- int hair (style)
- int hair_color
- int clothes_color
- comma-separated:
- int weapon
- int shield
- int head_top (hat)
- int head_mid (chest/torso)
- int head_bottom (legs)
- comma-separated:
- string last_point.mapname,
- int last_point.x
- int last_point.y
- comma-separated:
- string save_point.mapname,
- int save_point.x
- int save_point.y
- optional int partner_id
- 0 to ??? unseparated (and thus broken for maps with numerical names):
- memo.mapname
- memo.x
- memo.y
- 0 to 100 space-separated inventory items
- 0 to 100 space-separated cart items
- 0 to 450 space-separated:
- int skill_id
- int skill_flags << 16 | skill_level
- 0 to GLOBAL_REG_NUM space-separated:
- string key
- int value
char/save/accreg.txt[edit]
tab separated:
- int account_id
- 0 to 16 space separated:
- comma-separated:
- string key
- int value
- comma-separated:
char/save/storage.txt[edit]
tab-separated:
- comma-separated:
- int account_id
- int storage_amount
- 0 to 300 space separated:
- item (however the 'broken' field does not work properly)
char/save/party.txt[edit]
It may be a sentinel:
- int party_newid
- literal string %newid%
It may be a party entry:
- int party_id
- string name
- comma separated:
- bool exp
- bool item
immediately followed by 0 to 12 of *tab* separated (hmph):
- comma-separated
- int account_id
- int leader
- string name
map/save/mapreg.txt[edit]
This file does NOT do comment checking. However, it does still check the format and skip if it fails.
Each line is tab separated:
- comma-separated...
- string varname
- optional int arrayindex
- string/int value, depending on whether varname ends with a $