#super #lib #smash #bros #brawl

brawllib_rs

Brawl character file parser, based on brawlbox/brawllib

33 releases (breaking)

0.24.1 Mar 13, 2022
0.23.0 Dec 23, 2021
0.22.0 Oct 24, 2021
0.21.0 May 22, 2021
0.13.0 Mar 28, 2019

#1 in #super

Download history 33/week @ 2023-06-07 2/week @ 2023-06-14 69/week @ 2023-06-21 6/week @ 2023-06-28 1/week @ 2023-07-05 2/week @ 2023-07-12 1/week @ 2023-07-19 1/week @ 2023-07-26 1/week @ 2023-08-02 33/week @ 2023-08-16 34/week @ 2023-08-23 33/week @ 2023-08-30 36/week @ 2023-09-06 2/week @ 2023-09-13 2/week @ 2023-09-20

73 downloads per month

MIT license

540KB
11K SLoC

brawllib_rs

dependency status Crates.io Released API docs

A brawl file parser, based on brawlbox/brawllib, written in rust.

Doesn't support modifying files, only reading, processing and rendering them.

Example

In this example we:

  • Create a BrawlMod from the a brawl mod sd card folder and a brawl dump folder.
  • Load Fighters from the brawl_mod. This is the raw data from the fighter folder, stored in a tree of structs.
  • Create a HighLevelFighter from an exported brawl fighter directory. This contains processed data from the Fighter struct, stored in a tree of structs.
use brawllib_rs::brawl_mod::BrawlMod;
use brawllib_rs::high_level_fighter::HighLevelFighter;
use std::path::PathBuf;

let brawl_path = PathBuf::from("path/to/a/brawl/dump/folder");
let mod_path = PathBuf::from("path/to/a/brawl/mod/sd/card/folder");
let brawl_mod = BrawlMod::new(&brawl_path, Some(&mod_path));

for fighter in brawl_mod.load_fighters(false).unwrap() {
    println!("Fighter name: {}", fighter.cased_name);
    println!("The name of the first model file name: {}", fighter.models[0].name);

    let hl_fighter = HighLevelFighter::new(&fighter);
    println!("Hurtboxes on the 4th frame of 'Run' action {:#?}", hl_fighter.subactions.iter().find(|x| x.name == "Run").unwrap().frames[4].hurt_boxes);
}

Dependencies

~17–24MB
~446K SLoC