- To read a binary parameter archive:
oead.aamp.ParameterIO.from_binary
- To write a binary parameter archive:
oead.aamp.ParameterIO.to_binary
- To read a YAML text parameter archive:
oead.aamp.ParameterIO.from_text
- To write a YAML text parameter archive:
oead.aamp.ParameterIO.to_text
import oead
with open("Horse.baiprog", "rb") as f:
pio = oead.aamp.ParameterIO.from_binary(f.read())
pio.version
# 0
pio.type
# "xml"
pio.objects["DemoAIActionIdx"].params["Demo_Wait"]
# Parameter(107)
pio.objects["DemoAIActionIdx"].params["Demo_Wait"].v
# 107
oead.aamp.Parameter
See also :cppoead::aamp::Parameter
oead.aamp.Name
See also :cppoead::aamp::Name
oead.aamp.ParameterMap
Lightweight dict-like object wrapping a :cppoead::aamp::ParameterMap
.
oead.aamp.ParameterObjectMap
Lightweight dict-like object wrapping a :cppoead::aamp::ParameterObjectMap
.
oead.aamp.ParameterListMap
Lightweight dict-like object wrapping a :cppoead::aamp::ParameterListMap
.
Note
Just like the C++ :cppoead::aamp::Name
, oead.aamp.Name
can be constructed from either a hash or a string, so it is possible to access elements in a map by name rather than by hash. Both object.params[crc32_hash]
and object.params["NameString"]
will work.
oead.aamp.ParameterList
See also :cppoead::aamp::ParameterList
oead.aamp.ParameterObject
See also :cppoead::aamp::ParameterObject
oead.aamp.ParameterIO
See also :cppoead::aamp::ParameterIO
Because binary parameter archives only store CRC32 hashes of structure names, recovering the original names -- which is useful for converting archives to a human-readable format -- requires the use of a name table.
When serializing to YAML, by default oead will use a table that contains strings from Breath of the Wild's executable.
oead.aamp.NameTable
See also :cppoead::aamp::NameTable
Note
For safety reasons, the underlying maps are not exposed.
oead.aamp.get_default_name_table
See also :cppoead::aamp::GetDefaultNameTable