fix-skeleton-bugs #13

Merged
kanym merged 11 commits from fix-skeleton-bugs into main 2026-08-05 18:39:16 +02:00
3 changed files with 31 additions and 10 deletions
Showing only changes of commit f192f929f6 - Show all commits

feat(skeleton): wear Skeleton_Hildir from Moder, not the charred twitcher

Swaps the model the race takes at Moder. Hildir'''s skeleton is built on the same
rig as the plain one, so the 0.85/1.20/0.85 squeeze goes with it - that existed
only to make the charred twitcher'''s broader, shorter proportions read as a
player, and the bone-by-name remapping the swap relies on now has an exact rig to
match against rather than an approximate one.

The compendium no longer claims the bones blacken, since they no longer do; the
fire aura it describes is unchanged.

An unresolved model id used to fail silently and invisibly - the human body is
switched off before the replacement is built, so a bad name leaves a player with
no mesh at all. It now warns once per name.
kanym 2026-08-05 17:04:10 +02:00

View file

@ -347,8 +347,8 @@ namespace RacesOfValheim
if (state >= 5)
{
sb.AppendLine("[Moder Unlock] Charred Bones:");
sb.AppendLine("Your frame blackens and burns, and the fire clings to you: everything near enough to feel it is scorched. Your wounds also close faster than bone has any right to.\n");
sb.AppendLine("[Moder Unlock] Bones Alight:");
sb.AppendLine("Your frame is remade in a harder cast, and fire clings to it: everything near enough to feel it is scorched. Your wounds also close faster than bone has any right to.\n");
}
if (state >= 6)

View file

@ -10,6 +10,20 @@ namespace RacesOfValheim
private static Mesh skeletonMesh = null;
private static Material[] skeletonMaterials = null;
// Model names already reported as missing. The body swap runs from a visual refresh, so
// without this a mistyped prefab id would log every time equipment changes.
private static readonly System.Collections.Generic.HashSet<string> warnedMissingModels =
new System.Collections.Generic.HashSet<string>();
private static void WarnMissingModelOnce(string prefabName)
{
if (!warnedMissingModels.Add(prefabName)) return;
Jotunn.Logger.LogWarning(
$"[Skeleton] Body model prefab '{prefabName}' not found - the race has no mesh at this tier. " +
"Check the id in SkeletonProgression.");
}
/// <summary>
/// Makes the Skeleton's max health exactly what its progression promises.
///
@ -260,6 +274,13 @@ namespace RacesOfValheim
if (skeletonBodyTransform == null)
{
GameObject skelPrefab = PrefabManager.Cache.GetPrefab<GameObject>(rules.ModelPrefab);
if (skelPrefab == null)
{
// The human body was switched off two lines up, so an unresolved
// model leaves an invisible player rather than an obvious error.
// Say so once per tier instead of failing silently.
WarnMissingModelOnce(rules.ModelPrefab);
}
if (skelPrefab != null)
{
GameObject skelObj = new GameObject(targetBodyName);

View file

@ -37,15 +37,15 @@ namespace RacesOfValheim
public const string BaseModel = "Skeleton";
public const string PoisonModel = "Skeleton_Poison";
// The published progression calls for a fire skeleton from Moder on, and the charred
// twitcher is the only burnt skeleton the game ships. It used to arrive at Fader; if that
// is preferred, move the model and its scale back to the state >= 8 block - nothing else
// in this file depends on where they sit.
public const string FireModel = "Charred_Twitcher";
// The model worn from Moder on. It used to arrive at Fader; if that is preferred, move it
// and its scale back to the state >= 8 block - nothing else in this file depends on where
// they sit.
public const string FireModel = "Skeleton_Hildir";
// The charred rig is broader and shorter than a plain skeleton, so it needs squeezing to
// read as a player. Tied to the model, not to a tier.
public static readonly UnityEngine.Vector3 FireModelScale = new UnityEngine.Vector3(0.85f, 1.20f, 0.85f);
// Hildir's skeleton is built on the same rig as the plain one, so it needs no reshaping to
// read as a player - unlike the charred twitcher this replaced, which is broader and
// shorter and wore a 0.85/1.20/0.85 squeeze to compensate. Tied to the model, not a tier.
public static readonly UnityEngine.Vector3 FireModelScale = UnityEngine.Vector3.one;
public const string SummonPrefabName = "Skeleton_friendly";