PDA

View Full Version : 5E - Expending Spell Slots



xelab
September 15th, 2020, 19:24
This extension is fully superseded my other extension "5E - Spell Automation"
https://www.fantasygrounds.com/forums/showthread.php?62208-5E-Spell-Automation&p=544405#post544405


Hi all,

this is my first take on writing FG extension, so please be kind.


Main Feature: Expending spell slots on cast

This extension will automatically expend appropriate spell slot when you click on a star button ("use power" button).
If the character has both spell slots and pact magic slots the priority will be pact magic -> spell slots.
Upcasting spells is possible by first entering intended cast level. However, you will need to adjust the effect of the spell manually (in many cases as easy as right-clicking to add additional damage die).

https://www.fantasygrounds.com/forums/attachment.php?attachmentid=39389&d=1600193901



Additional feature: Delay hiding spells / powers without suitable slots

In "Combat Mode", the default behavior is to hide spells / powers without available slots immediately.
This is problematic if you (like me) prefer to first announce the spell (and expend the slot), and than apply its effects, since the spell may be hidden by that time.
You can switch to "Delayed Hide" mode by double-clicking "Upcast" field. In this mode powers will not be hidden until last action of the power is clicked or next power is cast or until the next power is cast. You can also refresh the view by clicking the "Upcast" field.
You can always switch back to "Normal" mode by double-clicking the "Upcast" field again. This setting should also be persistent between sessions.

https://www.fantasygrounds.com/forums/attachment.php?attachmentid=39390&d=1600193948



Additional feature: Pinning powers in Combat Mode

For some powers / spells it is useful to keep them always "pinned" in Combat Mode, even without available slots.
Good examples are Spiritual Weapon, Flaming Sphere, Hex and pretty much any spell with delayed effect / over-time effect / duration.
With this extension active you can "pin" any spell / power by adding "●" ("Black Circle" U+25CF Symbol) or "·" ("Middle Dot" U+00B7 Symbol) to its name.
Just copy paste the symbol and put it anywhere in the power name.
Since FG Classic does not support Unicode characters you can only use "·" ("Middle Dot") for pinning spells

https://www.fantasygrounds.com/forums/attachment.php?attachmentid=39391&d=1600193978



The extension was developed and tested for Fantasy Grounds Unity (but probably will work for Classic as well).
If you find any bugs please kindly let me know.

Versions:
1.0: Initial release
1.1: Updated compatibility with FG Classic
1.2: Further compatibility improvement with FG Classic (support for spell pinning)

xelab
September 15th, 2020, 20:27
[ Reserved ]

Stv
September 15th, 2020, 20:33
That sounds really good Xelab, nice work :)

BaneTBC
September 15th, 2020, 20:41
Looking very nice! Do you know if there are any conflicts with other extensions at this point?

xelab
September 15th, 2020, 20:44
Unfortunately not, I do not use many extensions myself, but I would like to ask you to try and let me know!

BaneTBC
September 15th, 2020, 20:46
Sadly at work presently and have a session tonight after I get out of work, so won't have a chance to tonight myself.

SmackDaddy
September 15th, 2020, 23:18
I have quite a few extensions, so I will try it this week and let you know of anything I find! Thank you!

Alanrockid
September 16th, 2020, 01:02
Testing in classic with my usual extensions... its giving me some console errors starting from the initial load, although it seems to be working fine.


Script Error: [string "actions_iedit"]:1: 'end' expected near '<eof>'
Script Error: [string "spell_upcast"]:1: 'end' expected near '<eof>'
Script Error: [string "button"]:1: 'end' expected near '<eof>'
Script Error: [string "button"]:1: 'end' expected near '<eof>'
Script Error: [string "button"]:1: 'end' expected near '<eof>'
Script Error: [string "button"]:1: 'end' expected near '<eof>'
Script Error: [string "button"]:1: 'end' expected near '<eof>'
Script Error: [string "button"]:1: 'end' expected near '<eof>'
Script Error: [string "button"]:1: 'end' expected near '<eof>'
Script Error: [string "button"]:1: 'end' expected near '<eof>'
Script Error: [string "button"]:1: 'end' expected near '<eof>'
Script Error: [string "button"]:1: 'end' expected near '<eof>'
Script Error: [string "button"]:1: 'end' expected near '<eof>'
Script Error: [string "button"]:1: 'end' expected near '<eof>'
Script Error: [string "button"]:1: 'end' expected near '<eof>'
Script Error: [string "button"]:1: 'end' expected near '<eof>'
Script Error: [string "button"]:1: 'end' expected near '<eof>'
Script Error: [string "button"]:1: 'end' expected near '<eof>'
Script Error: [string "button"]:1: 'end' expected near '<eof>'
Script Error: [string "button"]:1: 'end' expected near '<eof>'
Script Error: [string "button"]:1: 'end' expected near '<eof>'
Script Error: [string "button"]:1: 'end' expected near '<eof>'
Script Error: [string "button"]:1: 'end' expected near '<eof>'
Script Error: [string "button"]:1: 'end' expected near '<eof>'

xelab
September 16th, 2020, 21:44
Thanks a lot for reporting, it seems FG Classic does not correctly handle comments in Lua script nested in XML.
I have removed them and I do not get any error anymore in my testing.

xelab
September 17th, 2020, 07:13
And now I have also added support for "pinning" spells in FG Classic.
Extension should have feature parity in both version of FG.

eriktedesco
September 20th, 2020, 10:17
Hi Xelab! Wonderful extension, it solved part of my problems when dealing with lazy casters.

However, I have an issue. When I import the spell in a new character, for the spell from level 1 and above the use power button (the star) does not appear. I have tried with a vanilla situation (no extensions and modules loaded, except for yours).

How do you make the use power botton appear for spells?

Thank you very much for your extension and patience.

xelab
September 21st, 2020, 09:34
Hi Eriktedesco,

you need to set the spell as prepared (in preparation mode) first.
This is standard behaviour of FG.

eriktedesco
September 21st, 2020, 09:39
Hi Xelab, done that! Shame on me, I was pretty sure spell preparation was done already.

Thanks again!

Reg
September 25th, 2020, 16:20
Hey xelab

This is fantastic!!!

No conflicts detected so far with Critically AWesome extension, PreViewer, Coloured Sidebar & Improved Critical extensions running in build 24 Sept.

One request - the upcast features keeps track of the spell slot as advertised, and I'm familiar with right clicking to get the extra dice, but it still doesn't deal with the extra pluses - for example - Magic Missile

Zacchaeus
September 25th, 2020, 18:04
Hey xelab

This is fantastic!!!

No conflicts detected so far with Critically AWesome extension, PreViewer, Coloured Sidebar & Improved Critical extensions running in build 24 Sept.

One request - the upcast features keeps track of the spell slot as advertised, and I'm familiar with right clicking to get the extra dice, but it still doesn't deal with the extra pluses - for example - Magic Missile

Magic Missile should be cast one missile at a time. You shouldn't do the right click thing to cast it since you will get the wrong result. Also since you can cast the missiles at different targets it makes more sense to do it one at a time.

xelab
September 26th, 2020, 08:23
Please Note:

This extension is fully superseded my other extension "5E - Spell Automation"
https://www.fantasygrounds.com/forum...405#post544405

SturmDenmark
October 4th, 2020, 00:49
Hi,

First off great extension, would love to use it but it seems to conflict with some of the other extensions I'm using

- [Theme] 5E - SirMotte's Magnificent Darkness
This was easy to fix as setting the load order to after the theme (I set the loadorder to 180) seems to do the trick.

- 5E Enhancer
When opening the actions tab there are failing scripts, I haven't tried to solve it, so can't tell if this would be easy to fix.

Hop you will be able to look at it and maybe solve the issues, I would love to use the extension.

xelab
October 4th, 2020, 08:53
Hi,
Have a look at the post above yours