View Full Version : IF: Custom(..); .. doesn't work with lights?
Unclethan
January 24th, 2022, 23:43
I was attempting to use an effect to driver whether or not a token had light.
Using "IF: Custom(AnotherEffect); DMG: 2d6 fire" works as intended, whereby the "DMG: 2d6 fire" only works if "AnotherEffect" is on the token.
I had hoped that swapping "DMG: 2d6 fire" for "LIGHT: 30 torch" would work the same way. Unfortunately, it appears the light is always created, regardless of "AnotherEffect" being on the token or not.
Do we know if that is working as intended, or perhaps, a bug?
(I know the player can manage all of these independently, I am looking to key off of a specific Effect and it not be managed by the user)
Thanks!
Trenloe
January 24th, 2022, 23:46
It's working as intended, light effects aren't targetable so they don't work as conditional effects (IF, IFT).
Unclethan
January 25th, 2022, 00:57
It's working as intended, light effects aren't targetable so they don't work as conditional effects (IF, IFT).
I am not sure that is accurate. I do not see any information saying the statement after IF has to be "targetable".
https://www.fantasygrounds.com/wiki/index.php/5E_Effects says:
"A Note on IF and IFT
What both these functions do is test a condition and if it is found to be true then the next part of the statement will be carried out, otherwise it will be ignored."
and
"The difference between the two components is that IF looks at the source (i.e. the creature on which the effect is sitting) whilst IFT looks at the target of the creature on which the effect is sitting."
and
"IF: [condition OR conditional operator]: Ignores the remainder of the effect components within the effect label, unless the source actor has the specified condition."
My reading of that would imply that the IF should operate on the source, and then carry out the next statement or not depending on the truthiness.
Zacchaeus
January 25th, 2022, 03:32
Trenloe is quite correct. Read here https://fantasygroundsunity.atlassian.net/wiki/spaces/FGCP/pages/996642031/5E+Effects+for+Advanced+Automation#Effect-Targeting
Only effects with a (T) next to them are targetable.
Unclethan
January 25th, 2022, 04:50
Thanks Trenloe for the heads up and Zacchaeus for the clarification.
It may be helpful for future newbies if A Note on IF and IFT
"What both these functions do is test a condition and if it is found to be true then the next part of the statement will be carried out, otherwise it will be ignored."
Was updated to include -
"only if the next part of the statement is targetable (T). Non-targetable functions ignore the condition test".
Many thanks.
Kelrugem
January 25th, 2022, 13:36
Actually, about the wiki notes: IF can be combined with effects which are not targetable. However, there are exceptions like the lighting effects. I think this is due to that the lighting effects are CoreRPG based while the IF operator actually is based on the ruleset (here 5E) :) But just speculating; however, I am pretty sure that in general IF works usually with all effects (except lighting) because I often used that :) (may be also because of the general lighting code behind it)
Powered by vBulletin® Version 4.2.1 Copyright © 2026 vBulletin Solutions, Inc. All rights reserved.