View Full Version : 5E Enhancer

October 15th, 2019, 19:43
5E Enhancer

Current Version: v0.7.0.

A community extension I'm writing to improve D&D 5E in Fantasy Grounds Unity.

Design Goals

A rewritten minimalist streamlined version of the original 5E Combat Enhancer Classic (https://www.fantasygrounds.com/forums/showthread.php?47146-5e-Combat-Enhancer-(built-on-retired-GPL-Advanced-Kombat-extension)) including a number of broader ranged improvements for playing 5E, written for Fantasy Grounds Unity.


For a complete and up to date feature list, consult the GitHub ReadMe file here:

Some features are highlighted in the posts below.


The extension is available on GitHub here: https://github.com/StyrmirThorarins/FG-5E-Enhancer

1) Open the folder "- Extension Files" https://github.com/StyrmirThorarins/FG-5E-Enhancer/tree/master/-%20Extension%20Files
Download the latest version of the extension file: "5E-Enhancer v?_?_?.ext"

This is the actual extension, it includes the compressed codebase and a number of graphics.

2) Copy this file to your extension folder (example: Fantasy Grounds\Data\extensions\ [place file here] ).

3) Enable the '5E Enhancer v?_?_?' extension for your campaign in Fantasy Grounds.

Helping Out / Supporting :)

I've spent countless hours working on and writing the code used in this extension, since the start of its independent precursor the 5E Combat Enhancer Classic in December of 2018.

If you enjoy the extension and would like to show your appreciation or support future development of it. There's a couple of things you could do.

1) It would help me a lot if you "starred" the GitHub project by clicking the star to the right of the project name on the GitHub page of the project.


2) If you would like to send me a donation or contribution for my work on this extensions. Here is a direct PayPal link that you can use to buy me a beer, meal or something of the sort.


October 15th, 2019, 19:44
If you want to report a bug then please use this template.

Bug Report

Are you using Fantasy Grounds Unity? (I only support FGU with this extension. If you're using FG classic I'll refer you to finalized version of my 5E Combat Enhancer (https://www.fantasygrounds.com/forums/showthread.php?47146-5e-Combat-Enhancer-(built-on-retired-GPL-Advanced-Kombat-extension) instead.)

Is your FG software up to date?

Do you have the latest version of the extensions installed? (You can see the most up to date version number in the first post on page 1, the version number is printed in FG on start in the chat.)

How much memory is Fantasy Grounds using while the error occurs? (You can check this in the Task Manager if you're using Windows)

Please post the console error printout here:
(This is the error log window text. It can be opened by typing '/console' in the FG text window if it didn't open by itself. Also if there are no output errors, state that here.)

If you create a new (clean) campaign, does the error still occur, with ONLY the 5E Enhancer extensions enabled?

Can you recreate the error consistently?

What are the precise steps to recreating the error?

Does this always happen?

Does this only happen when using a specific module, map, NPC, PC, weapon, etc.?
(The more in depth information on which these are the better.)

Do you have a screenshot you could share?

Any further information that could help to replicate and trace the error?

October 15th, 2019, 19:45
Menu Options '5E Enhancer, Battle Map Settings'

- Automatic range modifiers: Enable range messages and automatic disadvantage on long ranges.
- Horizontal health bars: Enable horizontal health bars over tokens. 5 options available: Left aligned, default height | Left aligned, taller | Centered, default height | Centered, taller.
- Larger health dots: Enable larger health dots for tokens. 3 options available: FGU Default size | Larger | Largest.
- Show CT active actor underlay (DM only): Toggle to add underlay under CT active actor.
- Show faction/space underlay: Shows or hides the underlay added for tokens faction (friend/foe/neutral). Re-add tokens to update.
- Show reach underlay: Shows or hides the reach underlay added on hover for tokens. Re-add tokens to update.
- Stop token rotation: Stops token rotation as much as possible when mouse wheel is scrolled over token. Tries to reset it as turning straight up on mouse scroll.
- Token underlay opacity (GM only): Select the opacity of the graphical highlight underneath tokens when hovering over items in the combat tracker.

Menu Options '5E Enhancer, Window Resizing'

- New menu options that enable you to change your default window sizes for a lot of different types.

October 15th, 2019, 19:45
Features, Combat

- Delete tokens from map and CT with single mouse click.
Alt + left mouse-click on token on map, deletes the token from the map.
Alt + Ctrl + left mouse-click on token on map, deletes the token from the map and from the CT.
- Horizontal health bars, lightly transparent. Toggable in menu. Select health for tokens to be displayed as bars, select 'Combat Enhancer 5E > Horizontal health bars > On'. Add token from CT for new health bar.
- Larger health dot graphics for tokens. Toggable in menu. Add token from CT for new health dot.
- Automatic range finding from ranged attack. Toggable in menu. Disadvantage for medium to max range added automatically, sharpshooter feat negates this. Message output to chat.
- 'Reach underlay' and 'Faction/space underlay' made as toggle switches in the menu items. Re-add tokens to update.
- Active actor on CT token underlay made as toggle switches in the menu items. Clears all other underlays than the current actor.
- When an effect is dropped on a target in the CT or on a CT linked token on the map. If that target already has that effect, then it is removed from the target instead.
- Changeable opacity underlay for active actor. Controllable by menu item.
- Size of active actor underlay either full or half reach. Controllable by menu item.
- Blood splatters on token when taking damage. Controllable by menu item.
- Blood pools on tokens on death. Controllable by menu item.
- Add X or skull or no graphics onto token on death. Controllable by menu item.
https://raw.githubusercontent.com/StyrmirThorarins/FG-5E-Enhancer/master/Demo%20Images/Blood%20on%20token%2C%20skull%20or%20cross%20on%20 death.jpg

October 15th, 2019, 19:46
Features, Interface

- Content Share, allows you and your players to right click on spells, character feats, features and traits and post the descriptive text directly to the chat text by selecting the new 'Post Text in Chat' menu option at the bottom.
- New menu options in your settings, under '5E Enhancer, Window Resizing'.
Set as default window sizes on activation. But you can enable larger windows for any or all windows from the window menu.
Resizes windows on the fly to whatever setting you choose.
You can return to the default window sizes at any time.
If a window has been resized manually and is therefore in the 'windowstate.xml' file of your campaign, that takes precedence over the extension. This enables you to manually configure any windows you'd like.

October 15th, 2019, 20:07

October 15th, 2019, 20:23

October 15th, 2019, 20:49

October 15th, 2019, 20:49

October 15th, 2019, 21:20

October 15th, 2019, 21:21

October 22nd, 2019, 20:53

You the man.

Function Alpha state. :D

And with the widerspread Beta only 6 days away.

You the Man!

October 23rd, 2019, 05:33
Yay. I was worried about losing this one with the switch to Unity. Looking forward to trying it out and seeing what you can do with it.

October 24th, 2019, 15:40
It created a free GIT account, but it told me I couldn't star it at this time? :-(

October 24th, 2019, 17:25
It created a free GIT account, but it told me I couldn't star it at this time? :-(

You must goto your email and verify it.

October 24th, 2019, 19:40
Thank guys! :)

October 24th, 2019, 19:41
New version release, 5E Enhancer v0.3.2.

v0.3.2 (October 24th, 2019)
- Added code for window resizing. (scripts/window_resize.lua)
- Added menu items for window resizing. (5E Enhancer, Window Resizing)
- Changed menu name for battle map menu options for the extension, from '5E Enhancer' to '5E Enhancer, Battle Map Settings'.

October 29th, 2019, 05:34
I have to keep things vague due to the NDA.

But I'm aware of a few issues and an error message when running the extension under FGU Beta.

The source of the error message on start has been fixed, and I'll be looking into the other issues when I get the time.

I'll push a new release when ready.

ps. Keep in mind that while things are in beta some features may be awaiting implementation on the client until fully functional, or may behave erratically until things take their final form upon the official release.

October 30th, 2019, 03:56
As I now have a working version of FGU Beta in my hands I've updated the extension as needed for it to work there without as much fault as possible.
Certain functionality is awaiting changes in the FGU Beta before they will work properly.

New version release, 5E Enhancer v0.3.3.

v0.3.3 (October 30th, 2019)
- Bug: Missing element error message in Unity console. Fixed. Removed reference to missing element, "graphics/graphics_radial.xml" in extension.xml.
- Removed debug messages to chat for "Post Text in Chat". (scripts/content_share.lua)
- Larger health dot resized and repositioned. (scripts/health_graphics.lua: drawLargerHealthDot)
- Horizontal health bar resized and repositioned. (scripts/health_graphics.lua: updateHealthBarScale)

November 23rd, 2019, 20:11
New version release, 5E Enhancer v0.4.0

v0.4.0 (November 23rd, 2019)
- Added more menu option alternatives for 'Horizontal health bars'. 5 options available: Off | Left aligned, default height | Left aligned, taller | Centered, default height | Centered, taller.(scripts/health_graphics.lua: updateHealthBarScale)
- Rewriting of horizontal health bar scaling code. (scripts/health_graphics.lua: updateHealthBarScale)
- Added more menu option alternatives for 'Large health dots, settings'. 3 options available: FGU Default size | Larger | Largest. (scripts/health_graphics.lua: drawLargerHealthDot)
- Rewriting of larger health dot scaling code. (scripts/health_graphics.lua: drawLargerHealthDot)
- Maximum health dot size defined. (scripts/health_graphics.lua: drawLargerHealthDot)
- Removed all references for ruleset icons, only extension ones left. (graphics/graphics_icons.xml)
- Fixed missing folder from save graphics reference path. (graphics/graphics_icons.xml)

The extension may well work with FG Classic but it is not supported nor tested for FGC.

November 24th, 2019, 16:15
The health widget scaling is spot on for a 100x100 px grid size, but seems to go a bit off when on larger or smaller grids.
I'll look into it more when I get some more free time.

Three of Swords
November 30th, 2019, 01:30
I haven't been active on the forums for a while now, but I logged in to see the status of FGU and to see if this extension was going to be updated for FGU. Fortunately it is! Thank you, Styrmir. I already donated, but I may have to do so again because of this.

November 30th, 2019, 01:46
Thank you Three of Swords, always appreciated and helps to keep me motivated!

The extension is still in its early days (hence the < 1 version number), as FGU is still in beta and not all functionality in its final form yet. Still waiting on optimization as well as currently each restart to test a few new lines of codes out takes me 1-2 minutes. Which adds up very quickly I can tell you *laughs*.

But you can see the current roadmap on the GitHub readme if you're curious.

It's the main extension I use when I play my own D&D 5E games, and the way I want to run my games. And as I will be moving all my games over to FGU at first chance I am rewriting this new privately licensed extension from scratch to take the classic ones place.

Always great to see people enjoying my work and my contributions to the community!

December 4th, 2019, 13:26
Widget scaling and placement is behaving differently in FGC and FGU. The original scaling code demonstrates the same scaling issues in FGU, while working in FGC.
This might be a FGU bug, so I'm having to wait to see if this stabilizes with patching.

Moon Wizard
December 5th, 2019, 04:09
FGU token widget placement/size is based on percentage of token size. (Ie 100 = 100%; 50 = 50%)


December 6th, 2019, 15:32
Thanks Moon Wizard.

As widget.getSize() returns the pixel dimensions of the token. I had therefore assumed that bitmapwidget.setSize(x, y, [clipanchor]) did the same. The documentation wasn't quite clear on what the (number) parameters represented for that latter function.

But I've made some changes to the way the code works due to this, and now everything works at it should, many thanks!

Moon Wizard
December 6th, 2019, 21:03
We decided to change it in FGU, because we constantly had problems with figuring out the correct token widget sizing in FGC due to all the scaling factors (zoom, map graphic size, map grid size, token graphic size, token grid size, bitmap widget graphic size).

By specifying a percentage size, it gives the final widget size a reference point not based on graphic sizes.


December 7th, 2019, 00:24
That makes sense to me, sounds like a much better way to do it.

December 29th, 2019, 15:51
New version released v0.5.0

v0.5.0 (December 29th, 2019)
- Rewrote range finding code. It will now be the same as the range on the target arrow, as long as both tokens are inside a grid box. (scripts/automatic_range_modifier/range_finder.lua: getRange | scripts/ranged_attack_modifier.lua: getRangeModifier5e)
- Some changes to output text for ranged attacks. (scripts/ranged_attack_modifier.lua: getRangeModifier5e)
- Token health widget scaling for different grid and actor sizes fixed. Uses CT actor size descriptor text (tiny/small/medium/large/huge/gargantuan) to determine horizontal health bar width. (scripts/health_graphics.lua)

January 4th, 2020, 21:20
New version released v0.6.0

v0.6.0 (January, 4th, 2020)
- When an effect is dropped on a target in the CT or on a CT linked token on the map. If that target already has that effect, then it is removed from the target instead. (scripts/token_effects_handler.lua, scripts/helper_functions.lua)

January 6th, 2020, 18:33
Also just chiming in. I absolutely love this extension, and use it all the time. I've also donated. :) And I even use it with FG Classic. It does not conflict with my Improved Critical extension which is awesome. The only real issues I have run into (besides trying to use functionality that isn't there yet...hehe) are related to conflicts with the Advanced Effects extension, but I'm a software engineer in real life so I use those conflicts as exercises in figuring out the LUA code and scripting and what not.

Keep up the awesome work!

January 7th, 2020, 03:16
Thank you TheoGeek, much appreciated! :)

I'm in the middle of working on v0.7.0 now, which should add blood on tokens on damage thresholds, skulls or crosses on token death, varied opacity for active actor underlays (DM only), varied underlay sizes (DM only), fixing of an error that was accidentally left on 0.6.0 push (clicking on tokens may cause an error), and possibly even blood pools on token death.
All this comes with a number of new menu option settings as well to allow users to modify these things to the way they prefer them in their games.

January 8th, 2020, 21:14
Minor issue found. I have FG-5E-Enhancer v0.6.0 and found [ERROR] icon: Could not find image file (graphics/token/blood_pool_pool/blood_pool_1.png. Its showing for ...1.png through ...10.png as well. I found that in your .ext, it is trying to find /blood_pool_pool/, but the token is listed under /blood_pool/ only. I was able to fix it on my end, but wanted to bring that to your attention for future updates. Thanks for your hard work on this extension. It is fantastic!

January 8th, 2020, 21:43
Cheers, this has already been fixed for the next iteration, along with another error that snuck in there.

Glad to hear you're enjoying it, next update has a lot of new upcoming items as mentioned above, possibly including a height widget as well.
Most of these are already partially working, but it will require more work to get them working fully.
So next version is likely to be a large feature update.

Can't remember if I already included the switch for turning on or off blood pools in the menu options in version 0.6.0. If so turning it off for now should circumvent that bug during play.

January 8th, 2020, 21:45
Awesome, keep up the good work!

January 21st, 2020, 04:25
Next version almost ready. Hopefully I'll get some more time to work on the extension during the weekend to get things ready for release.
Fixes a number of bugs in the current version and adds numerous additions.

January 21st, 2020, 04:30

January 23rd, 2020, 07:13
v0.7.0 Released :)

- Blood splatters on token when taking damage. Controllable by menu item.
- Add X or skull or no graphics widget on token death. Controllable by menu item.
- Blood pools on tokens on death. Controllable by menu item.
- Minimized horizontal health bar to 0% health, would go into the negative direction as a grey bar.
- Changeable opacity underlay for active actor. Controllable by menu option.
- Size of active actor underlay either full or half reach. Controllable by menu option.
- Fixed a number of bugs that popped up during use of previous version.

https://raw.githubusercontent.com/StyrmirThorarins/FG-5E-Enhancer/master/Demo%20Images/Blood%20on%20token%2C%20skull%20or%20cross%20on%20 death.jpg

Blood pools are currently widgets underneath other widgets on the token. I haven't decided if I'll change this to separate blood tokens on the map.
Height widgets are on hold due to potential FGU bug. I have it working in FGC, but the rendering is faulty in FGU for now. Therefore the menu item remains but the functionality has been disabled in the code.

January 27th, 2020, 20:47
Has always, it is a great extension, please buy some coffee (or whatever could help you in your work !) with my humble second donation, you really deserve it.

January 28th, 2020, 03:04
Thank you Bunnyhunt3er I shall, appreciate it! Enjoy the extension. :)