PDA

View Full Version : Showcase: BG3-Style Spell GUI



GEONE
October 13th, 2023, 17:21
Hello! I just wanted to show off a personal extension I created that replicates the spell pop-up GUI in Baldur's Gate 3. My players were always frustrated by having to click on every spell they wanted to read and they liked BG3's info pop-ups that you get in the game when you hover over a spell. So I thought I'd try my hand at implementing that into FGU.

Short youtube video showcase:
https://youtu.be/d2xFfzHW7Fg

Here is the result! The spell GUI pops-up whenever you hover over a record link that leads to a spell, whether that's in the spell master list or on your character sheet.
https://i.imgur.com/Ux9Ol6Z.gif

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

All of the information that is displayed is parsed entirely based on the spell text. Even the icons they use are based on the spell's name (or damage type as a fallback, then certain keywords as a secondary fallback), but some spells just don't have any relevant icons, about 70% of spells have some sort of icon that can be associated with it automatically.

If the spell's text is multiple paragraphs, it will display a [...] icon indicating the spell's text has been truncated. You can press "T" to inspect the text and display its full description.

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

Spells added to your character sheet have additional information available that gets displayed on the pop-up, like if the spell is prepared and filling your spellcasting modifier in any spells that add it to the damage (like green flame blade), and also if you have any available spell slots to cast the spell. If you don't have a spell slot available of the spell's level, it a looks for the next available highest level spell slot (prioritizing pact magic slots), and if it finds no spell slots capable of casting the spell, it displays a small warning icon over the spell's spell slot icon.

https://i.imgur.com/9jqrmsj.png

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

It also parses various contexts in the spell's text to determine things like range, radius, saves, concentration, duration, additional damage, ongoing damage, delayed damage, variable damage types, and exclusive damage from chooses.

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

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

If a spell mentions a condition, it will highlight the condition in yellow and you'll have an option to press "F" to display a definition of all the conditions that appear in the spell.

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

The coolest part in my opinion is that the spell icon is displayed in chat whenever you attack, damage, or apply a condition using that spell. You can also choose your own custom icon for each spell using an in-game icon browser if you don't like default icon that is parsed for that spell. There are over 1,300+ spell and ability icons to choose from.

https://i.imgur.com/t2mn6KA.png
https://i.imgur.com/U025ERY.png
https://i.imgur.com/DhnigPt.png

bayne7400
October 13th, 2023, 19:39
That is really well done. I can tell you put some work into that.

Lawlesslisa
October 13th, 2023, 20:36
This looks really nice. Is it for 5e only?

Diablobob
October 13th, 2023, 21:41
I love it!!! It looks awesome! Keep up the great work! I look forward to seeing more!!!

~Bob

Klandare
October 14th, 2023, 16:16
This is very kewl.

Are you going to make this available for others to use?

How would it interact with homemade spells? Or spells from things like Fantasy Grounds 5E Effects Coding - Spells by Rob Twohy which allow for all the actions and tokens and such when adding it to the Action tab but the description is actually a link to the spell in the appropriate 5E book it came from?

GEONE
October 17th, 2023, 19:24
Are you going to make this available for others to use?

It's currently intertwined with a personal mega-extension, and separating out the code would be quite the undertaking. Not to mention, it isn't very practical as an extension for the average user; because the sheer amount of files, Fantasy Grounds hangs for half an hour when other players attempt to 'acquire file list' when joining (even though the extension itself is only about 50MB). See the linked thread below for more details. The solution is to send each of the players the extension externally and have them install it locally, which is an extra step that some people probably wouldn't understand that they need to do (and also wouldn't be compatible with the Forge).

https://www.fantasygrounds.com/forums/showthread.php?77541-Extension-icon-sprite-sheet-atlas-possible

There is also the legality of redistributing icon files from BG3, which would probably be a no-go (although I'm unsure of this because many mods for the game also redistribute texture files). The end user would need to provide the files themselves, which would be an insurmountable amount of work for someone to do (resizing, renaming, and reorganizing the thousands of icons into the format the extension expects). Maybe I'll get around to releasing a generic version of it one day, but that would also require updating it for the [current version] of FGU and the 5e ruleset, since I personally stick to using FGU 4.2.2 and an outdated 5e ruleset for compatibility with older extensions that are no longer being developed (hence the old leather theme in the screenshots and video).


How would it interact with homemade spells?

All of the information that is displayed is parsed entirely based on the spell text, there are no hardcoded spell GUIs. Homebrewed spells work exactly like official spells as far as the extension knows. Even the icons they use are based on the spell's name (or damage type as a fallback, then certain keywords as a secondary fallback).


Or spells from things like Fantasy Grounds 5E Effects Coding - Spells by Rob Twohy which allow for all the actions and tokens and such when adding it to the Action tab but the description is actually a link to the spell in the appropriate 5E book it came from?

If the link leads to a record that is a spell, it will detect that and display the pop-up. The only exception is links in formattedtextcontrols and in chat since those aren't exposed by the API for editing.

ddavison
October 17th, 2023, 22:46
That looks great. Good job.

JohnD
October 26th, 2023, 23:18
Oh very nice.