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 :D 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 :D