From 916ba5bd6f853973bc1c125d537bc4c1ed287bbd Mon Sep 17 00:00:00 2001 From: kanym Date: Sat, 17 Oct 2026 15:59:08 +0200 Subject: [PATCH] fix(pieces): placement ghost vanished off terrain for most stations Eleven pieces set m_groundPiece. Player.UpdatePlacementGhost switches the ghost off outright and returns whenever the aim is not on a Heightmap, which vanilla means for hoe and cultivator pieces. Floors, rocks and a troll cave's mesh floor are not a Heightmap, so players saw no ghost at all there, and with either flag Valheim never shows the blue placement marker. Reported for the Trol War Totem. m_groundPiece is off everywhere now. The stations (War Totem, Cursed Body Pile, Dvergar Bank, Rune Barrel, Pack Trough, Skadi Golem, Bone Servants) drop m_groundOnly too and go on floors, foundations and in caves, like the Bone Pile since 1.5.8. The living pieces (Furling bushes, Sverm nest and Hive Market, Trenta Elder Root) keep m_groundOnly: terrain only, and the ghost shows red elsewhere. --- JotunnModStub/Butler/BoneServant.cs | 8 ++++++-- JotunnModStub/Draugh/DraughSpawner.cs | 8 ++++++-- JotunnModStub/Dvergar/DvergarBanco.cs | 8 ++++++-- JotunnModStub/Dvergar/DvergarBotte.cs | 8 ++++++-- JotunnModStub/Fenrir/FenrirMangiatoia.cs | 8 ++++++-- JotunnModStub/Furling/FurlingCrops.cs | 5 ++++- JotunnModStub/Skadi/SkadiGolem.cs | 8 ++++++-- JotunnModStub/Sverm/SvermHive.cs | 5 ++++- JotunnModStub/Sverm/SvermHiveStore.cs | 5 ++++- JotunnModStub/Trenta/TrentaElderRoot.cs | 5 ++++- JotunnModStub/Trol/TrolTotem.cs | 8 ++++++-- 11 files changed, 58 insertions(+), 18 deletions(-) diff --git a/JotunnModStub/Butler/BoneServant.cs b/JotunnModStub/Butler/BoneServant.cs index 6126d1d..714016f 100644 --- a/JotunnModStub/Butler/BoneServant.cs +++ b/JotunnModStub/Butler/BoneServant.cs @@ -233,8 +233,12 @@ namespace RacesOfValheim piece.m_resources = new Piece.Requirement[0]; piece.m_name = displayName; piece.m_canBeRemoved = true; - piece.m_groundPiece = true; - piece.m_groundOnly = true; + // Neither flag, like the Bone Pile. m_groundPiece made Player.UpdatePlacementGhost switch + // the ghost off outright wherever the aim was not terrain - floors, rocks, a troll cave's + // mesh floor - so players saw no ghost at all and could not tell why. A station belongs + // in a house or a cave as much as outside. + piece.m_groundPiece = false; + piece.m_groundOnly = false; piece.m_icon = icon; Piece template = PrefabManager.Cache.GetPrefab("piece_workbench"); diff --git a/JotunnModStub/Draugh/DraughSpawner.cs b/JotunnModStub/Draugh/DraughSpawner.cs index a2604b2..61ea53d 100644 --- a/JotunnModStub/Draugh/DraughSpawner.cs +++ b/JotunnModStub/Draugh/DraughSpawner.cs @@ -251,8 +251,12 @@ namespace RacesOfValheim piece.m_resources = new Piece.Requirement[0]; piece.m_name = PieceDisplayName; piece.m_canBeRemoved = true; - piece.m_groundPiece = true; - piece.m_groundOnly = true; + // Neither flag, like the Bone Pile. m_groundPiece made Player.UpdatePlacementGhost switch + // the ghost off outright wherever the aim was not terrain - floors, rocks, a troll cave's + // mesh floor - so players saw no ghost at all and could not tell why. A station belongs + // in a house or a cave as much as outside. + piece.m_groundPiece = false; + piece.m_groundOnly = false; piece.m_icon = BorrowIcon(TrophyDraugr); // Learned on the Furling's bushes: a Piece added to world scenery is born with no icon diff --git a/JotunnModStub/Dvergar/DvergarBanco.cs b/JotunnModStub/Dvergar/DvergarBanco.cs index 34ab389..a912a2d 100644 --- a/JotunnModStub/Dvergar/DvergarBanco.cs +++ b/JotunnModStub/Dvergar/DvergarBanco.cs @@ -335,8 +335,12 @@ namespace RacesOfValheim piece.m_resources = new Piece.Requirement[0]; piece.m_name = PieceDisplayName; piece.m_canBeRemoved = true; - piece.m_groundPiece = true; - piece.m_groundOnly = true; + // Neither flag, like the Bone Pile. m_groundPiece made Player.UpdatePlacementGhost switch + // the ghost off outright wherever the aim was not terrain - floors, rocks, a troll cave's + // mesh floor - so players saw no ghost at all and could not tell why. A station belongs + // in a house or a cave as much as outside. + piece.m_groundPiece = false; + piece.m_groundOnly = false; piece.m_icon = BorrowIcon("TrophyDvergr"); Piece template = PrefabManager.Cache.GetPrefab("piece_workbench"); diff --git a/JotunnModStub/Dvergar/DvergarBotte.cs b/JotunnModStub/Dvergar/DvergarBotte.cs index e0a7953..69f30bf 100644 --- a/JotunnModStub/Dvergar/DvergarBotte.cs +++ b/JotunnModStub/Dvergar/DvergarBotte.cs @@ -90,8 +90,12 @@ namespace RacesOfValheim piece.m_resources = new Piece.Requirement[0]; piece.m_name = PieceDisplayName; piece.m_canBeRemoved = true; - piece.m_groundPiece = true; - piece.m_groundOnly = true; + // Neither flag, like the Bone Pile. m_groundPiece made Player.UpdatePlacementGhost switch + // the ghost off outright wherever the aim was not terrain - floors, rocks, a troll cave's + // mesh floor - so players saw no ghost at all and could not tell why. A station belongs + // in a house or a cave as much as outside. + piece.m_groundPiece = false; + piece.m_groundOnly = false; piece.m_icon = BorrowIcon("MeadHealthMinor") ?? BorrowIcon("TrophyDvergr"); Piece template = PrefabManager.Cache.GetPrefab("piece_workbench"); diff --git a/JotunnModStub/Fenrir/FenrirMangiatoia.cs b/JotunnModStub/Fenrir/FenrirMangiatoia.cs index 8280607..93e2e67 100644 --- a/JotunnModStub/Fenrir/FenrirMangiatoia.cs +++ b/JotunnModStub/Fenrir/FenrirMangiatoia.cs @@ -326,8 +326,12 @@ namespace RacesOfValheim piece.m_resources = new Piece.Requirement[0]; piece.m_name = PieceDisplayName; piece.m_canBeRemoved = true; - piece.m_groundPiece = true; - piece.m_groundOnly = true; + // Neither flag, like the Bone Pile. m_groundPiece made Player.UpdatePlacementGhost switch + // the ghost off outright wherever the aim was not terrain - floors, rocks, a troll cave's + // mesh floor - so players saw no ghost at all and could not tell why. A station belongs + // in a house or a cave as much as outside. + piece.m_groundPiece = false; + piece.m_groundOnly = false; piece.m_icon = BorrowIcon("TrophyFenring"); Piece template = PrefabManager.Cache.GetPrefab("piece_workbench"); diff --git a/JotunnModStub/Furling/FurlingCrops.cs b/JotunnModStub/Furling/FurlingCrops.cs index 79cf5c9..4a55b8b 100644 --- a/JotunnModStub/Furling/FurlingCrops.cs +++ b/JotunnModStub/Furling/FurlingCrops.cs @@ -381,7 +381,10 @@ namespace RacesOfValheim piece.m_craftingStation = null; piece.m_resources = new Piece.Requirement[0]; piece.m_canBeRemoved = true; - piece.m_groundPiece = true; + // Terrain only, as a living thing should be - but through m_groundOnly alone, which shows + // the ghost red off the terrain. m_groundPiece switched the ghost off outright there + // (Player.UpdatePlacementGhost), and players saw nothing at all. + piece.m_groundPiece = false; piece.m_groundOnly = true; piece.m_cultivatedGroundOnly = false; // a bush of rocks does not want tilled soil piece.m_icon = BorrowIcon(berry.YieldPrefab); diff --git a/JotunnModStub/Skadi/SkadiGolem.cs b/JotunnModStub/Skadi/SkadiGolem.cs index 99fca6a..1f14080 100644 --- a/JotunnModStub/Skadi/SkadiGolem.cs +++ b/JotunnModStub/Skadi/SkadiGolem.cs @@ -264,8 +264,12 @@ namespace RacesOfValheim piece.m_resources = new Piece.Requirement[0]; piece.m_name = DisplayName; piece.m_canBeRemoved = true; - piece.m_groundPiece = true; - piece.m_groundOnly = true; + // Neither flag, like the Bone Pile. m_groundPiece made Player.UpdatePlacementGhost switch + // the ghost off outright wherever the aim was not terrain - floors, rocks, a troll cave's + // mesh floor - so players saw no ghost at all and could not tell why. A station belongs + // in a house or a cave as much as outside. + piece.m_groundPiece = false; + piece.m_groundOnly = false; piece.m_icon = BorrowIcon(CrystalItem); PieceManager.Instance.AddPiece(new CustomPiece(prefab, fixReference: false, new PieceConfig diff --git a/JotunnModStub/Sverm/SvermHive.cs b/JotunnModStub/Sverm/SvermHive.cs index cc30a09..6116fab 100644 --- a/JotunnModStub/Sverm/SvermHive.cs +++ b/JotunnModStub/Sverm/SvermHive.cs @@ -96,7 +96,10 @@ namespace RacesOfValheim Piece piece = prefab.GetComponent() ?? prefab.AddComponent(); piece.m_name = DisplayName; piece.m_description = "$rov_piece_sverm_broodmound_desc"; - piece.m_groundPiece = true; + // Terrain only, as a living thing should be - but through m_groundOnly alone, which shows + // the ghost red off the terrain. m_groundPiece switched the ghost off outright there + // (Player.UpdatePlacementGhost), and players saw nothing at all. + piece.m_groundPiece = false; piece.m_groundOnly = true; piece.m_cultivatedGroundOnly = false; piece.m_canBeRemoved = true; diff --git a/JotunnModStub/Sverm/SvermHiveStore.cs b/JotunnModStub/Sverm/SvermHiveStore.cs index ef96cc7..0699fda 100644 --- a/JotunnModStub/Sverm/SvermHiveStore.cs +++ b/JotunnModStub/Sverm/SvermHiveStore.cs @@ -324,7 +324,10 @@ namespace RacesOfValheim piece.m_resources = new Piece.Requirement[0]; piece.m_name = DisplayName; piece.m_description = "$rov_piece_sverm_hivemarket_desc"; - piece.m_groundPiece = true; + // Terrain only, as a living thing should be - but through m_groundOnly alone, which shows + // the ghost red off the terrain. m_groundPiece switched the ghost off outright there + // (Player.UpdatePlacementGhost), and players saw nothing at all. + piece.m_groundPiece = false; piece.m_groundOnly = true; piece.m_canBeRemoved = true; diff --git a/JotunnModStub/Trenta/TrentaElderRoot.cs b/JotunnModStub/Trenta/TrentaElderRoot.cs index ba21936..8e8e421 100644 --- a/JotunnModStub/Trenta/TrentaElderRoot.cs +++ b/JotunnModStub/Trenta/TrentaElderRoot.cs @@ -83,7 +83,10 @@ namespace RacesOfValheim piece.m_resources = new Piece.Requirement[0]; piece.m_name = TrentaConfig.ElderRootDisplayName; piece.m_canBeRemoved = true; - piece.m_groundPiece = true; + // Terrain only, as a living thing should be - but through m_groundOnly alone, which shows + // the ghost red off the terrain. m_groundPiece switched the ghost off outright there + // (Player.UpdatePlacementGhost), and players saw nothing at all. + piece.m_groundPiece = false; piece.m_groundOnly = true; piece.m_icon = icon; diff --git a/JotunnModStub/Trol/TrolTotem.cs b/JotunnModStub/Trol/TrolTotem.cs index 99f94c9..5bd38f8 100644 --- a/JotunnModStub/Trol/TrolTotem.cs +++ b/JotunnModStub/Trol/TrolTotem.cs @@ -303,8 +303,12 @@ namespace RacesOfValheim piece.m_resources = new Piece.Requirement[0]; piece.m_name = PieceDisplayName; piece.m_canBeRemoved = true; - piece.m_groundPiece = true; - piece.m_groundOnly = true; + // Neither flag, like the Bone Pile. m_groundPiece made Player.UpdatePlacementGhost switch + // the ghost off outright wherever the aim was not terrain - floors, rocks, a troll cave's + // mesh floor - so players saw no ghost at all and could not tell why. A station belongs + // in a house or a cave as much as outside. + piece.m_groundPiece = false; + piece.m_groundOnly = false; piece.m_icon = BorrowIcon(TrollHead); Piece template = PrefabManager.Cache.GetPrefab("piece_workbench");