#Writing code for aow
32 messages · Page 1 of 1 (latest)
Id also like to know how to have different AoWs for one handed and 2 handed movesets
Maybe this thread would help https://discord.com/channels/529802828278005773/1312731862787162112
Just do it in rust
What would it look like doing it in rust? I'd be interested to see how that works if you get a chance.
I forgot about this, I couldn't finish it under an hour and forgot icl
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
Haha awesome thank you! I definitely want to get a better understanding of fsrs. And enjoy the drinks lol.
that's the entire source code
alternatively:
this is lib.rs
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 
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 em
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.
This was really doable in just pure HKS 
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
Where the hell did you even learn all of that? Is there a repository or a guide that explains something similar?
Goat 🙏
I was looking to do something similar with the Barbaric Scream or War Cry in HKS but couldn't find what triggers the charged heavy change since I'm trying to make a speffect that enhances charged attacks for a one time use
Search hks for spEffect 1811
hey I was investigating this and I couldn't figure out how ashes of war decide which version to use for different weapon types, do you know where that's determined?