DICE PACKS BUNDLE
Page 1 of 2 12 Last
  1. #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
    };
    and in manager_power.lua

    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
    Am I missing something somewhere else to get these to parse properly?

  2. #2
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,361
    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.dmgtypes
    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
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,361
    Quote Originally Posted by Pentazer View Post
    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.
    This is different to the format you're using in this example screenshot. Your best way of testing is to take an existing monster, make a copy of it and then just change the damage type in an attack entry - that is, take an attack that is known to parse correctly, and make a minimal change to that attack string.
    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!

  4. #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.
    But it looks like it didn't work.

    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?

  5. #5
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,361
    Quote Originally Posted by Pentazer View Post
    ... 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?
    What line of XML do you have in your extension.xml that loads that data_common.lua extension file? It will probably be easier if you ZIP up your extension and attach it here.
    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
    Oh, okay, sorry, I didn't think of that!

    I've attached the zip.
    Attached Files Attached Files

  7. #7
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,361
    That works fine for me with a Goblin modified as follows:

    Attached Images Attached Images
    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!

  8. #8
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,361
    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.
    Attached Files Attached Files
    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!

  9. #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!

  10. #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' }
    But as you can see it does parse and is recognized.
    animated.gif


    I've attached the latest version of the extension. Anyone know what this error is referring to and why it's happening?
    Attached Files Attached Files

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
  •  
5E Product Walkthrough Playlist

Log in

Log in