-
March 8th, 2021, 17:09 #1
- Join Date
- Jul 2018
- Location
- St. Louis, MO
- Posts
- 25
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)
"Everything started as somebody's daydream." -- Larry Niven
-
March 8th, 2021, 17:23 #2
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));
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!
-
March 8th, 2021, 18:26 #3
- Join Date
- Jul 2018
- Location
- St. Louis, MO
- Posts
- 25
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
-
March 8th, 2021, 18:53 #4
- Join Date
- Jul 2018
- Location
- St. Louis, MO
- Posts
- 25
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
-
March 8th, 2021, 18:56 #5
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!
-
March 8th, 2021, 21:37 #6
- Join Date
- Jul 2018
- Location
- St. Louis, MO
- Posts
- 25
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
-
March 8th, 2021, 22:25 #7
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)
Bookmarks