chore(release): v1.5.10 - Skeleton body switch for player model mods
New client-side option Skeleton - Visuals -> Body Model Enabled. Off, a Skeleton takes the human branch of the VisEquipment postfix: vanilla body on, no bone meshes, eye glow, jaw correction or skull flame, and the helmet is left alone. Requested by players using EnhancedValheimVRM, where the bones floated around the replacement model. README: New in block for v1.5.10, changelog entry (also the Russian fixes since 1.5.9), and a line under the Skeleton features.
This commit is contained in:
parent
aca3eabb2f
commit
bb1ca57924
10 changed files with 43 additions and 15 deletions
|
|
@ -41,6 +41,7 @@ namespace RacesOfValheim
|
|||
|
||||
// ─── Visuals ───────────────────────────────────────────────────────────
|
||||
public static ConfigEntry<bool> HeadFireVFXEnabled;
|
||||
public static ConfigEntry<bool> BodyModelEnabled;
|
||||
|
||||
public static void Bind(ConfigFile config)
|
||||
{
|
||||
|
|
@ -71,6 +72,8 @@ namespace RacesOfValheim
|
|||
const string visuals = "Skeleton - Visuals";
|
||||
HeadFireVFXEnabled = config.Bind(visuals, "Head Fire VFX Enabled", true,
|
||||
new ConfigDescription("Whether the burning-skull effect (worn from tier 5+) renders at all. A client-side preference: disabling it stops you from seeing it on yourself and on every other skeleton you look at, but does not change what other players see."));
|
||||
BodyModelEnabled = config.Bind(visuals, "Body Model Enabled", true,
|
||||
new ConfigDescription("Whether Skeleton players wear the skeleton body. Turn it off if you use a player model mod (EnhancedValheimVRM and the like): Skeletons then keep the vanilla viking body, so the replacement model shows without bones clipping through it. Abilities are unchanged. Client-side, like the option above: it applies to every Skeleton you see, yourself included, and changes nothing for other players."));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -62,10 +62,11 @@ namespace RacesOfValheim
|
|||
Transform jaw = ResolveJaw();
|
||||
if (jaw == null || jaw.parent == null) return;
|
||||
|
||||
if (!SkeletonVisuals.IsSkeletonPlayer(m_player))
|
||||
if (!SkeletonVisuals.ShowsSkeletonBody(m_player))
|
||||
{
|
||||
// Nothing rewrites this bone on its own, so a player who stops being a Skeleton
|
||||
// would otherwise keep wearing the correction on their human face.
|
||||
// (or switches the skeleton body off) would otherwise keep wearing the correction
|
||||
// on their human face.
|
||||
if (m_applied)
|
||||
{
|
||||
jaw.localPosition = m_baseLocalPosition;
|
||||
|
|
|
|||
|
|
@ -254,7 +254,9 @@ namespace RacesOfValheim
|
|||
// before it could find out it was looking at a Skeleton.
|
||||
string race = SkeletonVisuals.GetPlayerRace(p);
|
||||
|
||||
if (race == SkeletonVisuals.RaceId)
|
||||
// With "Body Model Enabled" off a Skeleton takes the human branch below, the same
|
||||
// as any other race, so the toggle also works live: the next refresh swaps back.
|
||||
if (race == SkeletonVisuals.RaceId && SkeletonConfig.BodyModelEnabled.Value)
|
||||
{
|
||||
if (__instance.m_bodyModel != null)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -323,9 +323,13 @@ namespace RacesOfValheim
|
|||
VisEquipment currentVis = Player.m_localPlayer.GetComponent<VisEquipment>();
|
||||
if (currentVis != null)
|
||||
{
|
||||
// Hide Helmets (Valheim uses singular GameObject for helmet)
|
||||
var helmetObj = HarmonyLib.Traverse.Create(currentVis).Field<GameObject>("m_helmetItemInstance").Value;
|
||||
SkeletonVisuals.SetEquipmentPieceHidden(helmetObj, true);
|
||||
// Hide Helmets (Valheim uses singular GameObject for helmet). Only over a skull:
|
||||
// a viking body wears its helmet, and the VisEquipment postfix puts it back.
|
||||
if (SkeletonConfig.BodyModelEnabled.Value)
|
||||
{
|
||||
var helmetObj = HarmonyLib.Traverse.Create(currentVis).Field<GameObject>("m_helmetItemInstance").Value;
|
||||
SkeletonVisuals.SetEquipmentPieceHidden(helmetObj, true);
|
||||
}
|
||||
|
||||
// Scale Body Armor (Chest, Legs, Shoulder) by 5%
|
||||
string[] armorFields = { "m_chestItemInstances", "m_legItemInstances", "m_shoulderItemInstances" };
|
||||
|
|
@ -440,7 +444,7 @@ namespace RacesOfValheim
|
|||
}
|
||||
|
||||
// Flames on the skull, worn with the fire-tier model and nothing else.
|
||||
headFlame.Apply(Player.m_localPlayer, SkeletonConfig.HeadFireVFXEnabled.Value && SkeletonVisuals.GetModel(Player.m_localPlayer, state) == SkeletonProgression.FireModel);
|
||||
headFlame.Apply(Player.m_localPlayer, SkeletonConfig.HeadFireVFXEnabled.Value && SkeletonConfig.BodyModelEnabled.Value && SkeletonVisuals.GetModel(Player.m_localPlayer, state) == SkeletonProgression.FireModel);
|
||||
|
||||
if (rules.FireAura)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -49,6 +49,16 @@ namespace RacesOfValheim
|
|||
|
||||
public static bool IsSkeletonPlayer(Player player) => GetPlayerRace(player) == RaceId;
|
||||
|
||||
/// <summary>
|
||||
/// Whether this client draws the skeleton's bones on this player. False for every
|
||||
/// non-Skeleton, and for every Skeleton when "Body Model Enabled" is off: model-replacement
|
||||
/// mods (EnhancedValheimVRM and the like) hide the vanilla body and draw their own, so the
|
||||
/// borrowed bones ended up floating around the replacement model. With the option off the
|
||||
/// Skeleton keeps every ability and only looks like a plain viking.
|
||||
/// </summary>
|
||||
public static bool ShowsSkeletonBody(Player player) =>
|
||||
SkeletonConfig.BodyModelEnabled.Value && IsSkeletonPlayer(player);
|
||||
|
||||
/// <summary>
|
||||
/// Fully hides (or restores) one equipped item instance - a helmet, typically.
|
||||
///
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue