|
SL2 Analyzer
Read a FromSoftware .sl2 save and report what is in it
|
Functions | |
| load_json (name) | |
| item_names () | |
| load_lots (path) | |
| lot_items (lot, names) | |
| build (lots, rows, names) | |
| dump (table) | |
| House style for db_*/: one-space indent, a short pair kept on one line. | |
| main () | |
Variables | |
| BASE = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) | |
| DB = os.path.join(BASE, "db_sdt") | |
| int | LOT_FLAG_BASE = 50000000 |
| The pickup family's id rule: a row id is this plus the lot id. | |
| int | LOT_SLOTS = 8 |
| ItemLotParam carries eight item slots per lot. | |
Regenerate db_sdt/lot_flags.json: the flag each Sekiro item lot REALLY sets.
`db_sdt/item_flags.json` files every world pickup under `50000000 + lot id`, and for
most lots that is the flag the game writes. Not for all of them. The game's own
`ItemLotParam` gives each lot a `getItemFlagId`, and a hundred rows in the table point
somewhere else — including every prosthetic part, every esoteric text, every Gourd Seed
and every world Prayer Bead in the nine areas the tool reads. Those lots set a GLOBAL
flag (`6500` for the Shuriken Wheel, `6725` for the courtyard Gourd Seed), so reading
the lot-shaped id reported them "still out there" on a save that had picked up all of
them hours earlier.
This joins the two and writes only the corrections, so `item_flags.json` itself is not
hand-edited:
moved {row id: the flag the lot actually sets}, where the two differ
misfiled [[row id, name]] for rows whose lot hands out a DIFFERENT item, so the
row's id says nothing about the item it names
A row counts as the lot's item when one of the lot's item names starts with the row's
name — the game's own names carry suffixes the table drops (`Sabimaru Memo (Bought)`,
`Sweet Rice Ball 2`). An id with no English name is no evidence either way and leaves
the row alone.
Input is `ItemLotParam` as `gen_sdt_from_regulation.py` extracts it, one row per lot:
python3 tools/gen_sdt_from_regulation.py --game-root ... --paramdex ... --out DIR
python3 tools/gen_sdt_lot_flags.py --lots DIR/item_flags.tsv [--write]
Without --write it prints the delta and writes nothing.
| gen_sdt_lot_flags.load_json | ( | name | ) |
Definition at line 48 of file gen_sdt_lot_flags.py.
Referenced by item_names(), and main().
| gen_sdt_lot_flags.item_names | ( | ) |
Definition at line 53 of file gen_sdt_lot_flags.py.
References load_json().
Referenced by main().
| gen_sdt_lot_flags.load_lots | ( | path | ) |
Definition at line 61 of file gen_sdt_lot_flags.py.
Referenced by main().
| gen_sdt_lot_flags.lot_items | ( | lot, | |
| names | |||
| ) |
Definition at line 66 of file gen_sdt_lot_flags.py.
Referenced by build().
| gen_sdt_lot_flags.build | ( | lots, | |
| rows, | |||
| names | |||
| ) |
Definition at line 75 of file gen_sdt_lot_flags.py.
References lot_items().
Referenced by main().
| gen_sdt_lot_flags.dump | ( | table | ) |
House style for db_*/: one-space indent, a short pair kept on one line.
Definition at line 92 of file gen_sdt_lot_flags.py.
Referenced by main().
| gen_sdt_lot_flags.main | ( | ) |
Definition at line 100 of file gen_sdt_lot_flags.py.
References build(), dump(), item_names(), load_json(), load_lots(), and main().
Referenced by main().
| gen_sdt_lot_flags.BASE = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) |
Definition at line 39 of file gen_sdt_lot_flags.py.
| gen_sdt_lot_flags.DB = os.path.join(BASE, "db_sdt") |
Definition at line 40 of file gen_sdt_lot_flags.py.
| int gen_sdt_lot_flags.LOT_FLAG_BASE = 50000000 |
The pickup family's id rule: a row id is this plus the lot id.
Definition at line 43 of file gen_sdt_lot_flags.py.
| int gen_sdt_lot_flags.LOT_SLOTS = 8 |
ItemLotParam carries eight item slots per lot.
Definition at line 45 of file gen_sdt_lot_flags.py.