Jump to content
  • ArgumentNullException when buff from my mod expires


    Byteblazar
    • Version: V1.0 b328

    Summary: Game consistently throws ArgumentNullException whenever a specific buff from my mod expires.

    Game Version: V1.0 b328

    OS/Version: Microsoft Windows 10 Pro 10.0.19045 Build 19045

    CPU Model: Intel Core i3-10105F

    System Memory: 32 GB

    GPU Model and VRAM: nVidia GTX 1650 4 GB

    Screen Resolution: 1680x1050

    Video Settings: Custom

    Game mode: SP
    Map: Navezgane
    Did you wipe old saves? Yes

    Did you start a new game? Yes

    Did you validate your files? Yes

    Are you using any mods? Yes
    Did you try to reproduce without mods? No

    EAC on or off? Off

     

    Bug Description:

    The game consistently throws ArgumentNullException in a seemingly infinite loop whenever a specific buff from my mod 7 Days of Insomnia (v1.0.0.0b) expires, regardless of it expiring due to time running out and triggering a RemoveBuff, or by removing the buff from the console with the debuff command. The buff icon never disappears from the HUD, but the display_value does. Upon closing the game (with alt+F4), starting it again, and loading the same save, the loop triggers again but this time it does so immediately, without any input. The HUD continues to display the buff icon just as before without a display_value. The only way to resolve the issue seems to be starting a new save, but the same problem occurs in the new save the moment that specific buff expires, regardless of the map chosen. One user of my mod reported experiencing the same issue with the same buff.

     

    Detailed steps to reproduce the bug:

    1) Launch the game.

    2) Start a new game in Navezgane.

    3) Enter this console command after the character loads into the world:

    buff bb7doi_buffinsomnia

    4) Wait for 1 to 10 seconds.

    5) Enter this console command:

    debuff bb7doi_buffinsomnia

     

    Actual result: (description of what is occurring)

    Console shows ArgumentNullException repeatedly nonstop.

     

    Expected result: (what you expect to occur)
    Buff is removed from character.


    Link to Pastebin Output Log: https://pastebin.com/raw/pP5mFM1P

     


    User Feedback

    Recommended Comments

    Hi there,

    What's the last version this buff worked properly on? I'll need to see if anything changed with how we process buffs between then and now.

    Thanks!

    Link to comment
    Share on other sites

    Hello,

     

    I'm not entirely sure about the last version this buff worked properly on because of the unfortunate timing for me to work on that buff before releasing the mod, and your frequent hotfixes and whatnot. I released the mod on the 21st and you guys pushed 3 patches on that day I believe.

     

    I wish I could roll back and test myself to give a more helpful reply, but my best guess is b317 was the last one where it worked correctly.

     

    Good luck and keep it up folks!

    Link to comment
    Share on other sites

    Looking at my logs, I feel like b325 might have been ok. I can't be 100% sure because I wasn't testing that buff the whole time (and it does not trigger regularly to begin with), but hopefully that helps you narrow things down.

    Link to comment
    Share on other sites

    I finally got around to doing some more troubleshooting/testing and I've narrowed down the culprit (as far as the XML is involved):

    <triggered_effect trigger="onSelfBuffUpdate" action="RemoveBuff" buff="bb7doi_buffInsomnia">
      <requirement name="CVarCompare" cvar="$bb7doiInsomniaCounter" operation="LTE" value="0"/>
    </triggered_effect>
    <!-- The following triggers the error with or without requirement child nodes and whether it comes first or last in the effect group-->
    <triggered_effect trigger="onSelfBuffRemove" action="ModifyCVar" buff="$bb7doiInsomniaCounter" operation="set" value="0">
      <requirement name="CVarCompare" cvar="$bb7doiInsomniaCounter" operation="NotEquals" value="0"/>
    </triggered_effect>

     

    This means I've find a workaround for my mod, but I'm sharing this because the underlying issue remains (correct me if I'm wrong but I see no reason why this should break the game).

     

    Anyway, I hope that helps.

    Link to comment
    Share on other sites

    I must have been too sleepy, ironically. I presume using a buff parameter for trying to set a cvar is what triggered this:

    action="ModifyCVar" buff="$bb7doiInsomniaCounter" operation="set" value="0"

    ... but in my absolutely not vast experience messing up like this while modding this game, normally such minor mistakes result in less catastrophic errors that are handled more gracefully (like null reference exceptions, etc). I hope you folks can improve either the parsing of the XML files or the error handling in the future to avoid this one error at least, because while it might be an edge case (a mistake), its consequences are devastating.

    Thanks for coming to my Ted Talk.

    Link to comment
    Share on other sites



    Guest
    Add a comment...

    ×   Pasted as rich text.   Paste as plain text instead

      Only 75 emoji are allowed.

    ×   Your link has been automatically embedded.   Display as a link instead

    ×   Your previous content has been restored.   Clear editor

    ×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...