Skip to main content

Crate openstranded_common_units

Crate openstranded_common_units 

Source
Expand description

§openstranded-common-units

Shared data types for the OpenStranded unit / AI system.

This crate defines the canonical structures that represent unit types — creatures, NPCs, vehicles, and the player — parsed from units*.inf files.

§Types

TypePurpose
UnitDefFull definition of a unit type
AnimFrameStart/end frames + speed for an animation
UnitAnimationsAll animation slots
LootEntryLoot drop: item_id + max count
VehicleParamsVehicle physics (acceleration, steering, …)

§Relationship to .inf files

Each id=N entry in a units*.inf file corresponds to one UnitDef. Most fields map directly from their .inf names.

§Dependency

Only serde — this is a pure data crate with no engine or plugin API dependencies.

Structs§

AnimFrame
A single animation frame range.
LootEntry
A single loot-drop entry.
UnitAnimations
All animation slots for a unit type.
UnitDef
Full definition of a single unit type (creature, NPC, player, vehicle).
VehicleParams
Vehicle-specific physics parameters.