sMooDi31 Posted May 14, 2018 Share Posted May 14, 2018 (edited) I am trying to make a follower and i want him to use a specific spell on the start of every combat, i tried AI packages, Combat style and scripts but couldn't figure it out. i am a bit new to modding so help me please. edit : AI Packages attempt:made a usemagic package put it in a formlist and assigned it in the follower's combat override package list in ai packages tab, but when the combat starts he just uses the spell and then stands there doing nothing , and for some reason the enemy stops attacking anyone while still being detected as a threat/enemy(you can see the red dot on the compass and his health bar) Sctipts attempt: Scriptname PlayerCloneStartCombat extends ObjectReference bool Function RemoveSpell(Spell akSpell, bool abVerbose = true) native bool Function AddSpell(Spell akSpell, bool abVerbose = true) native bool Function DispelSpell(Spell akSpell) native bool Function HasSpell(Form akForm) native Spell Property MySpellAbility auto Event OnCombatStateChanged(Actor akTarget, int aeCombatState) if (aeCombatState == 0) DispelSpell(MySpellAbility) RemoveSpell(MySpellAbility) elseif (aeCombatState == 1) AddSpell(MySpellAbility) elseif (aeCombatState == 2) if(!HasSpell(MySpellAbility)) AddSpell(MySpellAbility) else endIf endIf endEvent made this script and put it in the actor scripts of the follower ,but this time he doesn't use the spell but he attacks the enemiesin this script i converted the spell into an ability and used addspell and i also tried the function cast with the original spell using a PlayerCloneRefwhen i checked the papyrus log i found the error "Unbound native function "AddSpell" called". Edited May 15, 2018 by sMooDi31 Link to comment Share on other sites More sharing options...
FaegenFeorhlif Posted May 15, 2018 Share Posted May 15, 2018 Hmm. Is the event itself working? What happens if you put Debug.Messagebox tests along with your AddSpell lines?Have you filled the property? Another way to make this work is to give your actor an ability spell with a condition "IsInCombat". Make the spell's magic effect Constant Effect and Archetype: Script. Then in the script, OnEffectStart, add your combat magic spell to the actor. Now every time your actor enters combat the condition will become true and the spell will be cast. Link to comment Share on other sites More sharing options...
sMooDi31 Posted May 15, 2018 Author Share Posted May 15, 2018 I just tested the event and the message box appeared ,so yeah it's working.and i tried your idea and it woks like a charm and it even gives more control, thanks you're a saint. Link to comment Share on other sites More sharing options...
Recommended Posts