PDA

View Full Version : D&D 5th Edition Conditions location?



Kiriel
July 2nd, 2017, 05:57
I'm working on codifying a set of homerules for the 5th Edition, and need to create a custom condition. Could someone possibly point me to where in the ruleset preexisting conditions are?

// To clarify - I'm looking for a piece of code that tells FG that if a "Prone" condition applied to something, that something has DISATK, melee attacks vs it have ADV, and ranged attacks against it have DIS.

Any help is much appreciated.

LordEntrails
July 2nd, 2017, 06:20
Welcome to the forums :)

FG calls them "Effects" and you can make lots of effects, not just those for conditions. Read more in the wiki at: https://www.fantasygrounds.com/wiki/index.php/5E_Effects

If you are looking to customize the software, then check out the developer guides that start here; https://www.fantasygrounds.com/wiki/index.php/Developer_Guides

Zacchaeus
July 2nd, 2017, 08:05
Hi and welcome to the forums. I know you have clarified but are you looking to create an effect or do you want to mess with the Kia scripts so you can create an extension. A little more information as to what you want to do might help us point you in the right direction.

Kiriel
July 2nd, 2017, 08:20
Option B - I'm building an extension to the 5th Edition ruleset. It mostly deals with introducing a second layer of hit-points and changing the damage application logic. (Body & Vigor AKA SW d20 -re-Saga models for those familiar). Those pieces of extension are all done and functional. However, within a damage application logic I need to embed a call to apply and remove a custom condition which does not exist in DnD 5E and is obviously not encoded in the ruleset. I'm trying to find the file in the ruleset that contains all the hardcoded conditions (Restrained, Prone, Paralyzed, etc). I mean, they are SOMEWHERE in the set, I just can't figure out where.

Something like EffectManager.addEffect("", "", ActorManager.getCTNode(rSource), { sName = "Wounded", nDuration = 0 }, true); , but I need to define what Wounded is and what bonuses and penalties it carries.

I have read the developer guides. Unless I'm critically missing something, they are extremely bare-bone. I admittedly learned more about how FG does things just going over existing extensions and rulesets in the N++,

Zacchaeus
July 2nd, 2017, 09:14
You could unpack the ruleset and do a search for something like prone. Otherwise I'm not sure where the code is for such things. Someone will know however and no doubt will be along shortly to pinpoint it for you.

Kiriel
July 2nd, 2017, 10:28
I have unpacked the ruleset and have been literally going file by file to no avail. Here is hoping someone has done the same but was more successful.

Zacchaeus
July 2nd, 2017, 10:38
It's also possible that those conditions are hard coded and not therefore accessable

Kiriel
July 2nd, 2017, 14:52
Well, yes, and since I seem to continue not seeing them, I'm starting to lean towards that option. Which is, of course, really strange, since all of those conditions, and especially their mechanical effects, are very 5th Edition specific. I don't understand why would anyone actually hard-code it.

Any other coders working with the 5th Edition, my pitiful cry is going out to you - have you seen the Condition definitions anywhere in the code or .xmls? =)

Trenloe
July 2nd, 2017, 16:55
Specific condition effects are coded in the action scripts. Look in scripts\manager_action_attack.lua for condition code related to attacks.

Kiriel
July 2nd, 2017, 17:51
Specific condition effects are coded in the action scripts. Look in scripts\manager_action_attack.lua for condition code related to attacks.

Appreciate it. I have to admit that this is a very strange design decision - if I were to design the ruleset I would define conditions in a separate file and iterate through them on action, but OK, problem 1 fixed.
I also have discovered Notepad++'s ability to search within multiple text files, so yay ease of access to information.

Perhaps you can help me with another Condition-related problem? It deals with Exhaustion condition and it's increments. Here is what I'm trying to do - every time a certain condition is met, Exhaustion is incremented by one. Every time another condition is met, Exhaustion is decremented by 1.

An example of code that should do the decrement is from the manager_combat2.lua:



local nExhaustMod = EffectManager.getEffectsBonus(nodeCT, {"EXHAUSTION"}, true);

if nExhaustMod > 0 then
nExhaustMod = nExhaustMod - 1;
EffectManager.removeEffectByType(nodeCT, "EXHAUSTION");

if nExhaustMod > 0 then
EffectManager.addEffect("", "", nodeCT, { sName = "EXHAUSTION: " .. nExhaustMod, nDuration = 0 }, false);
end
end


It's reverse is an increment below.



local nExhaustMod = EffectManager.getEffectsBonus(NodeCT, {"EXHAUSTION"}, true);

nExhaustMod = nExhaustMod + 1;
EffectManager.removeEffectByType(nodeCT, "EXHAUSTION");
EffectManager.addEffect("", "", nodeCT, { sName = "EXHAUSTION: " .. nExhaustMod, nDuration = 0 }, false);


But they don't seem to be working. In fact, nExhaustMod is set to 0 as a result of the above call. Any ideas?

Kiriel
July 3rd, 2017, 02:26
And I got it. Was passing the wrong arguments.