Note: You are not logged in.
Tutorial: Adding custom damage types and creature types for 3.5E/PF1

by Kelrugem

FREE
5.00 Avg. rating

Forum Thread
Total Subscribers:


Description

For bug reports: https://www.fantasygrounds.com/forums/showthread.php?68112-Tutorial-Adding-damage-types-to-3-5e-PF1
How to activate: This is an extension for 3.5E/PF1; download it from the forge using the update button in the Fantasy Grounds Unity launcher after subscribing to this item using this website; afterwards, before you launch your campaign, turn on Custom Damage Types in the extension list of your campaign.

This is a tutorial providing a dummy extension which the user can edit to add custom damage and NPC types.

Important: Download the dummy extension, go to /extensions, search for its file called Custom Damage Types.ext, and either change this extension's name or turn off the updates from the forge to avoid that your custom changes will be overwritten (in case I ever upload a new build which will get downloaded from the forge and may overwrite your version; this is very unlikely, but to be on the safe side... :) ). In case you already use the version uploaded in the forum, then you do not need to subscribe to this version (doing so, may overwrite your existing version if your existing version still has the same file name).

New damage types

Change the file type of the extention from .ext to .zip, unzip it, and go to /scripts/data_common2.lua which you should open with some text editor (I recommend Notepad++ which is free). Then you see the following:

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; you can simply replace the listed damage type 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.

(in the following, "parsing" 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. If 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().

New creature types

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

table.insert(DataCommon.creaturetype, "new type");
and 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.

Changing the extension's name

There is an extension.xml file before you click on the /scripts folder. Open this file, and you should be able to find the name of the extension at the top between some name tags. Change this string to whatever name you would like to have.

Source of extension logo:

By Bmos, thanks :)



UUID 2b1d5df2-d5ef-11eb-8c52-0050562be458