PDA

View Full Version : Help with effects coding



Gruber
August 22nd, 2018, 21:15
So, as written above, i need some help with coding a specific effect to use with my PCs/NPCs. I wish to make an affect that triggers Critical when a target is under a specific condition (Prone). I'm not sure if Critical is applicable at all as a command, but I would be happy to be able to just add a dice of damage if the condition is fulfilled.

I'm trying with this specific string:

IFT: [Prone]; DMG: 1d8;

but FG completely ignores the first part of it (If Target: [prone]) and just applies 1d8 damage every time i hit attack button, on all targets, prone or not.


So, I would be grateful if anyone could help with this issue.

Thanks.

Gwydion
August 22nd, 2018, 21:29
Assuming this is for 5e rulese, have you tried the following: IFT: prone; DMG: 1d8

(remove the brackets around prone and make all lowercase.)

Zacchaeus
August 22nd, 2018, 22:12
Indeed, the brackets are not needed and the condition being tested for needs to be in lower case. More information here (https://www.fantasygrounds.com/wiki/index.php/5E_Effects#A_Note_on_IF_and_IFT).

Gruber
August 22nd, 2018, 23:14
Thanks guys! (yes 5e dnd) I've been working my *** around these effects and seem to just have neglected the brackets. So, i guess triggering a Crit is not possible.
Also, I'm experimenting with effects that lower enemy's AC, I've tried with putting in something like

target: AC: -1

But it doesn't seem to work.

I'm aware how to make that effect on a PC action, but when trying to set it on NPCs, using add-ons for NPC effects, there is not an option to choose a target of an effect (self or target). So, being able to coded in the target would fix this problem.

Zacchaeus
August 23rd, 2018, 00:15
You can add effects onto an NPC by either adding them from the PCs action tab (targeting set to targets) or you can create them in the effects window. If you do the latter you can either drag them onto the NPC or click on the running man icon when the NPC is the current actor on the CT. AC: -1 will reduce an NPCs armour by 1. Note that as with PCs such an effect does not change the NPCs armour class but when the creature is attacked you’ll see the calculation in chat takes account of the reduction.

Edit. The effect above won’t work since you have a colon after target. Change that to a semi colon if you want that word as part of the effect for whatever reason. It isn’t needed however.

Edit 2. Here’s a link to some videos which you will find useful https://www.fantasygrounds.com/forums/showthread.php?41478-Effects-Videos-for-5E

Uraence
August 23rd, 2018, 04:21
On Criticals, while you can't have it auto trigger on a hit, you can use the "Critical" button under modifiers (+ / - button). Just press the "Critical" before you roll damage and it'll double the dice.

Gruber
August 23rd, 2018, 08:29
Thank you Zacchaeus and Uraence for your answers but that's not what I asked :). Perhaps I wasn't clear with the explanation. The thing is I'm fully aware how the effects work and am using them from the 'effects menu' as well as from my PCs sheets.

The thing, however, is a problem of creating effects that the NPCs will use (such as traits, feats, special abilities and such). As NPCs don't have an option of setting effects, I'm using an add-on for FG which enables effects for NPCs. But the add-on is not working the same way as PC effects, not enabling to set who receives the effect, like you can do in the PC sheet (target or self). So, i was thinking, if that could be set by coding it, that's a workaround. But I haven't been able to find if there's a command for choosing the effect 'receiver' (like: target or self).

So, what I'd like to do is make my NPC attack and remove one point of AC from its target (the PCs, obviously) with each of his attacks.

Not too hard, it seems. But the way the commands are set it seems to be out of boundaries, at least with what I'm using. I know it could be made by manually finding the effect from the effects menu, but I'm really trying to find ways to speed-up things when it comes to fighting.

Edit: This is the extension that allows me make effects for NPCs: https://www.fantasygrounds.com/forums/showthread.php?40833-5E-Advanced-Effects-(items-npcs-characters)

lostsanityreturned
August 23rd, 2018, 09:00
You can force a crit with an effect, CRIT:2

The issue is CRIT:2 doesn't work under a boolean operator for some odd reason:( but it does work and you can set it to expend after 1 round, so at least for players it is easy to set up, and if using the Kombat module or if you set up mouse macros to drag and drop effects from the toolbar into the combat tracker it will be fast enough.

As for the AC modification, AC:-1 and then just stack then as effects each time someone is hit, sadly there is no way to automate this. Players can apply it themselves with a simple effect but monsters you will have to do what I suggested above with the toolbar.
The Kombat mod makes repeated applications of the same condition toggle it, so this method won't work with that mod without your changing the number manually (which is easy or fiddly depending on how many combatants you have in a combat)

Gruber
August 23rd, 2018, 09:30
Thanks. Some of it may be applicable, especially CRIT on 2 which I'll put to a test.
Otherwise, yeah, it seems i can not set the effect do dmg to target AC, unfortunately.

Skillkoil
August 24th, 2018, 05:02
The easiest way to apply crit damage no matter what effect is on the target is just hold the [shift] button while double clicking damage. This will automatically roll the damage as a critical hit. It will save you from having to go to the +/- modifier button and clicking Critical each time you want to do it. You won't need to code the effect either. (which i'm pretty sure isn't possible) It will be much faster and convenient just to hold shift on any damage you wish to be critical.

I hope this helps!

Skillkoil
August 24th, 2018, 05:09
As for your second question about target or self. You can set it to expend on next roll by having [ROLL] and you can have it apply to your own damage roll by using the coding [SELF]

Here is an example line of code from a spell I use that may help you with your issue: DMG: 1d6; [ROLL]; [SELF]

This expends the effect on the next roll made and applies the damage effect to the caster/attacker who has the effect on themselves.

Gruber
August 24th, 2018, 08:00
Wow, I didn't know about shift triggering a crit, very useful, thanks!
Thanks for the advice about the code, as well.

But, it is still not what i wanted to do. It would be perfect if, instead of '[SELF]' i could put [TARGET]. I'll try playing with it a bit, perhaps it is even possible.

The thing is, while DMing with 20 creatures in the battle tracker and doing tons of parallel stuff, it is really convenient to be able to code in certain traits on PCs and NPCs, so I don't have to worry about remembering every one of them. For instance, when one of my NPCs shoves a creature and after a round of combat, which usually lasts for almost half an hour the way things work here, it is impossible to remember that my NPC has a trait that guarantees a crit on prone enemies. And if I do remember, trying to speed things up all the time just makes me clik and roll that dmg a bit too soon. The point is it's not just about this particular effect, I've got tons of stuff that I'd like to code in as effects on NPCs which i could do if the software supported choosing the 'receiver' of the effect (like "self', or 'target'). Perhaps that's something the developers might think about, or someone from the community will make an extension (I would if I had the skills).

Zacchaeus
August 24th, 2018, 09:15
You can’t really code effects on NPCs like you can on players. Effects on NPCs come mainly from the wording used in traits and abilities. See this for more information. https://www.fantasygrounds.com/forums/showthread.php?35937-How-to-Automate-effects-on-NPCs

Such coding as there is of course naturally follows the rules of 5e. You are creating all sorts of house rules which obviously won’t get picked up by the internal parser. So the only way for you to do what you want to do is create effects in the effects window. The effects you create don’t need to actually do anything other than act as a reminder. So if it is necessary to do critical damage to a prone target then create an effect with a phrase such as ‘crit on prone’.

If you would like to see the devs rewrite the code so that NPCs can have effects like PCs do then add it to the wish list. Link in my signature.

Gruber
August 24th, 2018, 09:25
I see where you're going, Zacchaeus, and you're right. I'll also go through the wording page again, haven't been reading it for a while. Still, I do my best to word everything correctly and the feature is really useful. I just wish I could do more, sometimes :)

I'll be sure to check the link and add my thoughts to the wish list.

Skillkoil
August 24th, 2018, 13:15
If you use 5E Advanced Effects coding you can add PC effects to NPC's. You can find the extension below.

https://www.fantasygrounds.com/forums/showthread.php?40833-5E-Advanced-Effects-(items-npcs-characters)

Gruber
August 24th, 2018, 14:19
I am using that extension, which is excellent by the way. That is precisely where I'm trying to code in the effect. Alas, the PC and NPC effects are a bit different. With the PC effects, one can choose the targeting of the effect: 'SELF' of 'Targets'.
In the NPC effect window, there isn't an option to choose targeting of the effect (who is the receiver), it automatically effects the NPC.

This is perhaps a bit hard to describe, as I'm not native english speaker and probably am using awkward wording, but what I'm trying to describe is shown in the picture below. On the left is an NPC window from the 5E Advanced Effects extension and on the right is an effects window from the PC sheet, where, instead of self one can click and choose Targets.

24434

As can be seen, I was able to make the effect of destroying the AC of the target work on PC sheet easily, by coding AC: -1 and selecting Targeting: target , but there isn't an option to make it work with the NPC Effects, which doesn't have 'Targeting' option unfortunately.
So, I was thinking, if there is an option to choose the target of the effect (self or targets) with the PC effect, perhaps there is an option to code it (write it in the effect code field) with the NPC effect as well.

I guess, if it would be possible, the code would be something like: Destroy Armor; [TARGET]: AC: -1

It seems there isn't, or if there is I'm not familiar with a way to do it.


PS What I'm trying to say here is the effects coding and effects automation are potentially the most powerful features of Fantasy Grounds. This is the strength of this software, the ability to automate all functions, put them into relation with one another and automatically calculate the results of the rolls. I guess that's not too hard to code either, and it could be easily further developed to help us DMs run games. More games, more fun.

GavinRuneblade
August 27th, 2018, 01:29
Why not make an extra PC, take control of it as the DM, and put all the abilities on it?

You can add it to the map invisibly and use it to put the effects where you want them.

Skillkoil
August 27th, 2018, 01:41
Why not make an extra PC, take control of it as the DM, and put all the abilities on it?

You can add it to the map invisibly and use it to put the effects where you want them.

I approve of this idea!

Nyghtmare
August 27th, 2018, 04:38
I do this in my game and call the NPC "DUNGEON MASTER"... ;)

Gruber
August 27th, 2018, 10:06
Just what I'm doing, guys. But it's much easier to have NPCs and work with them from the menus than have a horde of PCs which I can't browse or search through at all. But, as I'm not working with random encounters almost at all rather prepare them in advance, I do just that - make a couple of PCs for those guys i need the most. Still, I see everyone's got some workarounds and always good to hear them, perhaps the next version will have improved effects with some of the community workarounds already included in the main software (I certainly hope so!).

lostsanityreturned
August 27th, 2018, 14:45
Oh, depending on how many big combats you run you might like an extension I created that allows you to force advantage and disadvantage rolls by holding control or alt respectively.

I should upload my updated version actually, not that I think anyone ended up picking it up -laughs-

I still need to take another stab at making it a bit more elegant functionality wise and add some extra modifiers in.

Gruber
August 27th, 2018, 16:22
Interesting. I am using quick buttons with shift and alt but it may come handy. Alas, there are a lot of extensions I use and so have to be careful and make sure they don't collide with each other.

GavinRuneblade
August 28th, 2018, 07:38
Just what I'm doing, guys. But it's much easier to have NPCs and work with them from the menus than have a horde of PCs which I can't browse or search through at all. But, as I'm not working with random encounters almost at all rather prepare them in advance, I do just that - make a couple of PCs for those guys i need the most. Still, I see everyone's got some workarounds and always good to hear them, perhaps the next version will have improved effects with some of the community workarounds already included in the main software (I certainly hope so!).

Gruber, I think you misunderstand. Do NOT make "a horde of PCs". Only make ONE ( 1 ) PC. Put all the effects on that one PC. Do not give the PC stats, levels, inventory, nothing. Only put the effects on it nothing else.

Gruber
August 28th, 2018, 09:10
Gruber, I think you misunderstand. Do NOT make "a horde of PCs". Only make ONE ( 1 ) PC. Put all the effects on that one PC. Do not give the PC stats, levels, inventory, nothing. Only put the effects on it nothing else.

Well, I haven't thought about that! Use her as a medium for effects. Good idea.

Skillkoil
August 29th, 2018, 00:25
Yeah you can drag effects from a PC action tab onto most everything that you can code on. I run a post-apocalyptic campaign with the 5E ruleset so I just have an invisible character sheet in the CT that has all my custom effects coded on it and I can drag and drop them on whatever I need. This way you can easily edit them or change names, effects, etc.. without searching through the effects button.