Larkinabout / fvtt-token-action-hud-core

Token Action HUD is a repositionable HUD of actions for a selected token.
14 stars 22 forks source link

[QUESTION]: adding a new spell group #272

Open Sillsoft42 opened 1 month ago

Sillsoft42 commented 1 month ago

I'm using a class from a module (Apothecary from Sebastian Crowe's Guide to Drakkenheim) and it has a different spell slot system setup. Is there a way I can get it so the spells I have placed on my character show up in the token action hud?

System: dnd5e 4.0.4

Larkinabout commented 1 month ago

What's the module? If they store them differently than spells, then the module might need to use Token Action HUD Core's hooks to add them to the HUD.

Larkinabout commented 1 month ago

Oh, it's a premium module, so they're probably not going to add support for Token Action HUD. You might need to create a separate module to do it, but it depends in what their class implementation is actually doing and how it's storing the spells in the actor. Unfortunately, I can't support it myself as I don't own the module.

Sillsoft42 commented 1 month ago

Yeah, that's what I figured. I have my own personal module that I could probably use to create the hooks. Could you tell me which hooks I would need to use as a starting point.

Looking at the actor object, they add the following item to the system.spells object on the actor. { "type": "apothecary", "level": 1, "max": 1, "value": null }

Sillsoft42 commented 1 month ago

I tried messing around today using the system template example and I haven't been able to make it very far so I'm probably doing something wrong. At one point, I did seem to get a new group to show up but now I can't even get that working again.

Larkinabout commented 1 month ago

I'll have to have a think how to do it on top of the system module. Ultimately, you'd need to add your group on the tokenActionHudCoreRegisterDefaults, add an extender of the action handler on tokenActionHudCoreAddActionHandlerExtenders, then also add an extender for the roll handler. The hook for the latter doesn't exist yet, but it's in development for the next release.

Sillsoft42 commented 1 month ago

I appreciate you looking into it. TAH is such a great module.

Sillsoft42 commented 6 days ago

So I'm taking another run at doing this and I've figured out how to add a new group but I'm stuck on the next steps.

I also don't fully understand what the 'action handler' does and what the 'roll handler' does

Which bit is the part where I look at an actor and figure out what items show up in this new group that I added.