Thread: Help with new damage types in 5e
-
December 13th, 2019, 20:49 #1
Help with new damage types in 5e
So my campaign setting has a bunch of new damage types to it (kinetic, thermal, quantum, explosive, cosmic). I've added them in an extension which does load with no errors in FG but... they don't seem to parse on NPCs.
capture.jpg
I've got the following two code pieces:
in data_common.lua:
Code:-- Damage types supported dmgtypes = { "acid", -- ENERGY TYPES "cold", "fire", "force", "lightning", "necrotic", "poison", "psychic", "radiant", "thunder", "adamantine", -- WEAPON PROPERTY DAMAGE TYPES "bludgeoning", "cold-forged iron", "magic", "piercing", "silver", "slashing", "kinetic", "thermal", "quantum", "cosmic", "explosive", "critical", -- SPECIAL DAMAGE TYPES };
Code:-- SET MAGIC DAMAGE IF PHYSICAL DAMAGE SPECIFIED AND GENERATED BY SPELL if bMagic then for _,rDamage in ipairs(damages) do for _, rClause in ipairs(rDamage.clauses) do if (rClause.dmgtype or "") ~= "" then local aDmgType = StringManager.split(rClause.dmgtype, ",", true); if StringManager.contains(aDmgType, "bludgeoning") or StringManager.contains(aDmgType, "piercing") or StringManager.contains(aDmgType, "slashing") or StringManager.contains(aDmgType, "kinetic") or StringManager.contains(aDmgType, "thermal") or StringManager.contains(aDmgType, "quantum") or StringManager.contains(aDmgType, "explosive") then bMagicAttack = true; break; end end end end end
-
December 13th, 2019, 21:13 #2
The section of code you've listed is just for setting the bMagicAttack flag if there is physical damage generated by a spell (as mentioned in the comment on the top line of the code snippet), this does nothing for damage entry parsing.
How are you loading the new dmgtypes LUA table? This has to have exactly the same global script reference as the original - DataCommon.dmgtypesPrivate 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!
-
December 13th, 2019, 21:23 #3
And make sure this is is exactly (and I mean *exactly*) the same format as weapon attacks from existing monsters that work correctly.
For example, from the Shortbow attack for a goblin:
Code:Ranged Weapon Attack: +4 to hit, range 80/320 ft., one target. Hit: 5 (1d6 + 2) piercing damage.
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!
-
December 13th, 2019, 21:48 #4
Hmmm so I changed the entry to copy yours exactly but change it to a new damage type.
Code:Ranged Weapon Attack: +4 to hit, range 80/320 ft., one target. Hit: 5 (1d6 + 2) explosive damage.
I removed the manager_power.lua entirely since it looks like it's not needed but for the loading of the damage type table I don't understand what you're asking.
capture.jpg
it's from data_common.lua and on line 280 of that block.
is this being loaded wrong?
-
December 13th, 2019, 21:57 #5Private 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!
-
December 13th, 2019, 22:13 #6
Oh, okay, sorry, I didn't think of that!
I've attached the zip.
-
December 13th, 2019, 23:10 #7
That works fine for me with a Goblin modified as follows:
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!
-
December 13th, 2019, 23:12 #8
I've also made the extension so that it just overrides the DataCommon.dmgtypes data not the whole DataCommon script package. This will reduce the chances of clashes with future updates to the 5E ruleset and that file.
EDIT: I've included a Debug.console statement after the dmgtypes have been overridden - so that you can check that the actual values have been stored correctly. To view this open the console before you \reload the ruleset.Last edited by Trenloe; December 14th, 2019 at 13:04.
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!
-
December 14th, 2019, 15:12 #9
Hey, thanks so much for your help!
I'll look over the extension you put together and see how I can improve my own work moving forward!
-
March 27th, 2020, 17:38 #10
Hey, so this actually worked great up until a recent update to FG happened. Now I'm getting this error:
Code:Ruleset Error: windowclass: Defined with a merge attribute, but the name attribute (imagepanelwindow_toolbar) does not match an existing windowclass. Skipped. File (campaign/record_image.xml) Runtime Notice: s'DataCommon.dmgtypes = ' | { #1 = s'acid', #2 = s'cold', #3 = s'fire', #4 = s'force', #5 = s'lightning', #6 = s'necrotic', #7 = s'poison', #8 = s'psychic', #9 = s'radiant', #10 = s'thunder', #11 = s'adamantine', #12 = s'bludgeoning', #13 = s'cold-forged iron', #14 = s'magic', #15 = s'piercing', #16 = s'silver', #17 = s'slashing', #18 = s'kinetic', #19 = s'thermal', #20 = s'quantum', #21 = s'cosmic', #22 = s'explosive', #23 = s'critical' }
animated.gif
I've attached the latest version of the extension. Anyone know what this error is referring to and why it's happening?
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks