Having an issue where whenever I load into a new Instance (Psykhanium or Mission) the crit indicator gets offset to the right and is set back to centre as soon as i move the horizontal offset at all and set it back to 0 its back to normal until the next load into a new mission, tried downgrading and updating to the newest release, tried setting back to defaults or using a fresh install of the mod but It consistently gets offset
I think I have the same problem. Everytime I launch Darktide, the first game I have the crit indicator out of place (X offset only, Y is correct). So I have to go to settings, move the X Offset bar (I put it in the same value as before), to fix the position. It stays in the same place for all games until I close Darktide.
Great mod! Any chance you can add "Show lucky chance" too, for the Ogryns? there're couple things affecting lucky chance, and one of those buffs keep disappearing from screen constantly.
Changing the code in the file hud_element_crit.lua starting from line 172:
From:if mod._guaranteed_crit then mod._current_crit_chance = 1.0 else mod._current_crit_chance = CriticalStrike.chance(mod._player, mod._weapon_handling_template, mod._is_ranged, mod._is_melee) end
To: if mod._guaranteed_crit then mod._current_crit_chance = 1.0 elseif (ScriptUnit.extension(mod._player.player_unit, "buff_system") ~= nil) then mod._current_crit_chance = CriticalStrike.chance(mod._player, mod._weapon_handling_template, mod._is_ranged, mod._is_melee) end
Explanation: CriticalStrike.chance is accessing the players buff_extension, which doesn't exist in certain situations. Most likely the game code itself simply doesn't call strike chance when the player is dead. I think the main problem is the player not having a unit at all for a while. So there is no buff_extension either.
Should prevent the crash, I think. I quickly tested it with 1.12 and seems to work.
great mod, super helpful for testing builds. if possible, can u make it compatible with customhud as a toggleable element? from what i can tell, the visibility of the indicator is tied to the visibility of PlayerWeapon hud element. when i hide PlayerWeapon it also hides the crit indicator. not a super big issue, but i prefer having PlayerWeapon hidden since i use a crosshair hud for that instead. it'd also be easier to move the indicator through customhud rather than the sliders in the mod menu. nonetheless excellent work!
I can confirm that it is tied to visibility of PlayerWeapon hud element as OP said.
I think it either has to be its separate entity from this hud element or be compatible with crosshair hud. Preferably both if possible.
I play a full crit build and its unfortunate that I will not be using this because the UI of PlayerWeapon is simply huge and creates way too much clutter.
So i used custom hud, clicked on the according hud element for the vanilla weapon/grenade ui and with the arrow keys i threw it all the way out of the screen. The caveat is i don't know how to bring it back without deleting user.config. I don't mind anyway as i use custom crosshair hud and have all my elements on the center of my screen.
My workaround was to use HUD Tweaker and disable the visibility on pretty much everything under HudElementPlayerWeapon except for crit_chance_indicator.
Heya! If you have some time, could you add Riposte to the list of buffs the addon tracks? It does show up in the UI when it procs, so it should be trackable. Thank you :)
I love this mod so much, however I notice the base crit chance is always 5% even with weapons that have crit bonus such as tactical axes, is this like the real stat or an oversight?
Again, fantastic mod I couldn't play Darktide without this one and the dodge counter.
Vet and Zealot have a base crit chance of 5%; Psykers has 7.5%; and Ogyrns has 2.5%. It seems the game doesn't add extra crit from other sources until just before the first strike.
43 comments
Any chance you can add "Show lucky chance" too, for the Ogryns? there're couple things affecting lucky chance, and one of those buffs keep disappearing from screen constantly.
[string "./../mods/show_crit_chance/scripts/mods/show_..."]:147: Cannot access property "profile" on destroyed object of type BotPlayer
Scratch that, I made a boo boo
From:
if mod._guaranteed_crit then
mod._current_crit_chance = 1.0
else
mod._current_crit_chance = CriticalStrike.chance(mod._player, mod._weapon_handling_template, mod._is_ranged, mod._is_melee)
end
To:
if mod._guaranteed_crit then
mod._current_crit_chance = 1.0
elseif (ScriptUnit.extension(mod._player.player_unit, "buff_system") ~= nil) then
mod._current_crit_chance = CriticalStrike.chance(mod._player, mod._weapon_handling_template, mod._is_ranged, mod._is_melee)
end
Explanation:
CriticalStrike.chance is accessing the players buff_extension, which doesn't exist in certain situations.
Most likely the game code itself simply doesn't call strike chance when the player is dead.
I think the main problem is the player not having a unit at all for a while.
So there is no buff_extension either.
Should prevent the crash, I think.
I quickly tested it with 1.12 and seems to work.
Thank you for suggesting this change. I incorporated it in v1.1.3.
I think it crashes when you die and then some buff extension is nil.
I think it either has to be its separate entity from this hud element or be compatible with crosshair hud. Preferably both if possible.
I play a full crit build and its unfortunate that I will not be using this because the UI of PlayerWeapon is simply huge and creates way too much clutter.
hope we get a feature that fixes this issue :)
Version 1.1.0 should fix it. Please update your mod files and check, if it still occurs.
Version 1.1.0 should fix it. Please update your mod files and check, if it still occurs.
Again, fantastic mod I couldn't play Darktide without this one and the dodge counter.