Joshua Stream Pre
  1. #1
    Kelrugem's Avatar
    Join Date
    Sep 2018
    Location
    Geneva, Switzerland, and Lyon, France
    Posts
    3,199

    [Tutorial] Adding damage types to 3.5e/PF1

    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; May 23rd, 2021 at 16:06.

  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");

  3. #3
    Kelrugem's Avatar
    Join Date
    Sep 2018
    Location
    Geneva, Switzerland, and Lyon, France
    Posts
    3,199
    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!

  5. #5
    Kelrugem's Avatar
    Join Date
    Sep 2018
    Location
    Geneva, Switzerland, and Lyon, France
    Posts
    3,199
    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
    Kelrugem's Avatar
    Join Date
    Sep 2018
    Location
    Geneva, Switzerland, and Lyon, France
    Posts
    3,199
    I've added information about adding custom NPC types at the bottom of the first post, too

Thread Information

Users Browsing this Thread

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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
FG Spreadshirt Swag

Log in

Log in