1 Attachment(s)
Extension for custom damage types
Forge link: https://forge.fantasygrounds.com/shop/items/45/view
Hi :)
After some request on Discord I wanted to outline how to inbuild your own custom damage types (and creature types) :) You will see here some dummy extension which you can modify to add your own damage types; you may want to see that also as a first mini-mini-mini step towards extension building :) No worries, it is really not complicated, I just did that in a minute or so :) So, it is quick with some exercise
Download the dummy extension, unzip it, and go to /scripts/data_common2.lua. Then you see the following:
Quote:
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 are the ones requested on discord, 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 :)
Have fun :)
Best,
Kelrugem
PS: Written like that it is very compatible with everything as long as nothing drastic with the data structure of 5e's damage types happens :)
PPS:
You want more?
Of course this only works for the standard damage types; there is also the critical damage type with some special properties. Such things are of course a little bit more complicated to code, but one thing is easy to add: The critical damage added as an effect as in DMG: d6 critical does not only trigger on crits but the d6 will also carry all the other native damage types from your weapon, it won't just have the type critical. If you want that your custom damage type behaves similarly, i.e. if used in such effects the native damage types shall be inherited and additionally added, then additionally add the following line in the code above:
Quote:
table.insert(DataCommon.specialdmgtypes, "ballistic");
(ballistic is just an example of course)
That extra should work, but I did not test it separately, I just looked at the code :) (and it is similar in 3.5e/PF1)
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 :)