FG Spreadshirt Swag
Page 1 of 2 12 Last
  1. #1

    [Tutorial] Adding damage types to 3.5e/PF1

    Forge link: https://forge.fantasygrounds.com/shop/items/46/view

    Hi

    I have seen the question about adding custom damage types here and there, and I also provided the following information as an answer in some thread. But I thought I may make a separate thread with a dummy extension for custom damage types such that you can add your own damage types to your game (well, at least I know of Dellanx who is doing that ).

    Download the dummy extension, rename .ext to .zip, unzip it, and go to /scripts/data_common2.lua. Then you see the following:
    Code:
    function onInit()
    table.insert(DataCommon.dmgtypes, "ballistic");
    table.insert(DataCommon.dmgtypes, "laser");
    table.insert(DataCommon.dmgtypes, "electric");
    table.insert(DataCommon.dmgtypes, "radiation");
    end
    You now probably see the structure; the four damage types were once requested on discord and I kept them in this extension as example, you can simply replace them and/or add additional lines with the same structure. Just replace the damage type of that new line then Then zip the extension again (inside its first layer of folder), then rename to .ext.

    If you want to do some more extensive things, then you can add the damage types also to other groups than dmgtypes; I will now provide some list of groups of damage types, simply replace DataCommon.dmgtypes with any other group you want to use. For example group B, then you use table.insert(DataCommon.B, "blah") You can also add a damage type to more than one group if you want several properties provided by the groups

    (parsing here is often about the parsing of NPC effects)

    dmgtypes := All damage types should be added here if they should be recognized as damage type in damage die strings and damage actions, also used in many parsing stuff: DR, REGEN, IMMUNE, and spell damage actions (not for RESIST and VULN, for this you need to add it to energytypes)
    energytypes := These are the damage types overcoming DR, also used for parsing RESIST and VULN effects for NPCs (that damage type will also be listed/used in the hardness parsing); the automatic parsing of such effects would otherwise ignore such damage types when not listed there.
    immunetypes := (Mainly) for the automatic parsing of IMMUNE effects. Add it there when you want that the automatic parser recognizes that damage type for IMMUNE effects. Especially for informational effects of immunities against stuff which should not be recognized as damage type like charm (dmgtypes already covers this parsing for actual damage types)
    basicdmgtypes := There you should only list damage types if they are fluid. A weapon with slashing and piercing damage type can overcome stuff like IMMUNE: slashing effects for example, because the weapon is then assumed to be piercing. In order to be immune against a basic damage type, one needs to be immune against all incoming basic damage types. When you do not need such a behaviour, then do not add your damage type to this group. (Similar argument for (H)RESIST and FORTIF if you use my overlay extension)
    specialdmgtypes := These are damage types with certain special properties, the native ones are nonlethal, spell, critical, and precision. They have some special code (which then needs to be added to the scripts), but all of them have in common that they are added to existing damage types (for this you just need to add the damage type to this group). That means that e.g. DMGTYPE: precision and DMG: d6 precision will also use existing damage types of the damage roll (the d6 will then not only have precision as damage type, while for example DMG: d6 fire would be only fire damage). Also used for the parsing of IMMUNE effects

    So, just use the extension as a template and add table.insert(DataCommon.[any of these lists], "[your damage type]"); in the function onInit()

    If I have some information missing or some error, then please let me know (I wrote that list actually some time ago, https://www.fantasygrounds.com/forum...l=1#post533866, I didn't check it again in the code I now just provide the dummy extension for an easier use )

    Best wishes,

    Kelrugem

    PS: I wrote this extension in such a way that it should be very compatible with everything, as long as the damage type structure itself does not change

    PPS: I should finally maybe extend the NPC parser, including SIMMUNE and stuff like that

    New creature types:

    If you want to have a new creature type, then use

    Code:
    table.insert(DataCommon.creaturetype, "new type");
    (replace new type with your custom types)

    You can also use creaturesubtype instead of creaturetype, but that is just for sorting purposes, the automation is the same
    Attached Files Attached Files
    Last edited by Kelrugem; July 20th, 2021 at 00:02.

  2. #2
    Quote Originally Posted by Kelrugem View Post
    Hi

    I have seen the question about adding custom damage types here and there, and I also provided the following information as an answer in some thread. But I thought I may make a separate thread with a dummy extension for custom damage types such that you can add your own damage types to your game (well, at least I know of Dellanx who is doing that ).

    Download the dummy extension, rename .ext to .zip, unzip it, and go to /scripts/data_common2.lua. Then you see the following:
    Code:
    function onInit()
    table.insert(DataCommon.dmgtypes, "ballistic");
    table.insert(DataCommon.dmgtypes, "laser");
    table.insert(DataCommon.dmgtypes, "electric");
    table.insert(DataCommon.dmgtypes, "radiation");
    end
    You now probably see the structure; the four damage types were once requested on discord and I kept them in this extension as example, you can simply replace them and/or add additional lines with the same structure. Just replace the damage type of that new line then Then zip the extension again (inside its first layer of folder), then rename to .ext.

    If you want to do some more extensive things, then you can add the damage types also to other groups than dmgtypes; I will now provide some list of groups of damage types, simply replace DataCommon.dmgtypes with any other group you want to use. For example group B, then you use table.insert(DataCommon.B, "blah") You can also add a damage type to more than one group if you want several properties provided by the groups

    (parsing here is often about the parsing of NPC effects)

    dmgtypes := All damage types should be added here if they should be recognized as damage type in damage die strings and damage actions, also used in many parsing stuff: DR, REGEN, IMMUNE, and spell damage actions (not for RESIST and VULN, for this you need to add it to energytypes)
    energytypes := These are the damage types overvoming DR, also used for parsing RESIST and VULN effects for NPCs (that damage type will also be listed/used in the hardness parsing); the automatic parsing of such effects would otherwise ignore such damage types when not listed there.
    immunetypes := (Mainly) for the automatic parsing of IMMUNE effects. Add it there when you want that the automatic parser recognizes that damage type for IMMUNE effects. Especially for informational effects of immunities against stuff which should not be recognized as damage type like charm (dmgtypes already covers this parsing for actual damage types)
    basicdmgtypes := There you should only list damage types if they are fluid. A weapon with slashing and piercing damage type can overcome stuff like IMMUNE: slashing effects for example, because the weapon is then assumed to be piercing. In order to be immune against a basic damage type, one needs to be immune against all incoming basic damage types. When you do not need such a behaviour, then do not add your damage type to this group. (Similar argument for (H)RESIST and FORTIF if you use my overlay extension)
    specialdmgtypes := These are damage types with certain special properties, the native ones are nonlethal, spell, critical, and precision. They have some special code (which then needs to be added to the scripts), but all of them have in common that they are added to existing damage types (for this you just need to add the damage type to this group). That means that e.g. DMGTYPE: precision and DMG: d6 precision will also use existing damage types of the damage roll (the d6 will then not only have precision as damage type, while for example DMG: d6 fire would be only fire damage). Also used for the parsing of IMMUNE effects

    So, just use the extension as a template and add table.insert(DataCommon.[any of these lists], "[your damage type]"); in the function onInit()

    If I have some information missing or some error, then please let me know (I wrote that list actually some time ago, https://www.fantasygrounds.com/forum...l=1#post533866, I didn't check it again in the code I now just provide the dummy extension for an easier use )

    Best wishes,

    Kelrugem

    PS: I wrote this extension in such a way that it should be very compatible with everything, as long as the damage type structure itself does not change

    PPS: I should finally maybe extend the NPC parser, including SIMMUNE and stuff like that
    Thank you, I am not sure if custom creature types work.

    table.insert(DataCommon.creaturesubtype, "mythic");

    These are the modules and extensions created and/or taken over by dellanx for PFRPG.

    I had a lot of help and advice from many here at FG.

    Thank You!

  3. #3
    Quote Originally Posted by dellanx View Post
    Thank you, I am not sure if custom creature types work.
    Yeah, should work, too Maybe I should extend the tutorial a bit how to do that, too; but you seemingly got already the idea and where to take the group names from

  4. #4
    Quote Originally Posted by Kelrugem View Post
    Yeah, should work, too Maybe I should extend the tutorial a bit how to do that, too; but you seemingly got already the idea and where to take the group names from
    I think I am figuring it out. Thank you!
    Last edited by dellanx; April 29th, 2021 at 22:01.

    These are the modules and extensions created and/or taken over by dellanx for PFRPG.

    I had a lot of help and advice from many here at FG.

    Thank You!

  5. #5
    Quote Originally Posted by dellanx View Post
    I think I am figuring it out.

    p.s. what is the best way to add "ghost touch"?
    ghost touch is already a damage type in my extension (for PF1) So, you already have that

  6. #6
    I've added information about adding custom NPC types at the bottom of the first post, too

  7. #7
    Also this tutorial extension is now on the forge, see the link in the first post But: Only download it if you do not already use it to avoid that the forge overwrites your version The forge is then just for new users (or rename your file, but there is actually no reason that you need to download it again from the forge)

  8. #8
    Morenu's Avatar
    Join Date
    Mar 2020
    Location
    Pennsylvania, USA
    Posts
    551
    EDIT * - Got it working (original post at the bottom)

    I am trying to fully automate Ancestral Grudge (+1 attack against Elf and dwarf but not drow)... using PF1e

    Wording:
    [The enmity between the drow and elves and dwarves is long-standing and deeply entrenched. Drow with this racial trait gain a +1 bonus on attack rolls against humanoids with the dwarf or elf subtypes (with the exception of drow) because of their special training against these reviled foes.

    This racial trait replaces poison use.]


    To get this to work, I had the DM download this extension and add Drow to the ext file (directions are in forge and in the first post)

    table.insert(DataCommon.creaturetype, "drow");

    AND all drow NPCs would need drow AND elf listed in their type field, Its seems many do already (for characters I changed race to drow (elf) )

    then I add these 2 lines in my combat tab as permanent effects

    IFT: TYPE(dwarf,elf); ATK: 1
    IFT: TYPE(drow); ATK: -1

    so if drow is listed under type as well as elf, it cancels out the elf +1 bonus

    Original question:
    I did 2 if tags, 1 to add ATK 1 for elf or dwarf type and another to add ATK -1 for drow for a net zero on +1 elf -1 drow... did not work, is this possible with current commands?

    IFT: TYPE(dwarf,elf); ATK: 1 (this works fine)

    Tried both of these,. did not work

    IFT: SUBTYPE(drow); ATK: -1 (this does a -1 to everything - tested orc, the attached drow, an elf character, a drow character defined as drow (elf) ) I assume SUBTYPE is not a command so it is applying the ATK-1 to everything due to the semicolon.

    IFT: TYPE(drow); ATK: -1 (This does not work at all on either of the drow above)

    drow.png
    Last edited by Morenu; March 15th, 2022 at 19:16.

  9. #9
    A few points to consider:

    * SUBTYPE is not a valid operator; the 3.5E ruleset only supports ALIGN/SIZE/TYPE/CUSTOM. The TYPE operator will also check some subtypes.

    * "drow" is not a valid creature type; nor one of the default creature subtypes in the creature manual. The valid types/subtypes are built into the ruleset; and would need to be changed via a mod.

    * From the 3.5E SRD, the drow warrior is "Medium Humanoid (elf)". For the Pathfinder SRD, the drow is "CE Medium Humanoid (elf)".

    The base ruleset and modules are not designed nor have the data to differentiate drow vs. any other elf. You're probably best off just fixing at the table when you need to.

    Regards,
    JPG

  10. #10
    Morenu's Avatar
    Join Date
    Mar 2020
    Location
    Pennsylvania, USA
    Posts
    551
    Thx, I can have it check elf, dwarf and have a remove button to turn it off for drow OR make the dwarf, elf check permanent under the combat tab and make an on off for a -1 attack if I encounter drow.

Thread Information

Users Browsing this Thread

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

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
  •  
DICE PACKS BUNDLE

Log in

Log in