Baka_Gaijin-SledgeMajsterLateFix icon

SledgeMajsterLateFix

Fixes balrond_sledgemajster not detecting Arsenal Reborn sledges due to load order timing. Applies the same battleaxe-swing primary / AoE-slam secondary swap to late-registered sledge weapons.

Last updated 3 days ago
Total downloads 40
Total rating 1 
Categories Tweaks Misc Server-side Client-side Utility AI Generated
Dependency string Baka_Gaijin-SledgeMajsterLateFix-1.0.4
Dependants 0 other packages depend on this package

This mod requires the following mods to function

Balrond-balrond_sledgemajster-1.0.3 icon
Balrond-balrond_sledgemajster

Adds primary attack of Battleaxe to Sledges and move it attack to secondary

Preferred version: 1.0.3
Balrond-balrond_arsenal_reborn-0.1.6 icon
Balrond-balrond_arsenal_reborn

An overhaul adding over 150 new weapons and armors and changing multiple aspect of vanilla items

Preferred version: 0.1.6
denikson-BepInExPack_Valheim-5.4.2333 icon
denikson-BepInExPack_Valheim

BepInEx pack for Valheim. Preconfigured with the correct entry point for mods and preferred defaults for the community.

Preferred version: 5.4.2333

README

SledgeMajsterLateFix

A lightweight companion patch for balrond_sledgemajster that extends its battleaxe-swing attack swap to sledge weapons registered by late-loading mods like balrond_arsenal_reborn.


The Problem

If you run both balrond_sledgemajster and balrond_arsenal_reborn, you'll notice that only vanilla sledges (Stagbreaker, Iron Sledge, Demolisher) get the attack swap. Arsenal Reborn's sledges — SledgeStone, SledgeBlackmetal, SledgeSilver, SledgeFlametal, SledgeFrosteel, SledgeDarksteel, SledgeStagbreakerNEW, and SledgeAwakened — are left untouched.

This happens because of a load-order timing issue:

  1. balrond_sledgemajster scans for sledge weapons at ZNetScene.Awake (an early Unity lifecycle event)
  2. balrond_arsenal_reborn registers its weapons later via Jotunn's item system
  3. By the time Arsenal Reborn's sledges exist in the prefab database, sledgemajster's scan has already finished

The weapons have the correct naming (SledgeStone_bal, etc.) and would pass the detection check — they simply don't exist yet when the check runs.


The Fix

This plugin waits for the world to fully initialize, then performs a second scan that catches everything sledgemajster missed:

  • Uses SledgeIron (already processed by sledgemajster) as a reference template
  • Scans both m_prefabs and m_namedPrefabs for any sledge-named weapon that wasn't processed
  • Moves the original AoE ground slam to the secondary attack (middle click)
  • Clones the battleaxe-style swing as the new primary attack (left click)
  • Logs each patched weapon to BepInEx/LogOutput.log for verification

After installation, check your log for:

[Info] SledgeMajster Late Fix complete: patched 8 additional sledge(s)

Installation

  1. Install via Thunderstore Mod Manager (recommended) or manually place SledgeMajsterLateFix.dll into BepInEx/plugins/
  2. Required on both server AND all clients — attack definitions are loaded locally on each machine
  3. No configuration needed — the plugin is fully automatic

Compatibility

  • Required: BepInEx 5.4+, balrond_sledgemajster 1.0.3+
  • Designed for: balrond_arsenal_reborn (but works with any mod that registers sledge weapons with "Sledge" in the prefab name via Jotunn or late registration)
  • Skips weapons already processed by sledgemajster — no double-processing, no conflicts
  • Does not modify sledgemajster's code or behavior in any way

Technical Details

  • Hooks: None (uses a delayed coroutine, not Harmony patches)
  • Timing: Waits 8 seconds after ZNetScene initialization for all mods to finish registering items
  • Detection: Matches prefab names containing "Sledge" (case-sensitive, excluding "Anchor"), same logic as sledgemajster
  • Attack cloning: Uses MemberwiseClone on the reference attack for a faithful shallow copy

Attributions

  • balrond_sledgemajster by Balrond — the original sledge attack-swap mod that this patch extends
  • balrond_arsenal_reborn by Balrond — adds the Arsenal Reborn sledge weapons that this fix targets
  • BepInEx by BepInEx Team — the modding framework
  • Jotunn by ValheimModding — the Valheim library framework used by Arsenal Reborn for item registration

Source Code

GitHub Repository

Licensed for free use. If Balrond updates sledgemajster to scan at a later lifecycle event, this patch becomes unnecessary and can be safely removed.