Deleted31467970User Posted May 13, 2020 Share Posted May 13, 2020 (edited) Recently I started using CK, and I don't know how to do this. What I need to do to make a Contact Delibery spell to affect the caster, instead of apply the effect on enemies reached by the attack, or how can I do reference to a generic actor (like enemies, or actors from certain faction) inside Self Delibery spells, that is not Subject or Target? (in this case, "Subject" and "Target" it's the same). The effect that I want to get in the caster does not matter. Thanks in advance for your responses. Edited May 13, 2020 by Guest Link to comment Share on other sites More sharing options...
dylbill Posted May 13, 2020 Share Posted May 13, 2020 (edited) Hey, so if I'm understanding correctly, when you cast the spell, you want it to affect caster, but only if it hit a certain type of enemy? If so, you can keep the spell as is with Contact Delivery and put the condition GetFactionRank SomeFaction > 0 on the subject. Then you can put a script the your spell's magic effect that casts another spell on the caster: Scriptname MyModCasterScript extends ActiveMagicEffect Spell Property MyModCasterSpell Auto Event OnEffectStart(Actor akTarget, Actor akCaster) MyModCasterSpell.Cast(akCaster, akCaster) ;the caster casts the MyModCasterSpell on himself EndEventMake sure the spell used in the script is different that the spell the original caster uses. Also, name the spell in the script the ID name you gave it in the creation kit. Also name the script something unique to your mod. Compile the script, put it on your magic effect, then click properties and Auto Fill All. For compiling scripts I prefer to use Skyrim script compiler pro final: https://www.nexusmods.com/skyrimspecialedition/mods/31700/ Edited May 13, 2020 by dylbill Link to comment Share on other sites More sharing options...
Deleted31467970User Posted May 13, 2020 Author Share Posted May 13, 2020 (edited) hi, thanks for the sugerence. Second spell is casting when I get the first one, and not when I hit an actor. It would be easier to me if you explain the script. I have very little experience in coding, but I think I undestand most of the code. I don't think that the issue is in the script, I probably did something wrong, or Contact Delivery spells don't work like I think they do. Especially, what do you mean when you say "Spell Property MyModCasterSpell Auto" or "Auto Fill All"? (sorry if I have some error writing, I don't fully dominate English) Edited May 13, 2020 by Guest Link to comment Share on other sites More sharing options...
dylbill Posted May 13, 2020 Share Posted May 13, 2020 It it's casting the spell then it's filled correctly. Basically, the script uses assets in the Creation Kit. After compiling and attaching, you have to fill the script properties with the correct assets. If they are named the same in the script as in the creation kit, clicking Auto Fill All will automatically fill the script property with the correct creation kit asset. Maybe you need to change the delivery type to aimed and use a spell projectile. Look at the projectile the spell Heal Other uses, as it's invisible. Link to comment Share on other sites More sharing options...
Deleted31467970User Posted May 13, 2020 Author Share Posted May 13, 2020 (edited) I solved the problem with when the effect is apply, but it applies when the caster is reached by an attack, even changing the targed of the condition Edited May 13, 2020 by Guest Link to comment Share on other sites More sharing options...
Deleted31467970User Posted May 13, 2020 Author Share Posted May 13, 2020 (edited) Maybe I just make clear what I'm looking for xD what I'm trying to get is a constant ability to make an effect in the caster after hitting an actor Edited May 13, 2020 by Guest Link to comment Share on other sites More sharing options...
Deleted31467970User Posted May 13, 2020 Author Share Posted May 13, 2020 Is there any way to check caster is hitting somebody else in Self Delivery spells by scripting? Link to comment Share on other sites More sharing options...
Deleted31467970User Posted May 14, 2020 Author Share Posted May 14, 2020 I just realize that make a Contact spell a constant ability just make no sense xD but, how I can make reference to an object that is not the targed of the spell? Link to comment Share on other sites More sharing options...
Deleted31467970User Posted May 14, 2020 Author Share Posted May 14, 2020 disclaimer: with "hit" I mean weapon/unarmed hit, thought it was obvious for no reason. Link to comment Share on other sites More sharing options...
dylbill Posted May 14, 2020 Share Posted May 14, 2020 If that's the case, I would make your spell have a duration, a minute or something, and then use the OnHit event in the script. So, you cast the spell on an NPC, then when you hit the NPC with a weapon, it casts your boost spell on yourself. This would happen every time you hit the NPC while the spell is still active on them. The script would look like this: Scriptname MyMyCasterScript extends ActiveMagicEffect Spell Property MyModCasterSpell Auto Actor Caster Event OnEffectStart(Actor akTarget, Actor akCaster) Caster = akCaster ;saves the Caster NPC for later use with the OnHit event EndEvent Event OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, Bool abPowerAttack, Bool abSneakAttack, Bool abBashAttack, Bool abHitBlocked) If (akAggressor as actor) == Caster && abHitBlocked == false ;If this npc was hit by the Caster and the hit was not blocked. MyModCasterSpell.Cast(Caster, Caster) ;the caster casts the MyModCasterSpell on himself Endif EndEvent Link to comment Share on other sites More sharing options...
Recommended Posts