inf2ron 0.2.2

Parse Stranded II .inf definition files (items, objects, units, buildings, combinations) and output RON format
Documentation

inf2ron

Parse Stranded II .inf definition files and output RON format.

Part of the OpenStranded toolchain for converting original game mods into .s2mod Content Packs.

Documentation | Crate

Usage

CLI

inf2ron <file.inf>... [output]
  • <file.inf>... — one or more .inf files to parse
  • [output] — optional output directory (default: current directory)

Each .inf file produces a corresponding .ron file with the same base name.

Example

inf2ron items_edible.inf items_material.inf
# produces ./items_edible.ron and ./items_material.ron

inf2ron objects_trees.inf objects_rocks.inf output/
# produces output/objects_trees.ron and output/objects_rocks.ron

Library

[dependencies]
inf2ron = "0.1"
use inf2ron::{InfParser, InfEntry};

let entries = InfParser::parse_str(r#"
id=9
name=Meat
group=food
icon=gfx\meat.bmp
model=gfx\meat.b3d
weight=500
"#)?;

Modules

Module Description
parser State-machine .inf parser
types Data types: InfEntry, CombiBlock
registry Typed domain structures + classifier
error Error types
cli Command-line interface

.inf file format

Line-oriented key=value with multi-line blocks:

### Entity name
id=9
name=Meat
group=food
icon=gfx\meat.bmp
model=gfx\meat.b3d
weight=500
script=start
    on:eat {
        eat 5,20,10,0;
    }
script=end

Comments: # line, // line within script blocks. Multi-value keys supported (e.g. multiple req= in crafting recipes).

License

GPL-3.0-or-later. See LICENSE and NOTICE.