PDA

View Full Version : Writing a DMGX extension for 5E?



webdove
March 24th, 2021, 02:26
I found Celestian’s DMGX code for 2E. I unpacked 2E.pak to search for references to DMGX with notepad++. I immediately noticed variable naming conventions involving a prefix like “n” or “a”. I assumed they were meant to represent some aspect of the variable, so I searched in refdoc and the wiki, but I could find no coding style documentation for FGU code. Is that written down somewhere?

Ah. I found Moon's comment on variable naming at https://www.fantasygrounds.com/forums/showthread.php?43010-stringcontrol-questions .

I imagine that I will need to extract a small part of Celestion's 2E ruleset to build my 5E extension.

I wrote lots of lisp code many moons ago, so there will be lots to learn. Do I start with one of the "hear is an easy way to write an extension" explanations? I imagine the complexities will involve the order of instantiation and invocation of my manager_action_damage.lua code relative to the 5E manager_action_damage.lua code and I suspect that the specifics of that won't necessarily be covered in the "writing an extension" intros.

webdove
March 24th, 2021, 17:53
@celestian is it ok for me to do this? It seems that I would start by comparing the 5E and 2E Lua files looking for differences related to DMGX or nDamageModifier. I would strip out all the code from 2E that already exists in 5E and make that into a manager_action_damage.lua file.

celestian
March 24th, 2021, 18:03
@celestian is it ok for me to do this? It seems that I would start by comparing the 5E and 2E Lua files looking for differences related to DMGX or nDamageModifier. I would strip out all the code from 2E that already exists in 5E and make that into a manager_action_damage.lua file.

I've no issues with you retooling this feature in the 2e ruleset into an extension to benefit the 5e users.

webdove
March 26th, 2021, 03:35
I noticed that in 2E "DMGX" is included in the tables bonuscomps and targetableeffectcomps.
The only reference in 5E to either of those tables is TokenManager.addEffectTagIconBonus(DataCommon.bonu scomps); in \5E\scripts\Manager_token2.lua.

Do I need to add DMGX to those tables during my init() in order for DMGX to be recognized?

I not been able to find a small extension which adds a damage modifier as an example to follow for what I should do.