From 87d0f2642c98894fdae50d9083eb97a8d74fbc92 Mon Sep 17 00:00:00 2001 From: kanym Date: Sat, 17 Oct 2026 15:51:53 +0200 Subject: [PATCH] fix(texts): four messages showed as [msg_...] Four tokens the mod printed exist in no vanilla table (checked on Valheim 1.0.20) and were never registered by the mod, so players saw the raw name in brackets. - $msg_eatanother (Trol, a food still being digested): vanilla's $msg_nomore, "You can't eat more $1", called as Player.CanEat calls it. - $msg_canteatanymore (Trol, every stomach full): vanilla's $msg_isfull. - $msg_ate (Aswid, Vae Victis): vanilla's $msg_consumed. - $msg_notenoughmoney (Dvergar bank, Trol totem): a new mod text, rov_msg_not_enough_coins, in English, Italian and Russian. --- JotunnModStub/Aswid/AswidRace.cs | 3 ++- JotunnModStub/Dvergar/DvergarBancoBehaviour.cs | 2 +- JotunnModStub/Translations/English/messages.json | 1 + JotunnModStub/Translations/Italian/messages.json | 1 + JotunnModStub/Translations/Russian/messages.json | 1 + JotunnModStub/Trol/TrolFoodPatches.cs | 10 ++++++---- JotunnModStub/Trol/TrolTotemBehaviour.cs | 2 +- 7 files changed, 13 insertions(+), 7 deletions(-) diff --git a/JotunnModStub/Aswid/AswidRace.cs b/JotunnModStub/Aswid/AswidRace.cs index b95daff..fb949a3 100644 --- a/JotunnModStub/Aswid/AswidRace.cs +++ b/JotunnModStub/Aswid/AswidRace.cs @@ -1258,7 +1258,8 @@ namespace RacesOfValheim { // Show the Vae Victis message in the center of the screen Player.m_localPlayer.Message(MessageHud.MessageType.Center, ModText.Get("rov_msg_aswid_vae_victis")); - Player.m_localPlayer.Message(MessageHud.MessageType.TopLeft, "$msg_ate " + addedItem.m_shared.m_name); + // "$msg_ate" exists in no vanilla table and players saw [msg_ate]; vanilla's "Consumed" reads the same. + Player.m_localPlayer.Message(MessageHud.MessageType.TopLeft, "$msg_consumed " + addedItem.m_shared.m_name); // Vae Victis XP logic - similar to Dead Raiser Player.m_localPlayer.RaiseSkill(Skills.SkillType.BloodMagic, 1f); diff --git a/JotunnModStub/Dvergar/DvergarBancoBehaviour.cs b/JotunnModStub/Dvergar/DvergarBancoBehaviour.cs index 444b065..fcdd94d 100644 --- a/JotunnModStub/Dvergar/DvergarBancoBehaviour.cs +++ b/JotunnModStub/Dvergar/DvergarBancoBehaviour.cs @@ -157,7 +157,7 @@ namespace RacesOfValheim if (CountCoins(inventory) < price) { - player.Message(MessageHud.MessageType.Center, "$msg_notenoughmoney"); + player.Message(MessageHud.MessageType.Center, ModText.Get("rov_msg_not_enough_coins")); return; } diff --git a/JotunnModStub/Translations/English/messages.json b/JotunnModStub/Translations/English/messages.json index 6e6ee1e..8f7c7fa 100644 --- a/JotunnModStub/Translations/English/messages.json +++ b/JotunnModStub/Translations/English/messages.json @@ -106,6 +106,7 @@ "rov_msg_fenrir_trough_takes_line_runs_deeper": "The trough takes it. The line runs deeper now.", "rov_msg_fenrir_wants_meat_any_meat": "It wants meat. Any meat.", "rov_msg_fenrir_wants_what_yagluth_left_behind": "It wants what Yagluth left behind.", + "rov_msg_not_enough_coins": "Not enough coins", "rov_msg_skadi_are_drake": "You are a Drake!", "rov_msg_skadi_are_fader": "You are Fader!", "rov_msg_skadi_are_moder": "You are Moder!", diff --git a/JotunnModStub/Translations/Italian/messages.json b/JotunnModStub/Translations/Italian/messages.json index 6d3cb6f..f0e20bb 100644 --- a/JotunnModStub/Translations/Italian/messages.json +++ b/JotunnModStub/Translations/Italian/messages.json @@ -106,6 +106,7 @@ "rov_msg_fenrir_trough_takes_line_runs_deeper": "La mangiatoia lo accetta. Ora la discendenza va più a fondo.", "rov_msg_fenrir_wants_meat_any_meat": "Vuole carne. Qualsiasi carne.", "rov_msg_fenrir_wants_what_yagluth_left_behind": "Vuole ciò che Yagluth ha lasciato.", + "rov_msg_not_enough_coins": "Monete insufficienti", "rov_msg_skadi_are_drake": "Sei un Drake!", "rov_msg_skadi_are_fader": "Sei Fader!", "rov_msg_skadi_are_moder": "Sei Moder!", diff --git a/JotunnModStub/Translations/Russian/messages.json b/JotunnModStub/Translations/Russian/messages.json index 2e70a33..3ef6918 100644 --- a/JotunnModStub/Translations/Russian/messages.json +++ b/JotunnModStub/Translations/Russian/messages.json @@ -106,6 +106,7 @@ "rov_msg_fenrir_trough_takes_line_runs_deeper": "Кормушка принимает жертву. Родословная стаи крепнет.", "rov_msg_fenrir_wants_meat_any_meat": "Требуется мясо. Любое мясо.", "rov_msg_fenrir_wants_what_yagluth_left_behind": "Требуется то, что осталось после падения Яглута.", + "rov_msg_not_enough_coins": "Недостаточно монет", "rov_msg_skadi_are_drake": "Вы — Дрейк!", "rov_msg_skadi_are_fader": "Вы — Прародитель!", "rov_msg_skadi_are_moder": "Вы — Матерь!", diff --git a/JotunnModStub/Trol/TrolFoodPatches.cs b/JotunnModStub/Trol/TrolFoodPatches.cs index b0d452d..97232bb 100644 --- a/JotunnModStub/Trol/TrolFoodPatches.cs +++ b/JotunnModStub/Trol/TrolFoodPatches.cs @@ -90,7 +90,7 @@ namespace RacesOfValheim if (f.m_item.m_shared.m_name != item.m_shared.m_name) continue; if (f.CanEatAgain()) return true; - __instance.Message(MessageHud.MessageType.Center, "$msg_eatanother"); + __instance.Message(MessageHud.MessageType.Center, Localization.instance.Localize("$msg_nomore", item.m_shared.m_name)); __result = false; return false; } @@ -110,12 +110,12 @@ namespace RacesOfValheim if (has4 && food4.m_item.m_shared.m_name == item.m_shared.m_name) { if (canEat4) { TrolFoodManager.SetExtraFood(__instance, item); ConsumeItemEffect(__instance, item); __result = true; return false; } - else { __instance.Message(MessageHud.MessageType.Center, "$msg_eatanother"); __result = false; return false; } + else { __instance.Message(MessageHud.MessageType.Center, Localization.instance.Localize("$msg_nomore", item.m_shared.m_name)); __result = false; return false; } } if (has5 && food5.m_item.m_shared.m_name == item.m_shared.m_name) { if (state5 && canEat5) { TrolFoodManager.SetExtraFood5(__instance, item); ConsumeItemEffect(__instance, item); __result = true; return false; } - else { __instance.Message(MessageHud.MessageType.Center, "$msg_eatanother"); __result = false; return false; } + else { __instance.Message(MessageHud.MessageType.Center, Localization.instance.Localize("$msg_nomore", item.m_shared.m_name)); __result = false; return false; } } // 3. A free vanilla slot takes it the vanilla way. @@ -137,7 +137,9 @@ namespace RacesOfValheim return false; } - __instance.Message(MessageHud.MessageType.Center, "$msg_canteatanymore"); + // Vanilla's own "You are full already", the line Player.CanEat shows for a full stomach. + // "$msg_canteatanymore" was never a vanilla token, so players saw [msg_canteatanymore]. + __instance.Message(MessageHud.MessageType.Center, "$msg_isfull"); __result = false; return false; } diff --git a/JotunnModStub/Trol/TrolTotemBehaviour.cs b/JotunnModStub/Trol/TrolTotemBehaviour.cs index cf040b6..d43f028 100644 --- a/JotunnModStub/Trol/TrolTotemBehaviour.cs +++ b/JotunnModStub/Trol/TrolTotemBehaviour.cs @@ -157,7 +157,7 @@ namespace RacesOfValheim if (CountCoins(inventory) < troop.Price) { - player.Message(MessageHud.MessageType.Center, "$msg_notenoughmoney"); + player.Message(MessageHud.MessageType.Center, ModText.Get("rov_msg_not_enough_coins")); return; }