PDA

View Full Version : 5E Extension - Chat Effects & NPC Variables



GEONE
August 9th, 2022, 18:42
Forge Page:
https://forge.fantasygrounds.com/shop/items/741/view

Description:
This D&D 5E extension does a few unique yet semi-related things. It parses effects outputted to chat from any source and converts them into a draggable effect. It also parses effects in NPC text blocks and adds them to the relevant Combat Tracker field. And finally, it allows math and variables to be used within NPC spells, traits, and actions.

(As a small aside, this extension also automatically fixes NPC's Mage Armor spell to give the correct amount of AC, instead of always just giving a +3 bonus to AC regardless of the creature's current AC and DEX as it does in the base 5E ruleset)

Effect Parsing:
This extension parses effects outputted to chat from any source and converts them into a draggable effect. The most common uses would be through a table output or /roll 0 {message} or /die 0 {message} chat commands.

https://i.imgur.com/VYveFgO.gif

This also works for table results that are outputted to chat, NPC spell/action entries in the Combat Tracker, and more.

https://i.imgur.com/armJ3ej.gif
(A table result being parsed into a draggable effect)

Syntax:
The syntax is a little bit custom. All effects are prefaced with "[EFFECT]" followed by whatever effects you want using the regular effect syntax. Each effect must end with a semicolon (even the final effect). After the final effect, the following tags can be provided to alter the default behaviour (words surrounded by <> need to be replaced and # is any number. Do not include the <WORD> or # in the actual effect)

Tags:
"[D: # <UNIT>]" - sets the duration of the effect and optionally the units of duration (min, hour, day. Defaults to rounds).
"[UNITS: <UNIT>]" - sets units of duration (min, hour, day) if for some reason you don't want to do so in the duration tag.
"[ROLL]" or "[ACTION]" or "[SINGLE] or [DUSE] (BCE only)" - sets the action expiry.
"[ATS] or [DTS] or [RTS] or [AS] or [DS] or [RS] or [AE] or [DE], or [RE], or [SAS] or [SDS] or [SRS] or [SAE] or [SDE], or [SRE]" - sets the BCE change state (BCE only).

Non-functional tags:
The following tags are implemented, but due to how Fantasy grounds handles untargetted effects, do nothing since their values are cleared on untargetted drops (which all from-chat effects are).
"[T: <TARGET>]" - Sets the targeting.
"" - Sets the source of the effect.
"[INIT: #]" - Sets the initiative order to expire the effect on.

All of these tags can only be provided for the whole [EFFECT] tag, meaning it isn't possible to define duration for individual effects within the effect text. Additionally, only one [EFFECT] tag can be defined per text box. The space after the colons are optional.

Examples:

[EFFECT] Stunned;


[EFFECT] RESIST: all; ADVATK; [D: 5 mins]


[EFFECT] DMG: 2d6 fire [D: 1] [ROLL]

Limitations:
This currently does not work for direct-to-chat messages, something must output a message to chat for it to parse effects within it. Using /roll 0 {message} or /die 0 {message} are the simplest ways to do this.

---

NPC Action Effect Parsing:
In addition to parsing effects in chat, this extension also parses effects in NPC stat block actions and spells. If a spell or action does not give you a draggable effect on the NPC record or CT entry, you can simply add an [EFFECT] tag to the bottom of that action and not only will it be highlighted and draggable, but it will also show up in that action's entry on the Combat Tracker.

https://i.imgur.com/ZDxdlPb.png

The following is no longer necessary, the square-bracket syntax works fine for effects in the combat tracker: You must use the Combat Tracker effect syntax for effects in the Combat Tracker. This means doing something like this "[EFFECT] AC: 5 (D:3 MIN)" to set the duration and "[EFFECT] AC: 5 (A:ROLL)" to set the expiry, as the above tags are ignored in the Combat Tracker (no space after the colon on these CT-specific tags, and they are positioned before the final semicolon of the last effect)

https://i.imgur.com/fYVak5k.png
(A custom weapon effect in a NPC action being parsed to the Combat Tracker)

MATH tag:
In NPC records and effects, you can also use a new tag [MATH:] which will parse simple mathematical equations inside the tag, like [MATH: 4+6]. It also supports some mathematical functions like floor(), ceil(), abs(), log(), min(), max(), sin() and others. This tag uses LuaXP to parse these math equations, so go checkout the github for more information: https://github.com/toggledbits/luaxp.

Note: If the final value of a math operation is a non-whole number, fantasy grounds will treat it as a 0, so it's best to round down the numbers (specifically CR) using floor() inside the MATH tag.

Variables:
There is also support for certain variables of creatures. Adding any of these variables anywhere in an NPC action or in any effect will replace the variable with the creature's corresponding stat. The available variables are as follows:

[AC] - The creature's Armor Class.
[HP] - The creature's maximum Hit Points.
[CURHP] - The creature's current Hit Points.
[CR] or [LVL] - The creature's Challenge Rating (converted to decimal form) or total level if it's a player. Both variables do the same thing regardless of PC or NPC.
[PRF] - The creature's Proficiency Bonus.
[STR], [DEX], [CON], [INT], [WIS], or [CHA] - The creature's ability modifier for the specified ability. Works with extensions that add new abilities.

These variables do not update in real-time and require the NPC record to be closed and reopened to reflect any changes to the base stat, or for the effect to be re-applied if the variable is inside an effect.

https://i.imgur.com/9bHhN3h.gif
(Variables being used inside an effect. Notice how the effect has different values when applied to different creatures. If this effect was applied from a PC character sheet, it would always use the player's stats instead of the target's.)

Examples:
This example is a weapon attack that adds the NPC's proficiency bonus to the attack roll, and rolls a number of d6 damage dice equal to the NPC's Challenge Rating with it's Dexterity modifier added to the damage.
https://i.imgur.com/PV1x1RY.png
For this particular NPC, the game treats this action as if it instead says "Melee Weapon Attack: +3 to hit, reach 5 ft., one target. Hit: 5d6 + 2 slashing damage." since the creature's CR is 5, Proficiency bonus is +3, and Dexterity modifier is +2.

This example is a breath weapon that adds five times the NPC's proficiency bonus to the DC of the Dexterity saving throw, and rolls a number of d6 damage dice equal to half the NPC's Challenge Rating rounded down, with it's Proficiency Bonus added to the damage.
https://i.imgur.com/SulpMG0.png
For this particular NPC, the game treats this action as if it instead says "Each creature in that area must make a DC 15 Dexterity saving throw, taking 2d6 + 3 fire damage on a failed save." since the creature's CR is 5 and its Proficiency bonus is +3.

---

[B]New Effect: REDUCE (Undo Damage/Heal extension only)
The REDUCE: x effect will reduce the last damage you took by x after you apply the effect. This can be used for things like Stone's Endurance to reduce the last damage you took when applying the effect by 1d12 (i.e. REDUCE: 1d12). The effect is automatically removed after applying it. "half" can also be used in place of a number for x (i.e. REDUCE: half).

Limitations:
The text-highlighting when hovering over draggable text is not always the correct size, and ends up underlapping or overlapping other text when used with variables and the MATH tag.
MATH tags with variables inside them do not work as expected when used in a PC's power/spell effects on the abilities tab of their character sheet; it applies variables based on the target's stats, not the caster's.

Compatibility:
This extension should be fully compatible with almost any extension. Unless another extension modifies PowerManager.parseNPCPower (which this extension overrides).

Changelog:
- Updated to v1.2.0
-- Now compatible with 5e 2024 ruleset update, thanks to Vaall
- Updated to v1.1.2
-- More bug fixes related to BCE integration.
- Updated to v1.1.1
-- Bug fixes related to BCE integration.
- Updated to v1.1.0
-- Many bug fixes. Added support for BCE extension (Thanks rhagelstrom), Added support for Undo Damage/Heal extension.
- Updated to v1.0.7
-- Updated Mage Armor effect to use new tag format.
- Updated to v1.0.6
-- Hidden table rolls will now be parsed for effects.
- Hotfix to v1.0.5.1
-- Nil chat message text will no longer throw an error.
- Updated to v1.0.5
-- NPCs can now have multiple EFFECT tags per line.
- Updated to v1.0.4
-- Added CURHP variable.
- Hotfix v1.0.3.1
-- Fixed issue with duration units.
- Updated to v1.0.3
-- All variables now work inside PC character sheets. The variables use the player's stats instead of the recipients', as per default FGU effect tag behavior.
- Updated to v1.0.2
-- Changed variable syntax to better match FGU player effect tags.
- Updated to v1.0.1
-- Added support for variables and math in effects.

GEONE
August 12th, 2022, 15:12
Updated to v1.0.3
- All variables now work inside PC character sheets. The variables use the player's stats instead of the recipients', as per default FGU effect tag behavior.

GEONE
August 17th, 2022, 02:52
Updated to v1.0.4
- Added CURHP variable. Removed chat debug.

GEONE
August 26th, 2022, 07:35
Updated to v1.0.5
- NPCs can now have multiple [EFFECT] tags per line.

https://i.imgur.com/1ywXjbd.png

rocketvaultgames
September 14th, 2022, 16:31
Is there any way to use the MATH function to cause an attack to deal double damage (not just double dice like a normal crit)?

My current workaround is to give the target a VULN: all effect before processing damage.

MeAndUnique
September 15th, 2022, 14:30
Is there any way to use the MATH function to cause an attack to deal double damage (not just double dice like a normal crit)?

My current workaround is to give the target a VULN: all effect before processing damage.

MATH seems like it would be able to cause the attack to do something like double strength as a damage bonus, rather than modifying the result after the roll. However, the Blissful Ignorance (https://forge.fantasygrounds.com/shop/items/429/view) extension provides the DMGMULT effect to multiply the bearer's damage totals.

rocketvaultgames
September 15th, 2022, 16:00
Thank you so much. That's exactly what I'm looking for (and already have it). There are so many great extensions out there... it's hard to remember which does what sometimes.

charmov
September 21st, 2022, 03:38
Hi there! I'm getting an error with this extension. The error is thrown when I try to advance the initiative with the "next actor" button. It doesn't seem to break the game otherwise. I use many other extensions and haven't tested this with a fresh campaign. When I turn this extension off and run all the other ones the error does not appear when advancing the initiative.

Thanks very much for making this!
54442

GEONE
September 21st, 2022, 09:17
Hi there! I'm getting an error with this extension. The error is thrown when I try to advance the initiative with the "next actor" button. It doesn't seem to break the game otherwise. I use many other extensions and haven't tested this with a fresh campaign. When I turn this extension off and run all the other ones the error does not appear when advancing the initiative.

Thanks very much for making this!
54442

Thanks for the report. One of those extensions must be outputting a chat message with no text whenever a new turn starts. I've added a nil check to rMessage.text for this extension, so it should no longer be an issue.

charmov
September 21st, 2022, 15:05
Thanks for the report. One of those extensions must be outputting a chat message with no text whenever a new turn starts. I've added a nil check to rMessage.text for this extension, so it should no longer be an issue.

Yup, just tested with your update. Error message gone! thanks!

obo
October 2nd, 2022, 16:46
Hi! Thanks for the great work! I am having a hard time using output from a table to generate an effect. I have made a simple table with the text (including the line break) like this:


Blah blah blah.
[EFFECT] Stunned;

Unfortunately it seems like the extension does not parse this:
https://www.fantasygrounds.com/forums/attachment.php?attachmentid=54566&stc=1&d=1664725149

Typing "/roll 0 [EFFECT] Stunned;" works as intended, and I can drag and drop the effect without problems:
https://www.fantasygrounds.com/forums/attachment.php?attachmentid=54567&stc=1&d=1664725167

What am I doing wrong here? :)

GEONE
October 2nd, 2022, 18:07
Hi! Thanks for the great work! I am having a hard time using output from a table to generate an effect. I have made a simple table with the text (including the line break) like this:


Blah blah blah.
[EFFECT] Stunned;

Unfortunately it seems like the extension does not parse this:
https://www.fantasygrounds.com/forums/attachment.php?attachmentid=54566&stc=1&d=1664725149

Typing "/roll 0 [EFFECT] Stunned;" works as intended, and I can drag and drop the effect without problems:
https://www.fantasygrounds.com/forums/attachment.php?attachmentid=54567&stc=1&d=1664725167

What am I doing wrong here? :)

It must be another extension that you have that's overriding the table output code. What extensions are you using?

obo
October 3rd, 2022, 18:14
It must be another extension that you have that's overriding the table output code. What extensions are you using?

This is probably the reason as we use about 20 extensions in total. That means my syntax was correct with the table output, so I will start the elimination process ;)

helarion
November 30th, 2022, 20:53
I'm having the same issue with my table effects and I seem to have found where it comes from.
Everything works fine if my table is in "Show roll results" but stops finding the effects when the results are hidden.

55307

I suppose it's not how it's supposed to work, I tested it without any other extension loaded and keep having the same results.

GEONE
December 1st, 2022, 22:34
I'm having the same issue with my table effects and I seem to have found where it comes from.
Everything works fine if my table is in "Show roll results" but stops finding the effects when the results are hidden.

55307

I suppose it's not how it's supposed to work, I tested it without any other extension loaded and keep having the same results.

Good catch! I've updated the extension so that hidden table results are also parsed now. The update should be available as soon as it's approved on the forge.

helarion
December 2nd, 2022, 11:07
Glad if I could help :D
Thanks for such a quick fix, i'll be sure to try it out once it's updated !

GEONE
January 21st, 2023, 18:43
Updated to v1.0.7
- Updated Mage Armor effect to use new tag format.
- Actually set the live build to the correct version on the Forge (derp).

rhagelstrom
April 27th, 2023, 17:48
I had a user request to have this extension have more harmony with Better Combat Effects cyclers. I've modded it to do that, attached. User Documentation is as follows


Syntax:
The syntax is a little bit custom. All effects are prefaced with "[EFFECT]" followed by whatever effects you want using the regular effect syntax. Each effect must end with a semicolon (even the final effect). After the final effect, the following tags can be provided to alter the default behaviour (words surrounded by <> need to be replaced and # is any number. Do not include the <WORD> or # in the actual effect)

Tags:
"[D: # <UNIT>]" - sets the duration of the effect and optionally the units of duration (min, hour, day. Defaults to rounds).
"[UNITS: <UNIT>]" - sets units of duration (min, hour, day) if for some reason you don't want to do so in the duration tag.
"[ROLL]" or "[ACTION]" or "[SINGLE] or [DUSE]" - sets the action expiry.
"[ATS] or [DTS] or [RTS] or [AS] or [DS] or [RS] or [AE] or [DE], or [RE], or [SAS] or [SDS] or [SRS] or [SAE] or [SDE], or [SRE]" - sets the BCE/G change state

NPC Action Effect Parsing:
In addition to parsing effects in chat, this extension also parses effects in NPC stat block actions and spells. If a spell or action does not give you a draggable effect on the NPC record or CT entry, you can simply add an [EFFECT] tag to the bottom of that action and not only will it be highlighted and draggable, but it will also show up in that action's entry on the Combat Tracker.

You must use the Combat Tracker effect syntax for effects in the Combat Tracker. This means doing something like this "[EFFECT] AC: 5; (D:3 MIN)" to set the duration and "[EFFECT] AC: 5; (A:ROLL)" to set the expiry, as the above tags are ignored in the Combat Tracker (no space after the colon on these CT-specific tags, and they are positioned before the final semicolon of the last effect). To set the BCE/G change state the format must be "(S:x)" where x is any of the change state shorthands listed above

GEONE
April 27th, 2023, 19:36
I had a user request to have this extension have more harmony with Better Combat Effects cyclers. I've modded it to do that, attached. User Documentation is as follows


Syntax:/[B]
The syntax is a little bit custom. All effects are prefaced with "[EFFECT]" followed by whatever effects you want using the regular effect syntax. Each effect must end with a semicolon (even the final effect). After the final effect, the following tags can be provided to alter the default behaviour (words surrounded by <> need to be replaced and # is any number. Do not include the <WORD> or # in the actual effect)

[B]Tags:
"[D: # <UNIT>]" - sets the duration of the effect and optionally the units of duration (min, hour, day. Defaults to rounds).
"[UNITS: <UNIT>]" - sets units of duration (min, hour, day) if for some reason you don't want to do so in the duration tag.
"[ROLL]" or "[ACTION]" or "[SINGLE] or [DUSE]" - sets the action expiry.
"[ATS] or [DTS] or [RTS] or [AS] or [DS] or [RS] or [AE] or [DE], or [RE], or [SAS] or [SDS] or [SRS] or [SAE] or [SDE], or [SRE]" - sets the BCE/G change state

NPC Action Effect Parsing:
In addition to parsing effects in chat, this extension also parses effects in NPC stat block actions and spells. If a spell or action does not give you a draggable effect on the NPC record or CT entry, you can simply add an [EFFECT] tag to the bottom of that action and not only will it be highlighted and draggable, but it will also show up in that action's entry on the Combat Tracker.

You must use the Combat Tracker effect syntax for effects in the Combat Tracker. This means doing something like this "[EFFECT] AC: 5; (D:3 MIN)" to set the duration and "[EFFECT] AC: 5; (A:ROLL)" to set the expiry, as the above tags are ignored in the Combat Tracker (no space after the colon on these CT-specific tags, and they are positioned before the final semicolon of the last effect). To set the BCE/G change state the format must be "(S:x)" where x is any of the change state shorthands listed above

Amazing! I've integrated these changed (along with a host of bug fixes, compatibility, and new features) into the latest update.

BlazingAzureCrow
August 5th, 2023, 11:51
I'm having some trouble getting the Better Combat Effects Gold cycler effects (like SRS) to work when making [EFFECT] tags on NPC sheets. Could someone give me an example of how one of those might be coded to change the cycler?

rhagelstrom
August 6th, 2023, 16:47
I'm having some trouble getting the Better Combat Effects Gold cycler effects (like SRS) to work when making [EFFECT] tags on NPC sheets. Could someone give me an example of how one of those might be coded to change the cycler?

Example:

/roll 0 [EFFECT] AC: 5; [D: 4] (S:AS)

BlazingAzureCrow
August 9th, 2023, 22:14
Example:

/roll 0 [EFFECT] AC: 5; [D: 4] (S:AS)

This didn't work either. When put into an action on an NPC sheet and then dropping that onto the Combat Tracker, the effect produced on the CT is just "[EFF: AC: 5 (D:4)" - the cycler state doesn't make it onto it. Just to be clear, this formatting is intended for the trait/action/bonus action/etc sections of an NPC sheet and not intended to just be dropped into the chat?

GEONE
August 9th, 2023, 23:14
This didn't work either. When put into an action on an NPC sheet and then dropping that onto the Combat Tracker, the effect produced on the CT is just "[EFF: AC: 5 (D:4)" - the cycler state doesn't make it onto it. Just to be clear, this formatting is intended for the trait/action/bonus action/etc sections of an NPC sheet and not intended to just be dropped into the chat?

I can't reproduce this issue, but I'm not exactly using the most up-to-date version of BCE. Both using "/roll 0 [EFFECT] AC: 5; [D: 4] (S:AS)" and putting "[EFFECT] AC: 5; [D: 4] (S:AS)" in a NPC record correctly add the effect "AC: 5" with a duration of 4. Try replacing (S:AS) with [AS] and see if that works for you.

rhagelstrom
August 9th, 2023, 23:47
I can confirm

It looks like this
58476

It should look like this
58477

BlazingAzureCrow
August 10th, 2023, 01:55
I can confirm

It looks like this
58476

It should look like this
58477

This is the issue. No arrangement properly produces the cycler state and the duration. Hopefully this gets fixed, because having these in NPC records in a game-changer.

GEONE
August 11th, 2023, 08:05
I've updated the extension to implement suggested changes by rhagelstrom.

BlazingAzureCrow
August 11th, 2023, 09:07
That seemed to fix the cycler issue! I do notice that if I have a duration in the effect, it's adding +1 round to it now. For example, "RESIST: all; [D:1]" is producing an effect with a duration of 2 rounds, [D:5] is producing one with 6 rounds, etc. Is this intentional?

GEONE
August 11th, 2023, 09:47
That seemed to fix the cycler issue! I do notice that if I have a duration in the effect, it's adding +1 round to it now. For example, "RESIST: all; [D:1]" is producing an effect with a duration of 2 rounds, [D:5] is producing one with 6 rounds, etc. Is this intentional?

No that's not intended

rhagelstrom
August 11th, 2023, 20:13
That seemed to fix the cycler issue! I do notice that if I have a duration in the effect, it's adding +1 round to it now. For example, "RESIST: all; [D:1]" is producing an effect with a duration of 2 rounds, [D:5] is producing one with 6 rounds, etc. Is this intentional?

If you are also using a BCE?G change state then maybe.. It depends. If everything that is the issue and change state is being added by this extension, then probably best to move over to the BCE/G thread(s)

BlazingAzureCrow
August 11th, 2023, 21:51
If you are also using a BCE?G change state then maybe.. It depends. If everything that is the issue and change state is being added by this extension, then probably best to move over to the BCE/G thread(s)

The duration issue happens when effects are added from the NPC sheets as per this extension, so I presume it has something to do with this extension's update. I'll play around and see if I can reproduce it without this extension and get back to you guys.

EDIT: After some testing, it only happens on effects applied using the "[EFFECT] etc; etc" format on NPC records, so I still presume it's this extension.

SECOND EDIT: It's happening sometimes and not other times. It's probably something on my end.

THIRD AND FINAL EDIT: It's working as intended. I'm just dumb.

Vaall
September 18th, 2024, 00:00
Hey,

Just to warn you but since the recent update of the 5e 2024 ruleset, your expansion no longer works. (I test with only your extension)

When adding NPCs to the CT, the names, effects, attacks and damage no longer appear in the NPC list (see image).
62024
Do you think you can fix this please?

Thank you,

GEONE
September 18th, 2024, 03:53
Hey,

Just to warn you but since the recent update of the 5e 2024 ruleset, your expansion no longer works. (I test with only your extension)

When adding NPCs to the CT, the names, effects, attacks and damage no longer appear in the NPC list (see image).
62024
Do you think you can fix this please?

Thank you,

Hello! I don't plan to support the updated version of the 5e ruleset that merged 2014 and 2024 into one ruleset. All my extensions are personal ones that I happen to share with this forum, and since I don't plan on updating the to the new version of the ruleset myself, I don't want to go through the effort of rewriting it to support a version I won't be using, especially given the inevitable onslaught of extension-breaking updates coming in the next few months as more of the source books release.

If anyone else is willing to update the extension, they're welcome to post any updated versions here in this thread. All my extensions are unencrypted, so you're welcome to unzip them and have a crack at updating them yourselves. I'll update the forge accordingly.

Vaall
September 18th, 2024, 07:04
Thank you for your quick response and I understand it (I don't think I used the 2024 rules either).

However, it is possible that I expressed myself badly because it is not a new 5E 2024 ruleset because FGU directly merged the 2 versions of D&D 5E into a single ruleset. It is then up to the GMs to choose in-game whether they prefer to have the NPC character sheets with the legacy or 2024 version.

In the case of the screenshot sent, the NPC remained in the Legacy version. As a result, your expansion has become completely unusable (it doesn't matter whether the GM wants to play with the legacy or 2024 rules).

BlazingAzureCrow
September 18th, 2024, 07:11
Just reinforcing the message above - the base 5th Edition use of this extension no longer exists because 5th Edition and 2024-5th Edition are both contained within the 5th Edition ruleset (a choice I wish they hadn't made) and so the changes to sheets and such are affecting existing 5E sheets as well. Though you may not want to support 2024 (which, fair!), I hope you'll update the extension to work for those of us who use it for 5th Edition games.

GEONE
September 18th, 2024, 08:37
I haven't updated the 5e ruleset on my computer yet (to the 'dual' version of the ruleset) and I don't plan to because of the above reasons, so I can't fix the extension to be compatible with it because I don't have the updated ruleset to understand what needs to be fixed to make it compatible. I have no spite against the 2024 version, I just don't want to personally use it and I don't want to go through the pain of figuring out which extensions that I rely on in my campaigns will be broken by the updates. I'm content with the current version of the ruleset I'm using. I'm very sorry for the disappointment, I just can't keep up with the constant updates and I like the stability and predictability of sticking to a singular version. I was really hoping the release of the 2024 rulebooks would mark a stability point in the 5e ruleset so I could use it as a sort of permanent stable release for extension-making, but I am frustrated that this was not the direction SW decided to pursue.

Vaall
September 18th, 2024, 15:09
I propose an update of the extension to correct following the update of the ruleset of 5E.
Hoping that it works for everyone.

If it is the case, is GEONE possible to add it on the forge after verification on your part?

GEONE
September 19th, 2024, 00:32
I propose an update of the extension to correct following the update of the ruleset of 5E.
Hoping that it works for everyone.

If it is the case, is GEONE possible to add it on the forge after verification on your part?

Big thanks! I've updated the forge.

obo
October 21st, 2024, 22:27
Hi all! After the 2024 update to FG I am getting an error message every time I mouseover over an NPC's traits and actions. I have disabled all extensions, but still the same error message appears (flooding the console log):

[ERROR] Script execution error: [string "5E:campaign/scripts/string_powerdesc.lua"]:50: attempt to get length of upvalue 'aAbilities' (a nil value)

Has anyone seen anything like this? I absolutely love this extension, and I use it a lot for my games :)

obo
October 23rd, 2024, 16:38
I have been using this extension a lot, but it has been disabled for a short time. When I enabled the extension again a few days ago, it startet spamming the console log with a lot of errors. I tried creating a new campaign with just this extension and a theme (D&D Classic), but it does not work. The errors appear when I mouseover the traits of an NPC. I am using the 5e 2014 ruleset.

These are the log entries that appear (I think the first one is when I load an NPC):
[10/23/2024 5:31:50 PM] [WARNING] Frame tabs contains out-of-range values in BottomLeft.
[10/23/2024 5:31:54 PM] [ERROR] Script execution error: [string "5E:campaign/scripts/string_powerdesc.lua"]:50: attempt to get length of upvalue 'aAbilities' (a nil value)
[10/23/2024 5:31:54 PM] [ERROR] Script execution error: [string "5E:campaign/scripts/string_powerdesc.lua"]:50: attempt to get length of upvalue 'aAbilities' (a nil value)
[10/23/2024 5:31:54 PM] [ERROR] Script execution error: [string "5E:campaign/scripts/string_powerdesc.lua"]:50: attempt to get length of upvalue 'aAbilities' (a nil value)
<snip> (It goes on and on when I move the mouse pointer over traits)

Do any of you have similar issues?

GEONE
October 23rd, 2024, 20:51
I have been using this extension a lot, but it has been disabled for a short time. When I enabled the extension again a few days ago, it startet spamming the console log with a lot of errors. I tried creating a new campaign with just this extension and a theme (D&D Classic), but it does not work. The errors appear when I mouseover the traits of an NPC. I am using the 5e 2014 ruleset.

These are the log entries that appear (I think the first one is when I load an NPC):
[10/23/2024 5:31:50 PM] [WARNING] Frame tabs contains out-of-range values in BottomLeft.
[10/23/2024 5:31:54 PM] [ERROR] Script execution error: [string "5E:campaign/scripts/string_powerdesc.lua"]:50: attempt to get length of upvalue 'aAbilities' (a nil value)
[10/23/2024 5:31:54 PM] [ERROR] Script execution error: [string "5E:campaign/scripts/string_powerdesc.lua"]:50: attempt to get length of upvalue 'aAbilities' (a nil value)
[10/23/2024 5:31:54 PM] [ERROR] Script execution error: [string "5E:campaign/scripts/string_powerdesc.lua"]:50: attempt to get length of upvalue 'aAbilities' (a nil value)
<snip> (It goes on and on when I move the mouse pointer over traits)

Do any of you have similar issues?

Oops, I forgot to set the updated version created by Vaall to be the live version on the forge. Please try now after updating the forge.

obo
October 24th, 2024, 06:39
Works like a charm! Thank you for the quick reply, GEONE! You have officially saved our 4-day D&D getaway that starts today :D

JuliTutu
November 20th, 2024, 22:32
Hello! I have a problem,
When I set an effect with a duration longer than one minute (for example: [EFFECT] CHA: -1; [D: 1 HR], or [EFFECT] CHA: -1; DUR: 3d6; [UNITS: DAY]) it is sets a duration of 1 round on the CT. I have tried every possible way.

Also, I can't set a duration of 0 for a non-expiring effect [D: 0], it always set a duration of 1. The way I found to make a non-expiring effect is with BCE (I have the BCEG): DUR: 0;

Thanks!
62668
62667

Zacchaeus
November 20th, 2024, 22:50
You can’t create effects from a table. Effects can be created either on the actions tab of player characters or in the effects dialog accessed from the tools.

Edit: forget that I didn’t see where this was posted before posting.

GEONE
November 20th, 2024, 22:58
Hello! I have a problem,
When I set an effect with a duration longer than one minute (for example: [EFFECT] CHA: -1; [D: 1 HR], or [EFFECT] CHA: -1; DUR: 3d6; [UNITS: DAY]) it is sets a duration of 1 round on the CT. I have tried every possible way.

Also, I can't set a duration of 0 for a non-expiring effect [D: 0], it always set a duration of 1. The way I found to make a non-expiring effect is with BCE (I have the BCEG): DUR: 0;

Thanks!
62668
62667

Hmm, I can't seem to replicate this first issue. It has a proper duration of 600 rounds when I tried the example in your screenshot. What other extensions are you using, and can you test with no other extensions for me?

https://i.imgur.com/GxsbWac.png

Also to get a non-expiring effect, just don't specify any duration at all:

https://i.imgur.com/KfIM2LO.png

JuliTutu
November 20th, 2024, 23:03
I'm using, In bold what I think it :

Advance Effects
Ammunition Manager
Aura Effects
BCEG
Bllissful Ignorance
Character Sheet Dice Tower
Coins Weight
Effect Builder
Effect Builder Plugin - 5e
Effective NPC
Encumbrance Tracker
Exhausted
Extraplanar Containers
Extraplanar Containers Custom Config
Generic Actions Layer
Jack of All Things
Life Ledger
Master's Amulet
Pets
Power Up
Prepared Enhancement
Rolling Mirror
Size Matters
TEMPO adn ROLLON effects
Turbo
Undead Fortitude
Walk This Way
Actions Abilities
Additional Storage
Advantages
Automatic Flanking and Range
Carrier
Floating Tabs
Generic Actions
Jack of All Trades
Polymorphism
Scribe
Equipped Effects
Map Parcel
Ammo Manager
Auto Wild Magic
Chat Effects
Height
Legendary Assistant
Reactions
Skill Floor
Bayne's Emporiom
MNM Consumable Items
MNM Module UI
MNM Spellcaster Helper
Random Spellbook
WindowSaverX2

(Yes, there are a lot)

GEONE
November 20th, 2024, 23:08
Could this be because the effects are from a table?

I doubt it, the effects are parsed based on the contents of the text itself when its outputted to the chat box, it shouldn't matter if it comes from a table or any other chat output.

I'll try testing from a table though just in case. I'm updating my FGU right now because it seems my version is a bit behind, perhaps something changed lately that has altered the way effect durations are specified.

GEONE
November 20th, 2024, 23:21
I doubt it, the effects are parsed based on the contents of the text itself when its outputted to the chat box, it shouldn't matter if it comes from a table or any other chat output.

I'll try testing from a table though just in case. I'm updating my FGU right now because it seems my version is a bit behind, perhaps something changed lately that has altered the way effect durations are specified.

I still can't seem to replicate the issue on the latest version of the 5e ruleset, even from a table it seems to work fine. I'm really not sure what could be causing the issue you're having.

https://i.imgur.com/OaNJHA1.png

Just in case, try testing without any other extensions and try copying this text exactly into your table and see if it works as expected:


[EFFECT] CHA: -1; [D: 1 HR]

JuliTutu
November 20th, 2024, 23:23
When I tried without others extension I works as intended. Now I'm looking what extension cause the problem

Later I'll post an update! Thanks!!

JuliTutu
November 21st, 2024, 03:01
I found it! The extension that makes the problem is Life Ledger by rhagelstrom I don't know why!
.

rhagelstrom
November 21st, 2024, 05:02
The roll isn't coming into onEffectRollDecode correctly. The nDuration is nil. (set with EffectManager.setCustomOnEffectRollDecode()) I disabled that in the Life Ledger code, but I think there is additional stuff that needs to happen in this ext to get the roll to decode correctly in all cases.

GEONE
November 21st, 2024, 05:40
The roll isn't coming into onEffectRollDecode correctly. The nDuration is nil. (set with EffectManager.setCustomOnEffectRollDecode()) I disabled that in the Life Ledger code, but I think there is additional stuff that needs to happen in this ext to get the roll to decode correctly in all cases.

In your custom decode function, you're trying to set rEffect.nDuration = rRoll.nDuration, but Roll records don't have an nDuration key, only Effect and Action records do (that's why its nil).
CoreRPG instead encodes effect duration as the roll's modifier, so you should be setting rEffect.nDuration = rRoll.nMod in your custom decode function

Here's the encode function from CoreRPG for reference:


function encodeEffect(rAction)
local rRoll = {};
rRoll.sType = "effect";
rRoll.sDesc = EffectManager.encodeEffectAsText(rAction);
if rAction.nGMOnly then
rRoll.bSecret = (rAction.nGMOnly ~= 0);
end
if aEffectVarMap["nDuration"] then
rRoll.aDice = rAction.aDice or {};
-> rRoll.nMod = rAction.nDuration or 0; <-
end
if fCustomOnEffectRollEncode then
fCustomOnEffectRollEncode(rRoll, rAction);
end
return rRoll;
end


EDIT: More robustly, you could set rEffect.nDuration = ActionsManager.total(rRoll) in your decode function.

You should probably also remove the line in your custom encode function that's setting the rRoll.nDuration, since nothing uses rRoll.nDuration (Roll records don't have a duration). rRoll.nMod should already be getting set to rEffect.nDuration in CoreRPG's encodeEffect function (which afterward calls the CustomOnEffectRollEncode that your custom encode function is set to) so the duration encoding is already being handled correctly before your custom encode function is called.

JuliTutu
November 22nd, 2024, 01:52
Hello again!

First of all! Thanks to both of you for the quick fix, it works now!

On the other hand, when I use the DUR effect (from BCEG) and set [UNITS: HOUR], for example: [EFFECT] Poisoned; DUR: 1d4; [UNITS: HOUR]; it sets a duration in rounds and not hours (the math should be [1d4]*600), is this another bug?

GEONE
November 22nd, 2024, 03:41
Hello again!

First of all! Thanks to both of you for the quick fix, it works now!

On the other hand, when I use the DUR effect (from BCEG) and set [UNITS: HOUR], for example: [EFFECT] Poisoned; DUR: 1d4; [UNITS: HOUR]; it sets a duration in rounds and not hours (the math should be [1d4]*600), is this another bug?

That would be the result of two different extensions having their own way of setting the duration of an effect. For example, my extension only multiplies the duration by units if the duration tag ("[D: x]") exists in the effect, because it knows where to look for that. My extension also does all its calculations the moment the effect is output to chat, so waiting on the result of a roll to determine the duration would require a lot of restructuring of the extension.

You would either need to set a fixed duration using the syntax of this extension, or set the BCEG duration using "DUR: 1d4*600;" if BCEG supports math in its duration tag. If BCEG doesn't support math in its duration tag, that would be a good feature to suggest on its forum page.

metaldm007
January 15th, 2025, 22:47
How did it take me this long to find this extension? I've been looking for adding effects to NPC sheets like this for years, and it's free!!

Amazing work.

GEONE
January 18th, 2025, 00:02
How did it take me this long to find this extension? I've been looking for adding effects to NPC sheets like this for years, and it's free!!

Amazing work.

Glad you like it :D

rocketvaultgames
January 18th, 2025, 18:28
Yes. Indispensable extension!

RobboNJ69
April 24th, 2025, 03:10
This extension looks awesome. How difficult would the coding be to port it to 3.5/PF1e? Thanks!

Vaall
March 5th, 2026, 13:14
As a big fan of this extension, I took the liberty of adding a small quality‑of‑life feature that mirrors what NPCs can already do — but directly inside Story blocks.

(The goal is mainly to streamline trap and hazard descriptions: instead of creating a dedicated Hazard NPC just to generate attack rolls, damage, or effects, you can now trigger these actions straight from the Story text.)

What this improvement does:
- Slightly shifts the Story text to the right to make room for an action icon.
- If the Story block contains an [EFFECT] or any text that can be parsed as an attack, damage, save, or heal (same logic as NPC abilities), an icon will appear.
- Dragging this icon onto a CT target will trigger the corresponding roll or effect.
- The icon type and visibility depend entirely on the content detected.
- Only the first valid action in the block is used (e.g., in “Melee Weapon Attack… Hit: …”, the icon will be for the attack).
- Since Story blocks have no real caster/source, the roll uses the active CT actor, which means their temporary bonuses (like ATK: 1) may apply.

I leave it up to GEONE to decide whether this addition should be pushed to the Forge for others to use.

I hope this might be useful for some GMs ;)