PDA

View Full Version : NPC Effect coding: can't quite get there (or got as far as I can?)



BronzeDodger
May 10th, 2020, 06:44
EDIT: I've been using this ages but never occurred it applied to NPCs as well - and it totally does the trick:
https://www.fantasygrounds.com/forums/showthread.php?40833-5E-Advanced-Effects-(items-npcs-characters)

Looking at the wiki and the forums I think I'm on the cusp of getting this correct - or discovering it's not something the NPC traits permit.

Attempting to add an effect akin to favored enemy to an NPC.
The wording I've got in the trait:

"The creature does an extra 2 damage to her target on melee attacks vs. humanoids"

On the combat tracker it appears as:

[EFF; DMG: 2 (T-SELF) (A:ROLL)]

So FG is parsing part of it, and double-clicking will indeed apply the damage to the targeted creature. But is there a way to add something like IFT: TYPE (humanoid); DMG: 2 so that it will auto-apply (or do the NPC sheets work such that the only way would be to manually apply the damage after the standard damage roll)?

LordEntrails
May 10th, 2020, 06:46
Not automatically through the trait parsing. At least I'm pretty sure of that. Is their an existing WotC NPC that has a similar trait?

BronzeDodger
May 10th, 2020, 06:55
Not that I've found. My guess is that it would be rare MM creature that would have a qualifier on extra damage (or I've not been able to dig one up if there is) that I can use as a template and try and emulate. I'm moving NPCs over from a 3.5 adventure and they have class levels (in this case Ranger) and I was wondering where the "automated to the point it's clickable in the CT" capability ends and where automated things like the "magic weapons" trait begins.

BronzeDodger
May 10th, 2020, 07:03
Found the Assasin NPC who has a sneak attack coded but the damage does not seem to auto-apply (or even parse) after hitting a creature with ADV on the attack roll. So maybe not something than can be auto-applied?

Myrdin Potter
May 10th, 2020, 07:43
You can do a small edit to the applied effect to add the IFT condition. There is not way to automate that fully as it is not a match to an existing trait that is fully parsed.

BronzeDodger
May 10th, 2020, 08:27
So would be purely for the visual reminder in the CT rather than it would be parsed during the damage roll?

Zacchaeus
May 10th, 2020, 09:15
The parser is picking up on the phrase 'extra damage to' in both your example above and in the assassin. This will create an effect of DMG: ndn+x and will need to be applied before damage is rolled by the NPC. As others have said the parse won't pick up on the complexities of the rest of what you want to do; so you would need to come up with that effect yourself.

Scuba72
May 10th, 2020, 19:18
would adding the effect "IFT: TYPE (humanoid); DMG: 2, melee" work in this case, like it does for giant, aberation, celestial?
I dont know if humanoid is something it can test for.

In the TYPE entry on the effects page it also reads "If the creature indicated by the conditional effect has the given creature type, then this operator returns true.
The humanoid creature type is assumed for creatures where not specified, and for PCs." So I have to assume it can check for humanoid.

The effects page Im referencing - https://www.fantasygrounds.com/wiki/index.php/5E_Effects

Zacchaeus
May 10th, 2020, 22:10
Yes, humanoid is in the list of acceptable creatures. https://fantasygroundsunity.atlassian.net/wiki/spaces/FGU/pages/884913/5E+Effects+for+Advanced+Automation

BronzeDodger
May 11th, 2020, 02:58
It has the vibe of something that might just work but I've not been able to find the magic syntax.
Thanks for digging

Zacchaeus
May 11th, 2020, 09:30
It has the vibe of something that might just work but I've not been able to find the magic syntax.
Thanks for digging

It does work - see my graphic.

As noted above there's no wording that you can use to automate this - you'll need to hard code the effect and apply it when needed.

BronzeDodger
May 11th, 2020, 15:02
Thanks for the patience Zaccaeus :). Did you get that applied by copying/pasting the text from the NPC entry (so you use a traits as template text you can copy into the CT) or was it something you could click in the NPC entry to apply it?

Zacchaeus
May 11th, 2020, 16:04
I'm not sure what you mean exactly.

I created the effect in the effects dialog as you can see and then clicked on the apply icon in the effects dialog which applied it to the NPC on the Combat Tracker. If it wasn't the NPCs turn I would have dragged it from the effects dialog and dropped it on the NPC.

BronzeDodger
May 11th, 2020, 16:18
oh ok - I'm trying to add the code to the NPC card in hopes of saving a couple of clicks finding it under Effects but this makes perfect sense.

Scuba72
May 11th, 2020, 18:49
if you want it to only apply to melee attacks like you mention in the original post you would add ", melee" to the end of that command.
"IFT: TYPE(humanoid); DMG:2, melee" would be the full effect... I think. If you stop at DMG: 2 then it will add 2 damage to all attacks.

BronzeDodger
May 19th, 2020, 08:28
My next attempt: could you code a half-orcs Savage Attacks as part of the damage string on their weapon?
My attempt at the moment:
Hit: 1d6 + 5 slashing damage plus 1d6 slashing, critical, damage.

In use it applies the additional 1d6 to any roll, not just a critical one (I've been using SHIFT+double-click to code the roll as a critical in testing). The chat box does two rolls so you can see the separate dice rolling - but while it repeats 'critical' in the message it obviously not parsing the logic.
Of course I am doing this far too late - but wondering could the IF condition detect a critical roll (I don't think it can do that test, but thought I'd ask).

I also tried coding it on it's own as a DMG: effect but couldn't drill into how to make it perpetual, rather than removing itself the first time it applied ("ROLL"). You have the options on a PC sheet to dial the duration - but can you do it in text on an NPC sheet to over-ride the default "ROLL" ?

Zacchaeus
May 19th, 2020, 09:03
If you are talking about a PC the easiest way to achieve this is to go into the weapon meta data on the character sheet and add in the extra dice there.

If you are talking about an NPC, then again as above there is only so much that you can create with words. You can add a trait to the NPC and include the phrase 'the <NPC> deals an extra ndn damage on a critical hit'. Much like the case above this will create an effect of DMG:ndn on the CT and it will need to be applied just before damage is rolled and after the critical hit. You could hard code an effect in the effects dialog DMG: ndn, critical and apply that to the NPC. You can alter the duration in that dialog so that the effect would stay on the NPC for long enough.

BronzeDodger
May 19th, 2020, 15:18
Ah ok - was still hoping I could find the word combo, or a two part (using 'plus') weapon damage string, so that it would be grabbed automatically. Thanks again.

GavinRuneblade
May 19th, 2020, 17:56
It has the vibe of something that might just work but I've not been able to find the magic syntax.
Thanks for digging

Stick it in the effect library (the person icon top right near the combat tracker, I never remember the full name) and drag/drop it to the NPC once at the start of combat. IFT won't parse, as stated, but you can still use it.

BronzeDodger
May 19th, 2020, 20:18
Q: does the effect library only apply to the campaign currently open? I added the effect and dragged it onto the half-orc NPC - worked as you'd expect. But then I closed that campaign, and opened our active one - and it was not there. If I add a custom effect before exporting to a module for actual play would the custom effect be part of the module?

Secondary: what settings on the custom effect would have it carry over between sessions? When I returned to the 'in-progress' campaign the NPC half-orc was still on the CT but the custom effect was gone.

Zacchaeus
May 19th, 2020, 20:49
Yes, you can export effects to a module and then open that module open in other campaigns. And effect will only persist on the CT for as long as its duration. If you set its duration to 1 round (the default) then the effect would expire as soon as it passed the NPCs turn.

BronzeDodger
May 19th, 2020, 21:01
So I have it coded like this in the Effects window:
All Savage Attacks (half-orc); DMG: 1d6 slashing, critical, melee 0 DAY

I tried it again just now (exited, restarted) and it did stick - so might have been something unrelated on why it disappeared earlier. I'm not to the point of exporting anything yet but will take on faith that it will bundled in the campaign module.

As always thanks for the brain work.

EDIT: duh moment of the day - randomly found another thread that reference Advanced Effects and finally sunk in that it works for NPCs too - and totally does the trick. Put a link in the first post.