Banner
Advanced Crosshairs, Hitmarkers, and Hitsounds (ACH)
Thumbnail
608
Downloads113,990
Views221,146
Publish Date5 years ago
Last Updated1 year ago by
Version40
Repository URL Link
Tags
Avatar

Crashes due to killsounds playing when a damageable NPC dies to fire damage when playing with Irenfist?
It seems to be specifically the hitsound part. Game runs fine without hitsounds but enabling them just bricks the game and crashes it when a killsound plays upon a burning NPC dies. It's not that the hitsounds aren't present, either. All of my selected hitsounds are contained in the ACH Addons/Hitsounds folder.

Spoiler!

Application has crashed: C++ exception
[string "lib/units/enemies/cop/copdamage.lua"]:2277: attempt to perform arithmetic on local 'damage' (a nil value)

SCRIPT STACK

advanced_crosshairs_did_not_crash_you() @mods/PD2-AdvancedCrosshairs/lua/copdamage.lua:11
Run() @mods/PD2-AdvancedCrosshairs/lua/copdamage.lua:11
orig_roll_crit() @mods/PocoHud3/poco/../poco/Hud3.lua:4813
roll_critical_hit() @mods/PD2-AdvancedCrosshairs/lua/menumanager.lua:1909
damage_fire_original() @mods/IRE AND FIST REBORN/lua/copdamage.lua:286
damage_fire() @mods/IRE AND FIST REBORN/lua/copdamage.lua:332
give_fire_damage() lib/units/weapons/raycastweaponbase.lua:2845
original() lib/units/weapons/raycastweaponbase.lua:2793
on_collision() @mods/base/req/core/Hooks.lua:288
_fire_raycast() @mods/IRE AND FIST REBORN/lua/newshotgun.lua:242
original_fire() @mods/IRE AND FIST REBORN/lua/raycast.lua:300
fire_original() @mods/IRE AND FIST REBORN/lua/raycast.lua:328
fire_original() @mods/VanillaHUD Plus/lua/BurstFire.lua:64
fire_original2() @mods/IRE AND FIST REBORN/lua/BurstFire.lua:145
fire() @mods/IRE AND FIST REBORN/lua/newshotgun.lua:447
trigger_pressed() lib/units/weapons/raycastweaponbase.lua:413
original() @mods/IRE AND FIST REBORN/lua/playerstandard.lua:1191
Run() @mods/base/req/core/Hooks.lua:288
_check_action_primary_attack() @mods/PocoHud3/poco/../poco/Hud3.lua:1842
original() lib/units/beings/player/states/playerstandard.lua:962
_update_check_actions() @mods/base/req/core/Hooks.lua:288
update_original() lib/units/beings/player/states/playerstandard.lua:441
update_original() @mods/VanillaHUD Plus/lua/BurstFire.lua:302
original() @mods/VanillaHUD Plus/lua/VanillaHUD.lua:981
saw_original_playerstandard_update() @mods/base/req/core/Hooks.lua:288
update_original() @mods/Saw Helper/lua/playerstandard.lua:39
update() @mods/IRE AND FIST REBORN/lua/BurstFire.lua:350
original() lib/units/beings/player/playermovement.lua:279
@mods/base/req/core/Hooks.lua:288

Avatar

ACH is not responsible for this crash. The call from "PD2-AdvancedCrosshairs" appears at the top of the script stack because it is written to call the original code (whether defined from the game's source code or from another mod), but it does not modify that code or the outcome in any meaningful way, so it's not possible for it to have caused the crash described in this particular crash log. One of your multiple gameplay-changing mods or HUD mods is likely the culprit. You can see that quite a few other mods run code here- I suggest looking through those; IREnFIST would be my bet.
Just in case this was the wrong crash log, however, I did attempt to replicate the crash anyway under the circumstances you described- killing an NPC with fire damage over time- and unfortunately, I could not find any issues. Please let me know if you get a different crash log that points to ACH, or gain more information about this issue.
Thanks for the report!

Avatar

@Offyerrocker Did you try replicating with Irenfist loaded? It doesn't change enough to require changing an entire save file in order to load it, so anything you have in a vanilla save will be completely fine. It occurs specifically when a killsound plays after a burning NPC's death with Irenfist loaded. Sometimes it even occurs when a hitsound plays on a burning NPC, though it could've just been said enemy NPC to a crit or something.
Irenfist, ACH, VH Plus, Saw Helper, but NO Pocohud: Crashed
Irenfist, ACH, Pocohud, Saw Helper, but NO VH Plus: Crashed
Irenfist, ACH, Pocohud, VH Plus, but NO Saw Helper: Crashed
Irenfist, ACH, but NO Pocohud, VH Plus OR Saw Helper: Crashed

Here's the crash for the test with only Irenfist and ACH:

Spoiler!

Application has crashed: C++ exception
[string "lib/units/enemies/cop/copdamage.lua"]:2277: attempt to perform arithmetic on local 'damage' (a nil value)

SCRIPT STACK

advanced_crosshairs_did_not_crash_you() @mods/PD2-AdvancedCrosshairs/lua/copdamage.lua:11
orig_roll_crit() @mods/PD2-AdvancedCrosshairs/lua/copdamage.lua:11
roll_critical_hit() @mods/PD2-AdvancedCrosshairs/lua/menumanager.lua:1909
damage_fire() @mods/IRE AND FIST REBORN/lua/copdamage.lua:286
give_fire_damage() lib/units/weapons/raycastweaponbase.lua:2845
original() lib/units/weapons/raycastweaponbase.lua:2793
on_collision() @mods/base/req/core/Hooks.lua:288
_fire_raycast() @mods/IRE AND FIST REBORN/lua/newshotgun.lua:242
original_fire() @mods/IRE AND FIST REBORN/lua/raycast.lua:300
fire_original() @mods/IRE AND FIST REBORN/lua/raycast.lua:328
fire_original2() @mods/IRE AND FIST REBORN/lua/BurstFire.lua:145
fire() @mods/IRE AND FIST REBORN/lua/newshotgun.lua:447
trigger_pressed() lib/units/weapons/raycastweaponbase.lua:413
original() @mods/IRE AND FIST REBORN/lua/playerstandard.lua:1191
_check_action_primary_attack() @mods/base/req/core/Hooks.lua:288
original() lib/units/beings/player/states/playerstandard.lua:962
_update_check_actions() @mods/base/req/core/Hooks.lua:288
original() lib/units/beings/player/states/playerstandard.lua:441
update_original() @mods/base/req/core/Hooks.lua:288
update() @mods/IRE AND FIST REBORN/lua/BurstFire.lua:350
original() lib/units/beings/player/playermovement.lua:279
@mods/base/req/core/Hooks.lua:288


Callstack:

     payday2_win32_release  (???)     ???                                                 
     payday2_win32_release  (???)     ???                                                 
     payday2_win32_release  (???)     ???                                                 
     payday2_win32_release  (???)     zip_get_name                                        
                     ntdll  (???)     RtlAllocateHeap        

The interaction causing the crash seems to be exclusively between ACH and Irenfist. Now don't get me wrong, I could easily just play with one mod and not the other, or just not use fire weapons whatsoever, but I'm still going to post this here because Rokk (Irenfist's author) seems to be radiosilent, though ModWorkshop does say their last visit was only 17 days ago.

Avatar

@gibus
Thanks for the additional testing, but like I said, IreNFist itself was the main suspect, and none of your tests seem to have involved a case with IreNFist disabled. This crash is explicitly caused by IreNFist. ACH is not responsible for this crash.
In Update 219 (9 Mar 2022), OVK changed the signature for the function CopDamage:roll_critical_hit() to require a second argument, which is the attack's damage. The function performs arithmetic on this damage value to produce the critical hit damage. (copdamage, line 2092)
IreNFist was last updated on 16 Jul 2021. Its code relating to allowing critical hits on fire damage (compare the above to IreNFist's copdamage, line 291: https://github.com/HugoZink/IreNFist/blob/master/IRE AND FIST REBORN/lua/copdamage.lua (link won't parse since it has a space in it) ) has not yet been updated to accommodate for this change.
This causes the error visible in the callstack, which points to the PAYDAY 2's own source code: [string "lib/units/enemies/cop/copdamage.lua"]:2277: attempt to perform arithmetic on local 'damage' (a nil value)

I do sincerely appreciate the effort you took in performing multiple test cases to try to narrow down the cause, however.

Avatar

@Offyerrocker You're right. As thorough as I was I guess I wasn't enough. Just tested to see if, with Irenfist loaded, a crit kill with fire causes the crash and, aligning with your findings, indeed it did. Well at least now I know that Irenfist is indeed the only culprit. My only question now I guess is why did OVK change how crits work? Was it for the addition of Yufu Wang?

Avatar

@gibus In anticipation of the future weapon dlcs seems likely, but your guess is as good as mine.

35 1021