Expand description
§nwnrs-set
Typed parser for Neverwinter Nights tileset (SET) payloads.
§Scope
- parse the INI-like tileset structure into typed sections
- build deterministic
SETtext from the typed representation - write typed tilesets back to a stream
- model tiles, terrain tags, crosser tags, groups, grass settings, and tile door metadata explicitly
- expose the authored tileset catalog without coupling it to a renderer
The primary entry points are read_set, build_set_text, write_set,
and SetFile.
§Public Surface
SET_RES_TYPESetErrorSetResultSetFileSetGeneralSetGrassSetNamedTypeSetPrimaryRuleSetTileSetTileCornerSetTileEdgesSetTileDoorSetGroupread_setparse_setbuild_set_textwrite_set
§Core Model
SetFile preserves distinct keyed collections for:
general- optional
grass terrainscrossersprimary_rulestilestile_doorsgroups
Important typed pieces:
SetTileCorner- terrain tag
- height step
SetTileEdges- explicit top, right, bottom, and left crosser tags
SetTile- model reference
- walkmesh reference
- terrain annotations
- lighting and animation flags
- tile-level visibility and pathing metadata
§Text Layout
SET is INI-like and section-oriented.
[GENERAL]
...
[GRASS]
...
[TERRAIN0]
...
[CROSSER0]
...
[PRIMARY RULE0]
...
[TILE0]
...
[TILE0DOOR0]
...
[GROUP0]
...Conceptually:
+----------------------+
| global metadata |
+----------------------+
| optional grass block |
+----------------------+
| terrain catalog |
+----------------------+
| crosser catalog |
+----------------------+
| rule catalog |
+----------------------+
| tile catalog |
+----------------------+
| tile-door metadata |
+----------------------+
| groups |
+----------------------+§Invariants
- section identity is preserved explicitly through typed collections keyed by their authored ids
- tile, group, terrain, crosser, and door metadata remain distinct rather than being merged into one generic map
- optional values remain optional rather than being normalized to arbitrary defaults
- deterministic serialization rebuilds the modeled section structure in ascending key order
§See also
nwnrs-git, which models the area instance data that references tileset resourcesnwnrs-mdl, which handles the model assets that tileset tile entries point to
§Why This Crate Exists
SET is one of the clearest examples in the workspace of “catalog structure is
data.” If you flatten it into one generic section map, you lose too much:
- explicit typed tile semantics
- tile-door relationship structure
- terrain and crosser taxonomy
- deterministic reconstruction of the authored tileset catalog
Modules§
- prelude
- Common imports for consumers of this crate.
Structs§
- SetFile
- Parsed tileset payload.
- SetGeneral
- Parsed
[GENERAL]section. - SetGrass
- Parsed
[GRASS]section. - SetGroup
- Parsed
[GROUPN]section. - SetNamed
Type - Named tileset catalog entry such as
[TERRAIN0]or[CROSSER0]. - SetPrimary
Rule - Parsed
[PRIMARY RULEN]section. - SetTile
- Parsed
[TILEN]section. - SetTile
Corner - One terrain corner annotation on a tile.
- SetTile
Door - Parsed
[TILENDOORK]section. - SetTile
Edges - One set of edge crosser tags on a tile.
Enums§
- SetError
- Errors returned while reading or parsing
SETpayloads.
Constants§
- SET_
RES_ TYPE - NWN resource type id for
set.
Functions§
- build_
set_ text - Builds deterministic
SETtext from a typedSetFile. - parse_
set - Parses a typed
SETfile from text. - read_
set - Reads a typed
SETfile fromreader. - write_
set - Writes deterministic
SETtext towriter.
Type Aliases§
- SetResult
- Result type for
SEToperations.