#Writing code for aow

32 messages · Page 1 of 1 (latest)

cunning olive
#

Im trying to make a double functioning ash of war where 1h is a stance(like squere off) and 2h is a basic aow(lions claw).can someone help.i saw something similar on clevers tachikaze mod but in reverse order.

severe creek
#

Id also like to know how to have different AoWs for one handed and 2 handed movesets

tawdry meadow
austere lodge
#

Just do it in rust

nimble vine
austere lodge
#

Remind me tomorrow I'm getting stupid drunk any minute now

#

I just need to map some pointer math to the right namesakes of fsrs and I can load a list of custom 1h & 2h ashes on weapons by weapon and ash id's

nimble vine
austere lodge
#

that's the entire source code

#

alternatively:

#
use eldenring::{fd4::FD4ParamRepository, param::EQUIP_PARAM_WEAPON_ST};
use serde::Deserialize;
use shared::FromStatic;

#[derive(Default, Deserialize, Clone)]
pub struct CustomAsh {
    pub weapon_pid: u32,
    pub one_handed: u32,
    pub two_handed: u32,
    pub ignore_lvl: bool,
}

impl CustomAsh {
    pub fn max_range(&self) -> u32 {
        let weapon_pid = self.weapon_pid as u32;
        if self.ignore_lvl {
            if let Some(weapon_param) = unsafe { FD4ParamRepository::instance() }
                .ok()
                .and_then(|param| param.get::<EQUIP_PARAM_WEAPON_ST>(weapon_pid))
            {
                if weapon_param.origin_equip_wep16() == i32::MAX {
                    return weapon_pid + 10;
                } else {
                    return weapon_pid + 25;
                }
            }
        }
        weapon_pid
    }
}

#[derive(Default, Deserialize, Clone)]
pub struct WeaponList {
    pub weapon: Vec<CustomAsh>,
}

impl WeaponList {
    pub fn from_file(path: &str) -> Option<WeaponList> {
        let text = std::fs::read_to_string(path).ok()?;
        toml::from_str(&text).ok()?
    }
    pub fn get_custom_ash(&self, weapon_pid: u32) -> Option<&CustomAsh> {
        self.weapon.iter().find_map(|weapon| {
            let max_range = weapon.max_range();
            if weapon_pid >= weapon.weapon_pid && weapon_pid <= max_range {
                Some(weapon)
            } else {
                None
            }
        })
    }
}
#

this is weaponlogic.rs, which is just a vector holding all weapons, ashes and wether it should ignore upgrades.

#

it tried to fetch a toml inside the game folder:

[[weapon]]
weapon_pid = 0x0044F840 # Fire knight's Greatsword.
one_handed = 0x800051A4 # Gravitas.
two_handed = 0x8007B4A8 # The poison flower blooms twice.
ignore_lvl = true       # Ignore weapon level when looking for weapon ID's.
#

as long as the toml is named weapon-list.toml it will load every [[weapon]] entry and the task will then check that list to do the logic

#

@nimble vine smile

#

requires the weapon to have an existing ash of war in the way i've made it

#

you totally can do it without it, but you'd have to spawn in (or use an exsiting) ash of war item

#

the derive's you see for WeaponList and CustomAsh are redundant aside from Deserialize, but i had those for debugging

#

forgot to remove empuddingcat

nimble vine
#

Thank you so much! I had the same issue in a lua script thing I made using script exposure but I'd like to understand fromsoftware-rs more to be able to make a safer version of it. For some reason it just doesn't click.

solid wren
#

This was really doable in just pure HKS fatcat
Just hooking into the system that spinning slash uses for making different ashes of war for different weapon types. But then modify the logic to check for the hand style

vagrant lion
austere lodge
# vagrant lion Where the hell did you even learn all of that? Is there a repository or a guide ...
GitHub

🔩 Rust bindings to Elden Ring, Dark Souls 3, Nightreign and Sekiro - vswarte/fromsoftware-rs

vagrant lion
solid wren
#

Search hks for spEffect 1811

chrome plume