DICE PACKS BUNDLE
  1. #1

    Post 2021-02 Modifier Stack Errors

    I've been working on getting my ruleset to be fully compatible with the but 2021-02 changes. I've gotten most things worked out and have implemented all the required and recommended changes list here, however one issue remains that I am stumped trying to resolve.

    Whenever a number is entered into the Modifier Stack tool, all subsequent die rolls result in the following error, even after the Modifier Stack is cleared:

    Code:
    [3/8/2021 10:25:08 AM] [ERROR]  Script execution error: [string "scripts/manager_modifierstack.lua"]:135: bad argument #3 to 'format' (number expected, got nil)
    Any suggestions on what I'm need to look at to resolve this?
    "Everything started as somebody's daydream." -- Larry Niven

  2. #2
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,402
    Looks like there's something in a modifier slot that has a description but not an associated number modifier.

    The code that's raising the error is this:

    Code:
    table.insert(aMods, string.format("%s %+d", slots[i].description, slots[i].number));
    With slots[i].number being the problem, [I]slots.description appears to be OK.
    Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!

  3. #3
    That's part of what stumps me. I actually type the number in the modifier stack control and it display +2 (for example) but when the roll is made, I get the error. I don't know why it would have a description but not a number in that scenario.
    "Everything started as somebody's daydream." -- Larry Niven

  4. #4
    So, as a bit of debugging, I added code to list out what's in the ActionsManager.slots array during my attack action, right before I get the error and it's empty:

    Code:
    s'manager_actions_champions6e.checkModStack' | s'aSlots: ' | {  }

    Code I'm using to print the modifier stack:

    Code:
    function checkModStack()
    	local sMethod = CLASS_NM .. ".checkModStack";
    
    	local aSlots = ModifierStack.slots;
    	Debug.chat(sMethod, "aSlots: ", aSlots);
    	for i = 1, #aSlots do
    		Debug.chat(sMethod, "Modifier Slot " .. i, aSlots[i]);
    	end
    end
    Last edited by Netzilla; March 8th, 2021 at 18:55.
    "Everything started as somebody's daydream." -- Larry Niven

  5. #5
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,402
    I'm not sure which way LUA checked the variables, so it could be that both description and number are blank, but it's just reporting number first. I thought it checked from the left of the function arguments, but maybe not.
    Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!

  6. #6
    Finally figured it out. There was a range modifier being passed into the stack with a non-numeric modifier number. Odd that the stack showed empty, and the error was complaining about a nil, however.

    Thanks for the help.
    "Everything started as somebody's daydream." -- Larry Niven

  7. #7
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,402
    Cool. Glad you got it sorted out.
    Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Starfinder Playlist

Log in

Log in