segabl / pd2-useful-bots

A lightweight bot overhaul
GNU General Public License v3.0
8 stars 6 forks source link

teamailogicbase.lua crash #9

Closed ghost closed 1 year ago

ghost commented 1 year ago

Occurred on Election Day - Plan C in twice in a row.

Crash Logs:

----------------------------------------------------------------------

Sat Jan 07 22:36:13 2023

Application has crashed: C++ exception
mods/pd2-useful-bots-master/lua/teamailogicbase.lua:13: attempt to index a nil value

SCRIPT STACK

_set_attention_obj() @mods/base/req/core/Hooks.lua:294
clbk() lib/units/player_team/logics/teamailogictravel.lua:199
_execute_queued_task() lib/managers/enemymanager.lua:600
_update_queued_tasks() lib/managers/enemymanager.lua:615
update() lib/managers/enemymanager.lua:52
update() lib/setups/gamesetup.lua:809
update() lib/setups/networkgamesetup.lua:21
original() core/lib/setups/coresetup.lua:559
@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                                     

-------------------------------

Current thread: Main

-------------------------------

System information:
    Application version : 1.134.165
    CPU : 12th Gen Intel(R) Core(TM) i7-12700K (10 cores); SSE; SSE2; SSE3; SSSE3; SSE4.1; SSE4.2
    DirectX : 12.0 
    GPU : NVIDIA GeForce RTX 3070 Ti / nvldumd.dll[31.0.15.2756]
    Language : english
    Memory :     32538MB 116KB
    OS : 6.2.9200 () 0x300-0x1 (64 bits)
    Physics : threaded
    Renderer : DX9 threaded
    Sound : Razer Inc. (Headphones (Razer Nari - Game))
----------------------------------------------------------------------

Sat Jan 07 22:55:16 2023

Application has crashed: C++ exception
mods/pd2-useful-bots-master/lua/teamailogicbase.lua:13: attempt to index a nil value

SCRIPT STACK

_set_attention_obj() @mods/base/req/core/Hooks.lua:294
clbk() lib/units/player_team/logics/teamailogictravel.lua:199
_execute_queued_task() lib/managers/enemymanager.lua:600
_update_queued_tasks() lib/managers/enemymanager.lua:615
update() lib/managers/enemymanager.lua:52
update() lib/setups/gamesetup.lua:809
update() lib/setups/networkgamesetup.lua:21
original() core/lib/setups/coresetup.lua:559
@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                                     

-------------------------------

Current thread: Main

-------------------------------

System information:
    Application version : 1.134.165
    CPU : 12th Gen Intel(R) Core(TM) i7-12700K (10 cores); SSE; SSE2; SSE3; SSSE3; SSE4.1; SSE4.2
    DirectX : 12.0 
    GPU : NVIDIA GeForce RTX 3070 Ti / nvldumd.dll[31.0.15.2756]
    Language : english
    Memory :     32538MB 116KB
    OS : 6.2.9200 () 0x300-0x1 (64 bits)
    Physics : threaded
    Renderer : DX9 threaded
    Sound : Razer Inc. (Headphones (Razer Nari - Game))
ghost commented 1 year ago

From the comments inside teamailogicbase.lua I'm guessing the crash has either something to do with marking the snipers on the balcony across from the vault or just having the game crash whenever the bots attempt to dominate an enemy. As they mark any other enemies just fine, it doesn't feel like that would cause the crash.

I've noticed though when trying to recreate this crash it was seemingly impossible to get the bots to assist me with dominating a cop. They would acknowledge him and stop shooting, but they wouldn't do anything else, even when the room was empty besides that cop. I've managed to get the crash to happen once more when one of the bots came to a cop with his hands up while running, so I assume the bot finally managed to shout at him but through that caused the crash. The resulting crash log looks exactly the same as the two I've already sent.

I've spent over an hour trying to recreate this a second time in two different heists, but to no avail. Something's wrong with their domination code in general, since they are really unwilling to help dominate enemies, even with the domination target priority set to max.

On a side note, I first mistook the problematic lua to be teamaibase.lua due to the similar name, so I deleted the file to see if it would help as it seemed to me that what it does wasn't completely necessary for me. Without that file, I haven't encountered the crash on the next attempt. This isn't any solid evidence due to the problems with getting them to do either action I suspected behind the crash, but I thought I should note it.

segabl commented 1 year ago

Some bot attention object that wasn't an enemy or civilian most likely caused this though I'm not sure what that could be, maybe it's election day specific. Regardless, the faulty check has been fixed now. Regarding your domination issue, that might be due to your target settings in the mod options, I did forget to explain dominating only works with either weapon stats or distance setting.

ghost commented 1 year ago

Yeah, that domination issue was because I used the "no changes" setting.