SL2 Analyzer
Read a FromSoftware .sl2 save and report what is in it
Loading...
Searching...
No Matches
gen_sdt_lot_flags Namespace Reference

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.
 

Detailed Description

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.

Function Documentation

◆ load_json()

gen_sdt_lot_flags.load_json (   name)

Definition at line 48 of file gen_sdt_lot_flags.py.

Referenced by item_names(), and main().

Here is the caller graph for this function:

◆ item_names()

gen_sdt_lot_flags.item_names ( )

Definition at line 53 of file gen_sdt_lot_flags.py.

References load_json().

Referenced by main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ load_lots()

gen_sdt_lot_flags.load_lots (   path)

Definition at line 61 of file gen_sdt_lot_flags.py.

Referenced by main().

Here is the caller graph for this function:

◆ lot_items()

gen_sdt_lot_flags.lot_items (   lot,
  names 
)

Definition at line 66 of file gen_sdt_lot_flags.py.

Referenced by build().

Here is the caller graph for this function:

◆ 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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ dump()

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().

Here is the caller graph for this function:

◆ 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().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ BASE

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.

◆ DB

gen_sdt_lot_flags.DB = os.path.join(BASE, "db_sdt")

Definition at line 40 of file gen_sdt_lot_flags.py.

◆ LOT_FLAG_BASE

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.

◆ LOT_SLOTS

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.