#super #lib #smash #bros #brawl

brawllib_rs

Brawl character file parser, based on brawlbox/brawllib

23 releases (15 breaking)

✓ Uses Rust 2018 edition

0.16.0 Apr 25, 2019
0.14.1 Apr 5, 2019
0.13.0 Mar 28, 2019

#51 in Game development

Download history 44/week @ 2019-02-07 23/week @ 2019-02-14 8/week @ 2019-02-21 66/week @ 2019-02-28 18/week @ 2019-03-07 56/week @ 2019-03-14 129/week @ 2019-03-21 58/week @ 2019-03-28 52/week @ 2019-04-04 21/week @ 2019-04-11 8/week @ 2019-04-18 25/week @ 2019-04-25 5/week @ 2019-05-02 50/week @ 2019-05-09 63/week @ 2019-05-16

184 downloads per month

MIT license

461KB
9K SLoC

brawllib_rs Build Status dependency status Crates.io

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

Doesn't support modifying files, only reading 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);
}

Documentation

Refer to docs.rs for the full API.

Dependencies

~9.5MB
~197K SLoC