Skip to content

Instantly share code, notes, and snippets.

@jam1garner
Created June 25, 2020 23:05
Show Gist options
  • Save jam1garner/2284e30103f2905bc47daab6e7ddc288 to your computer and use it in GitHub Desktop.
Save jam1garner/2284e30103f2905bc47daab6e7ddc288 to your computer and use it in GitHub Desktop.
Basic example for getting started with ACMD with skyline-acmd and skyline-rs
#![feature(proc_macro_hygiene)]
use smash::hash40;
use smash::lib::lua_const::*;
use smash::lua2cpp::L2CFighterCommon;
#[acmd::acmd_func(
battle_object_category = BATTLE_OBJECT_CATEGORY_FIGHTER,
battle_object_kind = FIGHTER_KIND_MARIO,
animation = "attack_air_f",
animcmd = "game_attackairf"
)]
pub fn mario_fair(fighter: &mut L2CFighterCommon) {
acmd!({
frame(16)
AttackModule::clear_all() // clear all previous hitboxes
if(is_execute) {
ATTACK(
ID=0, Part=0, Bone=hash40("arml"), 19.0, 361, 80, 0, 30, 113.0, 3.2, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0,
ATTACK_SETOFF_KIND_ON, ATTACK_LR_CHECK_F, ATTACK_LR_CHECK_F, ATTACK_LR_CHECK_F,
ATTACK_LR_CHECK_F, ATTACK_LR_CHECK_F, false, false, false, false, true,
COLLISION_SITUATION_MASK_GA, COLLISION_CATEGORY_MASK_ALL, COLLISION_PART_MASK_ALL,
false, hash40("collision_attr_fire"), ATTACK_SOUND_LEVEL_M, COLLISION_SOUND_ATTR_PUNCH,
ATTACK_REGION_PUNCH
)
rust {
println!("Fair frame 16");
}
}
sv_kinetic_energy::add_speed(1.0);
});
}
#[skyline::main(name = "acmd_test")]
pub fn main() {
acmd::add_hook!(mario_fair);
}
[package]
name = "acmd_test"
version = "0.1.0"
authors = ["jam1garner <jam1.mcleod@hotmail.com>"]
edition = "2018"
[package.metadata.skyline]
titleid = "01006A800016E000"
[lib]
crate-type = ["cdylib"]
[dependencies]
skyline = { git = "https://github.com/ultimate-research/skyline-rs.git" }
skyline_smash = { git = "https://github.com/ultimate-research/skyline-smash.git" }
acmd = { git = "https://github.com/ultimate-research/skyline-acmd.git" }
[profile.dev]
panic = "abort"
[profile.release]
panic = "abort"
lto = true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment