Olgark Posted December 15, 2018 Share Posted December 15, 2018 I am currently make a follower mod and I tried to give the follower sun damage spells from the restoration skill tree. In combat against the undead it all works fine but when he attacks a living npc he will still use the sun damage spells, and of course this doesn't do anything to the living npcs. I was wondering if there is a way to get the follower AI to recognise when the target is a undead and then switch to the sun damage spells via a script command? I can see in the window target conditions for the spell but this is blank and thought that I might be able to make a spell up that is unique to the follower that will only effect the undead using this conditions window. Link to comment Share on other sites More sharing options...
Shivzz0119 Posted January 5, 2019 Share Posted January 5, 2019 (edited) You could try adding a script to the actor that adds/removes the perk from their List based on if their enemy has the keyword "ActorTypeUndead" Edited January 5, 2019 by Shivzz0119 Link to comment Share on other sites More sharing options...
Olgark Posted January 19, 2019 Author Share Posted January 19, 2019 I have looked through some sample scripts and come up with this so far. Scriptname LeftPawAlightsunspell Event OnCombatStateChanged(Actor akTarget, int aeCombatState) EndEvent if (akTarget == Game.GetActor().HasKeyword(ActorTypeUndead) AddSpell(DLCSunSpell) ElseIf (aeCombatState == 0) RemoveSpell(DLCSunSpell) EndIf EndIf EndFunction But I get a compile error saying line 6,0 EOF at if is wrong. This is my first foray into scripting and the script is supposed to add the spell to a custom follower I am making and then remove it when combat is finished. This is to stop them from using the spell on living targets. Any help would be appreciated. Link to comment Share on other sites More sharing options...
SeraphimKensai Posted January 19, 2019 Share Posted January 19, 2019 Try deleting your 2nd EndIf and see if it compiles. Link to comment Share on other sites More sharing options...
foamyesque Posted January 20, 2019 Share Posted January 20, 2019 Maybe use some combat-override AI packages for more precise control of what spells are cast at what targets? Link to comment Share on other sites More sharing options...
Recommended Posts