[v1.3.0+] Arcane Combat Tweaks

A place to post your add ons and ideas for them

Moderator: Moderator

Post Reply
Message
Author
Zizzo
Sher'Tul Godslayer
Posts: 2517
Joined: Thu Jan 23, 2003 8:13 pm
Location: A shallow water area south of Bree
Contact:

[v1.3.0+] Arcane Combat Tweaks

#1 Post by Zizzo »

So, recently fired up my first Arcane Blade since… [checks notes] 1.0.5. Most obvious change so far is the Arcane Combat talent's new configuration dialog. That has a few annoying wrinkles, though:
  • The dialog comes up every time you activate Arcane Combat, which is presumably why it doesn't automatically reset when you exit the levelup dialog — which, in turn, means you have to bounce the talent manually every time you level up.
  • Conversely, the only way to get to the dialog is by deactivating Arcane Combat, waiting for it to cool down, and reactivating it.
  • The only things you can configure Arcane Combat to do is use a single talent or use all talents. What if, say, I'm in Tempest Peak and I want Arcane Combat to use Flame and Earthen Missiles but not Lightning?
To fix these, I've whipped up a new addon, creatively named Arcane Combat Tweaks. :wink: It resolves these problems as follows:
  • The new game option "Arcane Combat configure on activate" can be disabled to suppress the configuration dialog on talent activation (hence the name), allowing the talent to auto-reset as needed.
  • Whether the above option is enabled or disabled, the configuration dialog is always available via the talent's right-click popup menu.
  • The configuration dialog itself is improved: each applicable talent can be enabled or disabled separately (you have to leave at least one enabled, though, or the dialog won't let you exit). You can configure talents that you haven't learned yet, so you don't have to remember to go back to the dialog and enable Earthen Missiles when you learn it; obviously, Arcane Combat will only randomly choose from talents you have learned and can cast.
Note that for now, Arcane Combat Tweaks is incompatible with Use Alchemist Gems From Inventory, as they both overload the UseTalents:use() method to modify the talent right-click menu. I'm hopeful that a future engine version will add hooks to modify this menu or some other suitable method; in the meantime, the character creation dialog will warn you if you try to create a character with both addons enabled.

[Technical notes:]

Code: Select all

Hooks:
  ToME:load [to modify the Arcane Combat talent]
  GameOptions:generateList [to add our game option]
Superload:
  mod.dialog.UseTalents:
    use() [overloaded, to add config option to Arcane Combat]
"Blessed are the yeeks, for they shall inherit Arda..."

HousePet
Perspiring Physicist
Posts: 6215
Joined: Sun Sep 09, 2012 7:43 am

Re: [v1.3.0+] Arcane Combat Tweaks

#2 Post by HousePet »

Zizzo wrote: [*] The only things you can configure Arcane Combat to do is use a single talent or use all talents. What if, say, I'm in Tempest Peak and I want Arcane Combat to use Flame and Earthen Missiles but not Lightning?[/list]
Why would you want to do that? Gwelgoroths are weak to fire. :P
My feedback meter decays into coding. Give me feedback and I make mods.

astralInferno
Uruivellas
Posts: 834
Joined: Mon Jan 27, 2014 10:40 am

Re: [v1.3.0+] Arcane Combat Tweaks

#3 Post by astralInferno »

...are applicable talents found manually, or does it look for the arcane combat flag? cause if so this will be Messy if used along with my arcane combat addon. xD

Zizzo
Sher'Tul Godslayer
Posts: 2517
Joined: Thu Jan 23, 2003 8:13 pm
Location: A shallow water area south of Bree
Contact:

Re: [v1.3.0+] Arcane Combat Tweaks

#4 Post by Zizzo »

HousePet wrote:Why would you want to do that? Gwelgoroths are weak to fire. :P
(shrug) If Flame is on cooldown, better to have something proc than nothing.
astralInferno wrote:...are applicable talents found manually, or does it look for the arcane combat flag? cause if so this will be Messy if used along with my arcane combat addon. xD
I made an effort to collect applicable talents the same way Arcane Combat itself does, involving… [sound F/X: source diving] checking for the 'allow_for_arcane_combat' field and using Arcane Combat's canUseTalent() method. If that's the wrong way to do it, I'm happy to fix it.
"Blessed are the yeeks, for they shall inherit Arda..."

astralInferno
Uruivellas
Posts: 834
Joined: Mon Jan 27, 2014 10:40 am

Re: [v1.3.0+] Arcane Combat Tweaks

#5 Post by astralInferno »

It's absolutely the right method! I'm just amused; my tweak sets like half the talents in the game to be allowed for arcane combat, so the list will end up Very Long if you use both. Not sure if that's a problem, and certainly not worth the effort it would take to fix, unless someone pipes up who's finding it an issue.

Zizzo
Sher'Tul Godslayer
Posts: 2517
Joined: Thu Jan 23, 2003 8:13 pm
Location: A shallow water area south of Bree
Contact:

Re: [v1.3.0+] Arcane Combat Tweaks

#6 Post by Zizzo »

astralInferno wrote:It's absolutely the right method! I'm just amused; my tweak sets like half the talents in the game to be allowed for arcane combat, so the list will end up Very Long if you use both. Not sure if that's a problem, and certainly not worth the effort it would take to fix, unless someone pipes up who's finding it an issue.
[sound F/X: source diving] Well, the new configuration dialog defaults to 80% game window height, and all the relevant bits have 'scrollbar=true' set, so I think it should scale up reasonably well.

In the meantime, pushing out the first bugfix release, v1a: I was botching the list of configured spells in Arcane Combat's talent tooltip, listing all of them instead of just the ones that are currently enabled. We Apologize for the Confusion.™
"Blessed are the yeeks, for they shall inherit Arda..."

Zizzo
Sher'Tul Godslayer
Posts: 2517
Joined: Thu Jan 23, 2003 8:13 pm
Location: A shallow water area south of Bree
Contact:

Re: [v1.3.0+] Arcane Combat Tweaks

#7 Post by Zizzo »

I thought that logic seemed hinky… :oops: See, the way I was doing it before, if you had, say, everything but Lightning configured for Arcane Combat proc, and everything but Lightning was on cooldown (or you hadn't learned them yet), we were telling the underlying Arcane Combat trigger function to just trigger anything at random — which, of course, could result in Lightning triggering, which is not what we want.

v1a.1, just pushed out, fixes this as follows: if all the enabled spells are unavailable, we pretend to the underlying trigger function that one of the unavailable spells was your sole trigger choice, so that the trigger code will think, "hmm, the configured spell's not available; oh well, guess we can't proc this turn after all", which works out to the intended behavior. We Apologize for the Inconvenience.™
"Blessed are the yeeks, for they shall inherit Arda..."

Zizzo
Sher'Tul Godslayer
Posts: 2517
Joined: Thu Jan 23, 2003 8:13 pm
Location: A shallow water area south of Bree
Contact:

Re: [v1.3.0+] Arcane Combat Tweaks

#8 Post by Zizzo »

Release v2 uses the new UseTalents:generate and UseTalents:use hooks added by DarkGod (thanks again!) to add our "Configure Arcane Combat spells" command to Arcane Combat's right-click talent menu. There should be no visible change in functionality, but we're now compatible with Use Alchemist Gems From Inventory (for all your really eclectic Adventurer needs :wink: ) — if you upgrade both addons at the same time.

[And another reminder here: if you're using this addon together with Restart Sustains or ZOmnibus, be sure to upgrade those addons when you upgrade this one.]
"Blessed are the yeeks, for they shall inherit Arda..."

silentsnack
Wayist
Posts: 23
Joined: Tue Feb 14, 2017 9:08 pm

Re: [v1.3.0+] Arcane Combat Tweaks

#9 Post by silentsnack »

Went slightly more insane than usual and kludged together an unholy-but-highly-magical fusion that combines Arcane Combat Tweaks with AstralInferno's Adventurous Arcane Combat and also threw in parts of Grayswandir's Arcane Blade Tweak for giggles.

Figured it would be decent to ask around for permission before I publish it separately, and also noticed that I can barely parse a lot of your code with all the hacks and workarounds, but one of the changes I made that makes your ACT run more smoothly was to have it not add unknown candidate talents to the list, because when using ACT and with Adventurous Arcane Combat it needlessly tries to cast a bunch of spells the player hasn't learned.

(edit: the attached file should be stable but is a few revisions out of date, but I'd rather not clutter up the entire forum uploading alpha versions I'm still not quite satisfied with enough to call them release-worthy)

edit2: finally got around to posting something - http://forums.te4.org/viewtopic.php?f=50&t=48220

Post Reply