Commit graph

250 commits

Author SHA1 Message Date
58874457e0 Merge branch 'fix/radial-swallows-attack-input' 2026-09-26 18:12:36 +02:00
97d02855e5 feat(skadi): say why a Cold Spell press did not cast, and log each step of the cast
Every gate on the spell was silent, so "it does nothing" looked the same as
"it was never pressed". Each refusal now logs its reason once per session,
and the cast logs each step before taking it, because the crash it chases
kills the process without a stack trace. The prefab descriptions run after
the Instantiate, so reading them can't be what makes the spawn safe.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-26 18:12:34 +02:00
e973e21003 chore(input): quieten the radial proof to one line per state
The transition log did its job - it showed Hud.InRadial() reporting False at
spawn with no wheel on screen, which is what the gate depends on and what the
method's name alone could not promise. Left in, because that proof is worth
one line in every player's log, but said once per state instead of twice per
use of the wheel.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-26 17:30:35 +02:00
2b900d91e7 fix(input): the radial menu no longer swings the form it is opening a menu on
Clicking an entry in the race wheel also fired the transformed form's attack.
The click picks the entry AND is read here as a raw mouse button, because the
forms read the device directly rather than going through Humanoid.StartAttack.
Vanilla attacks never had this: they go through ZInput, which the radial
already blocks, so only input read straight off the device got through - which
is all of ours.

Hud.InRadial() answers it, the same shape of call as the
Hud.IsPieceSelectionVisible() already here for the hammer's build panel. That
is now the second GUI Player.TakeInput knows nothing about.

CHECKED IN AttackDown AND NOT IN Allowed, deliberately. The radial fires an
ability by queueing its keybind through Press(), and the ability's own reader
picks that up inside an Allowed gate - so blocking Allowed while the wheel is
open would risk the wheel swallowing the abilities it exists to trigger.

The second half is the same bug one layer down: an ability bound to a mouse
BUTTON does not go through AttackDown at all. Skadi's cold spell sits on middle
mouse, so middle-clicking an entry in the wheel cast it. IsDownIgnoringHeldKeys
now takes the queued press first and without any gate - that one is the radial
itself - and ignores a raw mouse button while the wheel is up. Keys at the
keyboard are untouched: nothing about an open wheel makes pressing K ambiguous.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-26 17:15:21 +02:00
7ad1d6920e fix(fenrir): the Ulv was mouthing a silent howl
The howl code took a playing animation as proof the sound was coming, because
the wolf's does bring it: 'C_Hawl' fires an Effect event at 0.39s holding
sfx_wolf_haul. The Ulv is the same family on the same rig and its 'Idle Howl'
carries no event at all - events=0, read straight off dumpanim - so pressing
the key as an Ulv played the animation and nothing else. The muzzle went up in
silence.

Which creatures bring their own sound is now written down rather than assumed,
and it is only the wolf. FenrirCreatureSound.Howl does the whole thing -
animation, trigger published for the other clients, and a sound unless the
animation is already carrying one - so the four forms call one line and the
distinction lives in one place.

The Ulv's hold also went from 3.3s to 3.8s: it was the wolf's clip length,
copied, and 'Idle Howl' runs 3.67s.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-26 16:55:19 +02:00
cd10722594 docs: say that the Cultist's fire breath runs on eitr
The feature list said "Transform into a Cultist to use fire abilities" and
never mentioned a cost. The flames take 12.5 eitr per second, and eitr comes
from the Mistlands while the form unlocks at Yagluth - so the form can be had
with its signature attack still out of reach. Both the feature bullet and the
changelog say so now.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-26 16:27:42 +02:00
6b43d3544e feat(fenrir): say why the fire breath did not come, and log a Draugh's parry
Holding right mouse as a Cultist with no eitr did nothing whatsoever - no
flames, no sound, no reason given. The form arrives at Yagluth and eitr is a
Mistlands thing, so a Cultist meets that silence before it ever meets the
fire. It now says "Only breath comes out. The fire wants eitr." on a
three-second timer, since the button is read every frame and the message would
otherwise be a wall.

The parry that fires the Draugh's poison splash is logged, with the block
timer against the window and whether the splash effect resolved. A parry has
to land inside a quarter-second window while blocking, so "nothing looks
different after tier 3" is as likely to mean the window was missed as it is to
mean the splash did not draw, and there was no way to tell those apart.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-26 14:00:21 +02:00
1c8fa7357f chore(release): sync the packaging manifest to 1.4.24
JotunnModStub/Package/manifest.json is a second copy of the root manifest,
kept by hand and differing from it only in the version - a third place for the
version to drift, on top of the two MAINTAINING.md already warns about. It was
still on 1.4.23.

Synced rather than fixed: the packaging step should copy the root manifest
instead of there being two, which is a change to make when the artifacts are
built rather than in a version bump.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-26 01:50:21 +02:00
421bc72eb7 chore(release): v1.4.24
Version bumped in both places that carry it - manifest.json is what
Thunderstore ships, PluginVersion is what the game logs - since those two have
drifted apart before.

The Nexus description is generated now rather than rewritten by hand. It had
fallen thirteen versions behind the README, which is how a hand-maintained
copy of a 72KB document goes. scripts/nexus-readme.py converts README.md to
the BBCode the page wants, following what the 1.4.11 page did by hand so the
two are comparable, and writes dist/NEXUS_README_<version>.bbcode.txt.

The wiki link was on the Nexus page and had never been in the README, so every
other channel shipped without it. It is in the README now, which means it
reaches Nexus, Thunderstore and the repository from one place.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-26 01:45:08 +02:00
148ca5b39e Merge branch 'fix/skeleton-fire-aura-prefab-hijack'
Six commits: the Skeleton fire aura no longer borrows another mod's VFX by
name, every prefab lookup name in the mod now exists in vanilla, the Draugh's
Human Meat is a real item, the Fenrir forms have their own voices and howl on
demand, and dumpanim reads an animator instead of guessing at it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-26 01:42:04 +02:00
da896179fd feat(fenrir): howl on demand, in every form
The howl key was only ever read by the two Fenring forms. As a wolf or an Ulv
it did nothing at all - not a misconfiguration, the classes simply never
looked at it. All four forms read it now.

The wolf and the Ulv perform the creature's own howl animation and NO SOUND
IS SPAWNED, because their clip already carries one: 'C_Hawl' fires an
animation event at 0.39s holding sfx_wolf_haul, and the game's own
AnimationEffect plays it. The audio comes out of the animation, at the
instant the animation means it to, which no prefab fired on a keypress can
match. Spawning one as well would be a second howl over the first.

A trigger is looked for before a state, and that is about multiplayer rather
than tidiness: FenrirAttackSync replicates trigger names, so a howl fired
through a trigger is one the other clients see and hear, while Animator.Play
is local and nobody else knows. Which route was taken is logged once per
creature, and if neither exists the log prints the animator's whole parameter
list rather than leaving another keypress that quietly does nothing.

The Fenring and the Cultist have no howl clip in vanilla - 19 and 18 clips,
none of them a howl, and their taunt fires no sound event - so they keep the
Taunt animation and take the wolf's howl as their voice.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-26 01:41:00 +02:00
22170087ae feat(debug): dumpanim, for reading an animator instead of guessing at it
Guessing at animation has cost this mod real time: a howl looked for under
three wrong names, a taunt animation nobody knew played, and a sound prefab
that kills the process when spawned on its own.

dumpanim <prefab> lists a creature's parameters, layers, every clip in its
controller with name and length, and every AnimationEvent on every clip - the
instant, the method called, and the asset an event hands over. That last
column is where a sound wired into an animation lives, and it is what finally
found the wolf's howl.

It also prints the components beside the Animator, because an animation event
is delivered to those and nowhere else. On a prefab with no animator at all
it falls back to dumping the hierarchy, the components and the audio setup,
which is how a sound prefab gets looked at without being spawned - and some
of them must not be spawned.

dumpanim live watches every animator under the player and reports each clip
change as it happens. Standing still in wolf form and reading the log is what
showed 'C_Hawl' coming round in the idle rotation on its own.

What Unity will not give up, and it is worth knowing before starting: the
state machine. States and transitions are editor-only and
GetCurrentAnimatorStateInfo returns hashes with no names, so a state can only
be guessed and then confirmed.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-26 00:20:42 +02:00
9907cae292 fix(fenrir): give the forms a voice, and stop the sounds writing to the save
Every sound the Fenrir forms played was looked up by a name, and most of
those names are not prefabs in this game. The chains hid it: PlaySFX walks
its arguments and stops at the first that resolves, so a claw that asked for
"sfx_fenring_attack", "sfx_fenring_attack_claw", "sfx_wolf_attack" had a
Fenring swinging with a wolf's voice through a fallback nobody noticed. The
cultist's double claw asked for three dead names in a row and was silent from
the day it was written.

The creatures do have their own sounds. The forms now use them:
sfx_fenring_claw_start for the swing, sfx_fenring_claw_hit for the landing,
sfx_fenring_fireclaw to open the fire breath. The Ulv keeps the wolf's, since
vanilla ships it nothing but sfx_ulv_death.

THE HOWL WAS NEVER A PREFAB TO LOOK UP. It is an AnimationEvent inside the
wolf's 'C_Hawl' clip, firing at 0.39s with the sound handed over as an object
reference - and a player in wolf form idles through that clip and howls out
loud already, with the game's own AnimationEffect doing the work. Three
spellings of one word are why this took so long to find: the clip is
'C_Hawl', the sound is 'sfx_wolf_haul', and the mod was looking for
'sfx_wolf_howl', the only correct spelling of the three and the only one that
does not exist. The Fenring has no howl of its own at all, so it borrows the
wolf's over its Taunt.

The jump attack's impact moved to where the jump lands, next to the damage,
instead of firing before the dash while the form is still standing.

FenrirCreatureSound.Spawn is the other half. Some vanilla sound prefabs carry
a ZNetView - sfx_fenring_alerted does - and one that wakes with no init ZDO
writes a persistent record into the world, once per swing. Spawning now runs
inside ZNetView.StartGhostInit, the game's own answer, so no ZDO is made. All
nine sound spawns in these forms go through it.

sfx_fenring_howl resolves to an ordinary sound prefab and hard-exits the
process when spawned on its own. It is named in a Suspect set, described in
the log and never instantiated, because a name nobody records is a name
somebody adds back.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-26 00:20:31 +02:00
276ff93834 feat(draugh): add the Human Meat item the Bonemass perk has always promised
Two places in the mod used an item called "HumanMeat" and nothing registered
it: the drop in Draugh_DeathAura_Patch and the "fatal to the living" block in
DraughFoodPatches. Both check for null, so the perk has been a no-op since
it was written - a README line with no item behind it. The two consumers are
unchanged; what was missing was the producer.

Built from two vanilla items, one for the look and one for the numbers.
RawMeat gives the model and icon, because that is what a piece of somebody
looks like and because raw flesh is the Draugh's whole food identity.
BloodPudding gives the nourishment, copied field by field at start-up rather
than written down here, so the item stays balanced against the game's own
progression and follows any change made to it.

Blood Pudding's stamina goes onto health and stamina is left at zero. A
Draugh does not use stamina, so nourishment spent there is thrown away: the
food slot would read full while giving the race half of what it cost.

RawMeat is a Material in vanilla - raw meat is not edible - so m_itemType is
forced to Consumable. That is the one assumption worth knowing about, and
the registration logs what it produced so a silent failure cannot hide. The
meat is tinted on copies of the materials, never the shared ones, or every
piece of raw meat in the world would darken with it.

The README said humanoids drop it. The patch is on Player.OnDeath and always
was, so the line now says what the code does: a player who dies inside the
death aura, the Draugh included.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-26 00:20:16 +02:00
e75c7072c4 fix(prefabs): replace every lookup name that does not exist in vanilla
An audit of all 59 prefab names the mod resolves, against the game's own
asset manifests, found nine that are not in Valheim at all. A name vanilla
does not use has no vanilla candidate to beat in Jotunn's name cache, so it
is a free slot for whoever ships one - which is how another mod's weapon
trail became the Skeleton's fire aura in 00d4fd6.

Eight of the nine failed in silence, which is why none of them was ever
reported:

  vfx_corpse_destruction  ->  _medium, _large for the Muspell. The puff that
      covers a transformation. Fenrir and Skadi at least had their sparks;
      the Muspell swapped bodies in plain view with nothing at all.
  vfx_surtling_death      ->  vfx_wraith_death for the Aswid's Mist Form,
      which reads as mist by construction and is the same creature the form
      already borrows its Visual from; vfx_corpse_destruction_medium for the
      thrall, where nothing is misty. Vanilla has no surtling death effect
      under any spelling.
  TrophyTroll             ->  TrophyForestTroll.
  TrophyBat               ->  TrophyDeathsquito. Vanilla ships no bat trophy,
      so the Aswid's two status effects and its radial entry had no icon.
  vfx_smoke               ->  gone. It was the Trenta's fallback for Purple
      Rain's particle material behind Greydwarf_Shaman, and the day the
      Shaman failed to resolve it would have worn whatever a mod supplies.
      Purple Rain is purple by design, so nobody would ever have reported it.

The ninth did not fail in silence. vfx_OozeHit was passed to Instantiate
unguarded, so every successful Draugh parry threw ArgumentException and took
the North Wind nova below it down as well. It is vfx_blob_hit.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-26 00:20:02 +02:00
00d4fd6e46 fix(skeleton): stop the fire aura borrowing another mod's VFX by name
The tier-5 fire aura looked for "vfx_smoke", then "vfx_surtling_death".
Neither name exists in Valheim, checked against the game's own asset
manifests, so both lookups came back null and the aura has never been
visible in a plain install.

The dead branch was not harmless. PrefabManager.Cache resolves by asset
name across everything in memory, other mods' asset bundles included, and
its tie-break for a duplicate name ends in "newest wins". A name vanilla
does not use has no vanilla candidate to beat, so it is a free slot.

Magic_Supremacy fills it. The lookup resolved to
'EncounterCreatureRikoMountain_DO/vfx_smoke', a child node of one of its
creatures carrying 'club_trail_riko_DO' on 'Dreanegade/ParticleAlphaEmission'
- a weapon trail, on an emissive shader, sprayed through a 4.5m sphere on
the player. That is the purple smoke around the burning skull users
reported, on every client that could see the skeleton.

The aura now draws nothing on purpose, which costs it nothing it had. Its
damage, radius and tick are untouched. The two identical EnsureFireAuraVFX
copies in SkeletonRace and ZdoVisualSync are replaced by one
SkeletonVisuals.EnsureFireAura, shaped like DraughVisuals.EnsureAura; the
call sites stay, so reinstating the visual needs no change in either file.
The comment on it records the whole chain and the way to build it properly,
through BorrowEffect, the way HeadFlame already does.

Also keeps a resolution log on the model lookup: every magic mod in the
report ships an object called "Skeleton", which is this race's own tier-0
model name. The vanilla creature won during the repro; root=False in that
log is what says it stopped winning.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-25 15:54:21 +02:00
Ferdinando
f64fe83d9d bugfix 25/09/26 2026-09-25 12:26:51 +02:00
Ferdinando
9bebcf340b bugfix 24/09/26 2026-09-24 10:30:39 +02:00
Ferdinando
e7325e4d25 chore(release): v1.4.21 - dragon form multiplayer sync, Sverm Ravager networking, dorsal spine fix
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-23 11:56:09 +02:00
Ferdinando
6499eb71df chore(release): v1.4.20 - refused buildings cost nothing, Skadi pad cold spell
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-21 17:38:53 +02:00
Ferdinando
64d8869f98 bugfix 21/09/26 2026-09-21 09:05:56 +02:00
Ferdinando
834d6647fd chore(release): v1.4.19 - eye height, remote forms, food refresh, faction retaliation
Race body scale moved the model and not the camera: Character.m_eye hangs
off the unscaled root, so a Trol or a Dvergar changed height for everyone
but themselves. RaceEyeHeight moves the eye by whatever scale the Visual
is wearing, for every player, so aim rays follow too.

Remote copies of a Fenrir form had no one writing to their Animator and
stood in the controller's default state, sliding. RemoteFenrirAnimator
mirrors the four local behaviours off the player's own replicated
animator, the way RemoteSkadiAnimator already did for Skadi.

Player.Food.m_time is time remaining, not time elapsed: the Aswid, Trenta
and Draugh repeat-meal branches all set it to 0 and expired the slot they
meant to renew, and left the nutrition values stale. RaceFoodRefresh does
what vanilla's own branch does, in one place instead of three. The Trenta
prefix now reports __result, or a working refresh would have renewed the
slot without consuming the seed.

Aswid devour was gated by one timestamp shared by every corpse, so a pack
killed at once fed the player once; it is now per corpse, floored at a
second, and a refused meal says $msg_nomore.

MonsterAI.UpdateTarget discards any target IsEnemy refuses, so a truced
mob could not retaliate at all - it stood still or fled. RaceGrudge
records the hit on the AI owner's client and both truce postfixes stand
down for that pair. The Aswid drain and the Skadi frost aura now skip
kin, as the Skeleton's fire aura already did, or an always-on aura would
hold every truce permanently broken.

Faction sets matched exact prefab names with families half-listed:
added Skeleton_NoArcher and Draugr_Ranged to the Swamp, Greyling to the
Black Forest.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-20 08:26:22 +02:00
Ferdinando
5f74c57e72 fix: race buildings keep their own message when an item is used on them
Humanoid.UseItem shows the generic $msg_cantuseon whenever the
interactable's UseItem returns false, covering the refusal message the
building had just shown. Same fix as the Trol totem in v1.4.18, applied
to the Servant table, Dvergar barrel and bank, Fenrir trough, Draugr and
Skeleton piles, Blood Refinery, Grove and Composter: an item in hand
always counts as handled. Empty-handed interactions are unchanged.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-18 17:13:16 +02:00
Ferdinando
c7cbd6bece chore(release): v1.4.18 - Valheim hotfix flight fix, 1.0 shop fixes, Fenrir speed
Drake flight resolves ZInput.GetJoyLeftStickY at runtime, since the
hotfix dropped its bool parameter. Faction merchant TradeItems now set
the 1.0 fields StoreGui dereferences (m_tooltip, m_buyPlayerEffects),
and the Dvergar trader discount clones the whole TradeItem instead of
rebuilding four fields. Trol totem refusals return true so vanilla's
$msg_cantuseon no longer covers them. The Fenrir curse speed modifier
is the bonus alone (SE_Stats adds it), not 1 + bonus. New Discord link.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-18 17:10:24 +02:00
Ferdinando
8aa917cfcb chore(release): v1.4.16 - Trol True Form toggle past Fader, Gammeltroll thrown log
Past Fader the Trol's True Form never expires (SE ttl 0) and the key
toggles it off with no cooldown. The True Form log throw now fires one
projectile read off the Gammeltroll's own weapons at runtime, hitting
with the rock's damage formula, and falls back to the old physical log
if none is found; 'dumpgammel' logs what was resolved.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-13 11:33:47 +02:00
Ferdinando
6e87be3c77 minor bugfix and pad support 2026-09-12 10:42:01 +02:00
Ferdinando
ce671e7124 jotunn 2.30 compatibility + minor bugs 2026-09-10 19:14:05 +02:00
Ferdinando
6193b3ee2d 1.0 compatibility 2026-09-10 18:05:24 +02:00
5104f86ede chore(release): v1.4.11 - Bone Servant, input-lockout and Sverm beehive-cap fixes
Bumps the version and rolls the tester-fixes merge into the changelog:
the Bone Servant cook losing meat and the furnace starving on fuel, an
input gate that let abilities fire with the build menu open, and the
Sverm beehive cap that was configured but never actually read.
2026-08-30 19:07:17 +02:00
45b63dc7c6 Merge remote-tracking branch 'origin/tester-fixes' 2026-08-30 19:03:11 +02:00
6968480749 chore(release): v1.4.10 - Skeleton Summon on Kill fully fixed
Bumps the version and rolls the changelog entry documenting the whole
Summon on Kill fix chain from this session into README.md. Also trims
the changelog to start at v1.4.0 - everything older now points at the
wiki's release notes instead of being duplicated here.
2026-08-29 16:24:45 +02:00
8c24ae3340 fix(skeleton): Summon on Kill was completely dead - fix the whole chain
Queen/Fader-tier Skeletons were supposed to raise a tamed ally from every
kill, but nothing ever spawned. Several independent bugs stacked up:

- Kill attribution failed whenever the death blow was a poison DOT tick
  (SE_Poison builds its own attacker-less HitData every second, and
  Character.ApplyDamage overwrites m_lastHit on every one of those ticks).
  Since PoisonAttacks bakes bonus poison onto every Skeleton hit from
  Bonemass on, this was the common case, not an edge case. Character_Damage_Patch
  now tracks recent player hits per ZDOID as a fallback (RecentSkeletonHits),
  the same pattern Aswid's own life-drain-kill check already uses.
- SummonPrefabName pointed at "Skeleton_friendly", which isn't a real
  prefab (confirmed against the live ZNetScene registry). Reuses the
  Bound Bone Pile's own SkeletonThrall_Melee instead - tamed, loot-stripped,
  forced-melee, and already proven to work.
- The rise VFX names ("vfx_skeleton_spawn", "vfx_bloodmagic_aoe") were
  guesses that never existed either; fx_summon_skeleton_spawn is the real
  one. Same fix applied to the pre-existing Auto-Resurrect effect, which
  had the identical wrong names.
- The actual "climbing out of the ground" motion is a separate Animator
  bool ("wakeup") set via ZSyncAnimation - the exact call vanilla's own
  CreatureSpawner makes. Without it the model was simply active from
  frame one, VFX playing around a skeleton that was already standing.
- Vanilla skeletons carry no Tameable component, which spammed "is tamed
  but missing tameable or monster AI script!" every time a raised one
  landed a hit. Same fix Fenrir already uses for the Ulv and Fenring:
  copy one in from the vanilla Wolf, done once at prefab registration so
  it also quietly fixes the Bound Bone Pile's own thralls.
- Added RaisedThrall.SetExpiry(), a station-independent hard lifespan -
  these skeletons are never bound to a pile, so the existing anchor/wither
  pair had nothing to key off. Summoned skeletons now wither 2 minutes
  after being raised.

Also adds a permanent `listprefabs <substring>` debug console command -
queries the live ZNetScene registry directly, which is how the wrong
prefab/VFX names above were actually confirmed rather than guessed.
2026-08-29 16:01:23 +02:00
Ferdinando
819abb1a27 tester-fixes 2026-08-29 11:47:49 +02:00
Ferdinando
7ac7f99287 feat(sverm): enforce the beehive cap, and put the aura and the nest limits in config
"Beehives per Aura" was bound into the config and then read by nobody.
SvermConfigManagement.Beehives had no callers and neither did the
constant behind it, so the entry described a limit that did not exist and
a player could raise thirty hives in one aura and get thirty workers.

SweepAura is two passes now, with the cap between them. The first applies
to hives already taken and counts them - that maintenance is not
skippable, it is what survives a zone reload - and only then are new
candidates considered. One pass would have let the order the physics
query happens to return decide whether a hive counted against the cap or
was measured by it. The minute keeps running on a hive that does not fit
today, so when a taken hive is destroyed the one that has waited longest
is claimed on the next sweep instead of starting over; lowering the cap
never hands a hive back.

Three limits are now the player's: Aura Radius, Nests per Radius and Nest
Spacing Radius. PieceDensityLimit.Register takes a snapshot of its
numbers, so the Hive Market and the Brood Mound both watch their entries
and re-register when one moves - Register replaces an entry rather than
stacking a second limit on the same piece.

All three are clamped, and the reason is not tidiness: Register REFUSES a
radius of zero or a maximum below one, and a refused limit is no limit at
all. A player typing 0 into "Nests per Radius" to mean "no nests" would
have been handed unlimited nests.

Every player-facing string that stated the old numbers now reads the live
ones - the two build refusals, the orphaned market's message and hover,
and the two Compendium lines. The nest's hover shows the cap next to the
count, so moving the knob has visible effect.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-29 08:45:28 +02:00
Ferdinando
fcb6cae3ee fix(input): abilities no longer fire while the hammer's build menu is open
Skadi's cold spell is bound to middle mouse and kept casting with the
piece selection panel open. The gate was already there - HandleColdSpell
sits behind RaceInput.Allowed - but the gate itself was incomplete:
Player.TakeInput tests Chat, Console, TextInput, StoreGui, InventoryGui,
Menu, TextViewer, the map, free-fly and the barber, and nothing else
(read off the IL). Vanilla does not need the build menu in that list
because build input is handled separately in UpdatePlacement; a mod
ability reading UnityEngine.Input directly does.

Hud.IsPieceSelectionVisible is static, public and null-safe on its own
instance, so it costs one call and no reflection. Checked before
TakeInput so it holds on the fail-open path too.

Fixed in RaceInput rather than in Skadi: that class is the mod's single
input gate, so this covers every race and every bound ability - the
transformations, the flight toggle and the three dragon-form attacks
included.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-29 08:45:17 +02:00
Ferdinando
03c1006511 fix(butler): the cook's lost meat, the furnace that starved, the coal with nowhere to go
Three tester reports against the Bone Servant, all with the same shape:
the servant was doing what the code said and the code said the wrong
thing. Two vanilla methods were re-read off the IL rather than trusted.

RPC_RemoveDoneItem empties ONE slot per call - it finds the first Done
slot, spawns its item, clears it and returns - not every slot, as the
comment on PullOutput claimed. DoCollect also swept the ground BEFORE
pulling, so each visit collected the previous visit's item and dropped a
fresh one; since Plan() diverts to PlanDelivery the moment the payload is
non-empty, the servant then left for the chest and abandoned what it had
just pulled. A working hearth therefore always had exactly one cooked
meat lying beside it. Now it pulls first, in a loop bounded by a new
ButlerStation.OutputPulls - the slot count for a cooking station, 1
everywhere else, because the fermenter's Ready survives its own tap for
the length of the animation and a bare while(HasOutput) would spam
RPC_Tap.

PlanFuel sat last, behind PlanLoad, and FreeSlots goes back above zero
the instant a furnace eats one ore - so loading always had an answer and
refuelling never got a turn. The blast furnace burned down to nothing.
PlanFuel now runs ahead of PlanLoad, which cannot starve loading in
return because FuelWanted is 0 for a station with no work, and it scores
candidates by the walk the way PlanLoad does now that the choice matters.

PlanDelivery offers the load to the nearest station that will CONSUME it,
as material or as fuel, after the chest search fails and before dropping
it on the floor. UpdateSmelter only calls SpawnProcessed once the ore
queue empties, so the charcoal kiln releases its whole batch at once -
exactly the delivery a nearly full chest cannot absorb. The coal now
walks into the furnace beside it instead of onto the ground.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-29 08:45:09 +02:00
e042579e17 Fix Bone Servant crash when dropping a payload it can't place
DropPayload() cloned template.m_itemData straight off the ObjectDB
prefab and handed the clone to ItemDrop.DropItem, which instantiates
item.m_dropPrefab - a field a clone off a raw prefab never carries
(same pitfall already fixed in AswidBloodPotions.MakeFood). The result
was an unhandled ArgumentException instantiating null.

This fires whenever a servant is holding something with nowhere sealed
to put it - e.g. chests without the sigil item yet, as in the bug
report - and since the exception aborts before m_payload.Clear() runs,
the same broken load is retried, and crashes, on every AI tick after:
relogging or killing the servant doesn't clear it, because the payload
lives in the ZDO, not the character.

Fix: set clone.m_dropPrefab = prefab before dropping, same as the
existing fix.
2026-08-25 22:48:30 +02:00
Ferdinando
c99a386e4f docs(readme): correct three claims that no longer matched the code
- The Sverm intro still promised flight after Yagluth; the Stinger Morph was
  replaced by the Ravager Strain, which is a Seeker Brute and does not fly.
- Trol progression put the 4th food slot behind Bonemass. TrolFoodPatches
  gates only the 5th (state >= 6); the 4th has never had a gate.
- Trol melee bonus listed +10 at Yagluth and left axes out at both tiers.
  TrolConfig has BonemassMeleeBonus 10 and YagluthMeleeBonus 5, and
  TrolDamagePatches sends axes to m_slash, so axes do get it.

Same three corrections the compendium already got; the README had been
missed.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-25 19:37:33 +02:00
Ferdinando
cca594015a docs(changelog): shorten the serpent meat line to match the published one
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-25 19:36:33 +02:00
Ferdinando
163ad205e7 chore(release): v1.4.9 - Factions on/off switches, serpent meat price, Draugh cooking fix
Version bumped in the three places that carry it: manifest.json (the one the
packaging target reads), Package/manifest.json and PluginVersion.

README: changelog entry for the release, and the Factions section now
documents both switches - including the part worth knowing before flipping
one, that the truce switch covers every race's own peace and not just the
faction rules.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-25 19:27:14 +02:00
Ferdinando
a60f5e8217 fix(factions): make the truce switch cover every player truce, not one of five
Reported from a live game: with "Faction truce" off, a Trenta's Greydwarves
stayed friendly. The switch was working - it just was not switched over the
patch that mattered.

Five separate Harmony postfixes answer BaseAI.IsEnemy, and only
FactionHostilityPatch was gated. A Trenta reads its Black Forest truce from
RaceHostilityManager, which had no switch, so turning the faction one off
changed nothing visible. The same held for the Fenrir's wolves, the Aswid's
progression list, the Draugh's undead, the Sverm's invertebrates, the
Furling's Plains roster and the Skeleton's undead.

Gated all four player-facing ones behind the existing flag rather than
adding a switch each: from the player's side there is one question being
asked, and a switch that answers a fifth of it is worse than none.

DvergarMercenaryTrucePatch is deliberately left alone - it is a truce
between a hired thrall and a wild dvergr, two NPCs, and has nothing to do
with whether mobs come after the player.

Key stays "Faction truce" though its scope grew: renaming it would orphan
the entry in every .cfg already written, and the file beats the default in
code, so anyone who had switched it off would silently get the truce back.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-25 19:13:16 +02:00
Ferdinando
34bdf35325 Merge branch 'war-vulture' into main
Sverm Ravager Strain (replacing the Stinger Morph), Trenta Elder Root, the
Trol food and Black Forest truce work, and the faction FindEnemy patch.

Conflicts resolved:

- FactionHostilityPatch.cs: both sides added a class at the same spot and
  they cover different holes, so both are kept - FactionStaticTargetPatch
  (main, stops same-faction mobs smashing structures) and
  FactionHuntPlayerPatch (war-vulture, closes the HuntPlayer fall-through).

- RaceCompendium.cs: both branches independently fixed the same off-by-one
  in the Trol's progression gates. Took main's wording, which matches the
  code - Axes are in the melee bonus (TrolDamagePatches sends them to
  m_slash), the 4th food slot has no gate at all, and Yagluth is +5 not +10
  (TrolConfig.YagluthMeleeBonus). Kept war-vulture's two new lines, the
  Kindling fire weakness and the Black Forest truce.

- Package/manifest.json: 1.4.8, which is what the root manifest and
  PluginVersion already said.

RacesOfValheim.cs referenced SvermConfig.StingerSE/StingerCdSE, which
war-vulture renamed to Ravager. Git merged those lines without a conflict
and the result did not compile; renamed.

Also in this commit:

- Factions on/off switches (FactionsConfig): "Faction truce" and "Faction
  merchants", both default on, both read live so they take effect without a
  restart. The truce gates its three postfixes; the merchants gate the
  Character.Awake setup plus every behavioural patch, so turning them off
  drops the prompt and the trade window on mobs already awake.

- SerpentMeat sells for 200 instead of 1 at the Fuling bench, moved to keep
  the list's ascending price order (the sell panel renders it as declared).

- DraughFoodPatches mapped "SerpentMeatRaw", which is not a prefab; the
  internal id is SerpentMeat, so serpent meat never cooked for a Draugh.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-25 18:52:10 +02:00
Ferdinando
ee5a2e2e7b warvulture 2026-08-24 19:17:47 +02:00
3352e84438 Merge branch 'limit-cave-build-debug-log' into main 2026-08-24 14:10:24 +02:00
1e75efd311 Limit troll cave placement-refusal log to near a cave
ReportWhyIfRefused fired on every refused placement by any Trol/Skadi
player, anywhere in the world - not just cave-related ones - since it
only rate-limits on the reason changing, not on location. Gate it on
distance to the nearest TrollCave02 mouth (100m) so it still catches a
refusal that survives near a cave, without logging every ordinary
"can't build here" the rest of the world produces.
2026-08-24 14:03:40 +02:00
f130cf127d Merge branch 'fix-fenrir-compendium-text' into main 2026-08-24 13:50:37 +02:00
ccafb1d02f Merge branch 'remove-sync-debug-logs' into main 2026-08-24 13:50:33 +02:00
fbaa2e9502 Fix Fenrir compendium: remove bogus consume-on-kill line
Same copy-paste artifact as Trol's entry - Fenrir has no consume/devour
mechanic, only Aswid does (TryConsumeMob/Devour).
2026-08-24 13:49:03 +02:00
189177b643 Fix Trol compendium: remove bogus consume-on-kill line, correct off-by-one progression gates
- Trol has no consume/devour mechanic; that line was copy-pasted from
  Aswid's entry, which does.
- Every boss-gated line was checking state >= N-1 instead of N, so each
  unlock (Eikthyr XP bonus, Elder's rock throw/regen, Bonemass/Yagluth
  bonuses, Moder's True Form, Queen's Log Weapon, Fader's Ashlands smash)
  displayed a full tier early. Aligned all seven gates with
  BossProgressionManager's state mapping and the actual code gates in
  TrolSkillPatches, TrolRegenPatches, TrolRace, and TrolFarmingPatches.
- Yagluth melee bonus line said +10; TrolConfig.YagluthMeleeBonus
  defaults to 5, matching the Rock Throwing figure beside it.
- Bonemass/Yagluth melee bonus text omitted Axes, though the bonus
  (TrolDamagePatches) applies to Axes too.
2026-08-24 13:47:53 +02:00
0afba60ed6 Remove leftover TrolSync/SkadiSync debug logging
These periodic Jotunn.Logger.LogInfo calls were spamming the console
for every remote player update; drop them along with their now-unused
throttle fields.
2026-08-24 13:34:30 +02:00