A More Valid School of Magic

coletteSometimes I think Colette’s protests are a developer’s joke, because restoration in Skyrim has a lot of technical limitations. The most obvious one is that NPCs do not heal each other. You can jack up the restoration stats all you want. You can load them up with nothing but support spells, and they will opt to use their own fists.

With Valgus, we circumvented this by using a package that overrides his base combat. In other words, when the AI normally enters fight mode, the package is telling him to stop, collaborate and heal the player. Simply conditioning the package to check the player’s health ensures it doesn’t run the moment you step on a mudcrab.

However, when implementing Valgus’ heal mechanic, I forgot about the other restoration mage in the mod, the one associated with the Forgotten Lore quest. Luckily, user ShipoftheRisingSun was kind enough to point this out. The problem of course is the heal package takes a little while to load and may lock the NPC in place.

This more than anything is why I think NPCs don’t heal each other. For whatever reason it causes them to freeze as they scan for a target, and at times stay in place until the combat ends. This is a minor complaint for Valgus, seeing as he only has to heal the player and it’s not important that he move – but running “Heal Other” packages on hostile NPCs can run into the problem of having a fixed, frozen opponent.

You’ll notice in the video that the mage locks into place after healing his buddy. However, you may also notice that when the player approaches the mage, he breaks from his package and returns to his normal combat AI. This is just one of a number of conditions we can use to help make the Heal Other package run smoother during combat:

restomage

 

Here is the package and conditions we are going to use to override the Restoration Mage’s combat:

Get Distance – This is for when the package freezes in place. If the player gets too close, we want the mage to return to normal combat
GetinCell – The mage freezes completely if the package is running and he switches cells, so we want it to only run when inside. This ties nicely with Olivia‘s mention of cramped spaces, and the basic intent of the quest.
GetHealthPercentage of Mage – We don’t want the mage to heal others instead of himself. This ensures they have more than 40% health.
GetHealthPercentage of Quest Alias – Here, we’re checking to see if the bandit is less than 70% health but not dead, in case the mage tries to heal the dead bandit.


videospaceLastly, another tactic we can employ is attaching a script to each of the bandits. If one of them dies, a grand healing spell is cast by the mage. While there’s a slight bit of lag because I was running FRAPS, the healing effect in this video is the result of the bandit’s death triggering a script. This might be overkill at low levels, so I’ll definitely have to clone and tweak the spell, as well as widen the radius. Still, this will guarantee that some sort of healing effect will be cast provided you don’t kill the mage first. And if you attack the mage, they’ll heal themselves anyway. When it comes to self-healing spells, that does appear to be a valid option.

4 thoughts on “A More Valid School of Magic

    1. Yeah. Didn’t even know how to condition the dialogue. You can pretty much go from the first NPCs to the most recent ones and chart the evolution of my programming knowledge.

  1. This fight was pretty tough even when the mage didn’t heal his comrades. It’s going to be a killer once you put in the new packages. I LOOK FORWARD TO IT : D

    On a related note, hope you make these modding guides a regular thing. They are fun and informative. I can’t think of any other modder who has worked on as many quests as you, and these could be very helpful to people starting out on quest modding.

Leave a Reply to nonoodles Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.