Jump to content

Empowered Healing causes healing spells to trigger Scribe Scrolls effect [fixed]


Recommended Posts

Only installed the additional spells, spell tweaks, feats and NPC management, and the bug is pretty easy to reproduce though I have very little idea as to what triggers or causes it (reused splstat.ids values is my sole theory and it's only because Empowered Healing uses that). The bug consists of, after a cleric has chosen Empowered Healing, after casting any healing spell once, if any other spell is casted afterwards, the effects of having used Scribe Scrolls are applied (though not properly).

 

Further testing on an install with ONLY the feats system installed reveals that this still occurs, with Empowered Healing causing the Scribe Scrolls effect to occur after the first cast of any healing spell, leading the second spell to fail, and, if a third spell is cast, that spell targets the caster automatically yet still fails, but it is interesting that it changes the targeting behaviour.

 

image.thumb.png.bc00516312d79e791eabd5c2a9f8af33.png

 

Image and logs attached for the sake of it, don't think there is much point given how easily replicable this bug is.

WeiDU.log WeiDU.log

Edited by CrevsDaak
Link to comment
Posted (edited)

OK, I am pretty confident I've figured out what's causing this, it's the level boost that's required to trigger Scribe Scrolls, but at the same time used to discern which tier of Empowered Healing to apply.

The way I would fix Scribe Scrolls being triggered by any healing spell because of Empowered Healing is by changing the behaviour of how it is triggered, since if the spell ability that generates the scroll itself was to be put onto an external spell that went through opcode 326 via a particular spell state set by the innate Scribe Scrolls ability itself (same thing Empowered Healing does), then it would never trigger upon healing spells being cast, however, you'd be adding as many new spells as the game already has spells, which is not ideal. However, I do not have any better ideas. Doing this still conflicts with Empowered Healing so it's pointless.

And, on top of that, if a level boost is applied upon casting healing spells AT ALL, and nothing is changed, the maximum value for the post-boost level is used, which ends up giving a bigger heal at low levels (Cure Medium Wounds for example heals for 45 hp due to the base 15, plus 15 per level, times 1.5, while for example, at (real) caster level 8 it should heal for 35 instead).

One way of fixing this would be to add the required caster levels of the Empowered Healing variants to the spell ability headers of those triggered spells, meaning that, for example, sppr103d.spl would have its minimum casting levels raised to 201, 202, 203 etc instead of just 1, 2, 3 which just make the game use the maximum bonus for healing at the lowest level you can cast the spell at. Because there would be no overlap with Scribe Scrolls, I would also suggest making it so that lower required levels are used, since lv50 characters with bonus caster levels from other sources could end up hitting above 255 and thus the spell would have no effect. 75 and 175 would never overlap nor hit 255 for example.

 

Edit: this post is largely outdated, just leaving it up here for uhh the purpose of historical records...

Edited by CrevsDaak
Link to comment

Okay, I actually fixed both bugs, took me a while to get the SFO syntax right, but here it is. What I ended up doing is:

  • Changed the minimal and casting level boost for Scribe Scrolls to 195.
  • Changed the minimal and casting level boost for Empowered Healing 1 to 65, scaling further as the level requirement of healing spells go up.
  • Changed the minimal and casting level boost for Empowered Healing 2 to 130, scaling further as the level requirement of healing spells go up.
  • Made it so the Cancel Scribe Scrolls ability is removed after 60s via opcode 172.
  • The scaling changes to the level requirement on healing spells fixes the maximum healing amount bug. Now a lv8 caster will heal 35hp instead of 45 with Cure Medium Wounds.
  • The changes to the number of levels boosted and required to trigger the effects fix the bug noted in the OP. Note that all changes are required to accommodate for very high player levels.

Mostly just number changes on a lot of specific lines except for the three extra lines adding in the scaling and removing the Cancel Scribe Scrolls ability after some time. The numbers 65, 130 and 195 I chose because there's a good number of levels before each breakpoint can be reached in-game using regular caster level bonus, meaning it shouldn't ever break as long as nothing gives more than 10 bonus caster levels to a lv50 character.

Hope this helps!

 

empowered_healing.patch item_crafting.patch

Link to comment

This is quite weird actually. This was a clash I anticipated, and my testing showed that the level increase from the casting effect doesn't affect which header is initially selected (that is, the engine first selects which header to use, then applies a casting effect). But I can reproduce your result - specifically if I cast on 'tutor', but not when I've tested on self-cast or party-cast. It looks as if the casting-time effect *sometimes* causes more than one header to fire, but god knows just when!

I'll look at your solution, but this is erratic enough that I might try going in a different direction. Thanks for your help in identifying this.

Link to comment
4 hours ago, DavidW said:

This was a clash I anticipated, and my testing showed that the level increase from the casting effect doesn't affect which header is initially selected (that is, the engine first selects which header to use, then applies a casting effect).

That's partly correct, as the engine will always choose the highest required level ability header at the time of the spell being cast, but the targeting is set in place by what the player originally chose, which is limited by what the engine considers the spell's possible targets to be, which is not checked when the spell cast action is queued, because the engine does not know what specific header to use for the effects yet (seems like the level check is performed once the spell starts being casted) and thus is not able to detect what to target solely off the required level if the specific header has not been cast yet.

Casting the healing spell on a secondary target forces stats from one header (casting time, targeting), the one chosen by the player's choice of target at the time of commanding the action, to be used in conjunction with the effects the other, higher level one, because the header choice is partly carried out when the spell is targeted, and then the effects applied are from the one with the correct required level because the engine could already determine that. This only seems to cause issues with spells that have differing targets allowed at different required levels (which is why it hasn't been encountered until now), though I suppose it might also happen with casting speed and range.

2 hours ago, DavidW said:

OK, I think I've got this working directly off the spellstates (not sure why I didn't do that originally - probably I didn't understand opcode 326 at the time).

That's a pretty good idea, I didn't know that would work either since I assumed the stat check was performed on the target itself, but it's actually checking on its own target, and then applying the effects to the target inherited from the parent ability header. It's actually really nice that it works this way because this allows for really crazy stuff to be done (and fixes both bugs).

4 hours ago, DavidW said:

Thanks for your help in identifying this.

I'm glad I could help, thanks for putting this mod together, I've been enjoying it a lot.

Also, the single-line fix to removing the Cancel Scribe Scrolls ability fixes another, different bug, which is that if you rest after hitting Scribe Scrolls without doing anything, it's still there permanently (or, if you use it, gives you more uses of Scribe Scrolls). Very minor but it polishes how well it already works.

Link to comment

 

1 hour ago, CrevsDaak said:

Also, the single-line fix to removing the Cancel Scribe Scrolls ability fixes another, different bug, which is that if you rest after hitting Scribe Scrolls without doing anything, it's still there permanently (or, if you use it, gives you more uses of Scribe Scrolls). Very minor but it polishes how well it already works.

That's the addition at line 27?

Link to comment

Line 21 on the patch, yes, will be on line 91 if applied. It's this line:

 m.ab_fx.add{s_opcode=172 s_resource:="%spl_cancel_scribing%" s_timing=4 s_duration=60 s_target=1} // remove the cancel ability after 60s

I've also noticed that XP_PLACEHOLDER isn't properly replaced (unsure why, the code is there) and will show up upon Scribe Scrolls being used instead of the correct amount of XP.

Link to comment

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...