Skip to main content

Module tree_list

Module tree_list 

Source
Expand description

Tree placement list for BMD vegetation files.

This module defines the tree placement data structures used in BMD vegetation files. Trees are organized by their model path, with each model containing multiple individual tree instances with positions, rotations, and scales.

§Structure

§Supported Versions

  • Versions 1 to 3: Total War: Attila (scale as a byte, no rotation, version 2 adds is_burnable)
  • Version 4: Current format used in Total War: Warhammer III

§Examples

ⓘ
use rpfm_lib::files::bmd_vegetation::tree_list::*;

// Decode a tree list from binary data
let tree_list = TreeList::decode(&mut data, &extra_data)?;

// Iterate through tree models
for tree_vector in tree_list.tree_list() {
    println!("Model: {}", tree_vector.key());
    for tree in tree_vector.value() {
        println!("  Position: ({}, {}, {})", tree.x(), tree.y(), tree.z());
    }
}

Structs§

BattleTreeItem
Individual tree instance with position, rotation, and scale.
BattleTreeItemVector
A group of tree instances sharing the same model.
TreeList
Tree placement list for a battle map.