jrseriel Posted November 5, 2017 Share Posted November 5, 2017 Hello Nexus Community, Firstly, I am new to modding, and papyrus. I am trying to create a mod for a weapon when when you block the weapon casts the sparks spell. This was inspired by the spellbreaker shield effect but just on a weapon, and an aimed effect rather than it casting on yourself as the spellbreaker ward effect does. I tried to use the creation kit GUI to do this but I got an Enchanment error. Is there any other way to accomplish this? Thank you & best regards.-jr seriel Link to comment Share on other sites More sharing options...
GSGlobe Posted November 6, 2017 Share Posted November 6, 2017 (edited) 1.Create Enchantment "Contact"2.Make a new perk (name it whatever) -> Make new perk entry (Perk Entries Right click new) -> Check Entry point -> apply bashing spell -> sparks3.Create Magic Effect Contact4.On Magic Effect -> Apply Perk -> Choose your perk5. Add you Magic Effect to your enchantment Do note that concentration spells are abit wierd in this regard. For blocking I could help you but that would require a script to my knowledge to cast the spell, otherwise there's different perk entry points you could check out.Perhaps someone better could jump in with a different approach. For Block1. Create Enchantment "Contact"2. Create Magic Effect "Constant Self" "Script"3. Add this script -> add new script, "YourScript_Script" is replaced by whatever u want to call it4. Fill properties in5. Create Ability6. Link your newly created magic effect you just made to that ability7. create new magic effect "contact"8. On Magic Effect -> Equip Ability -> Choose your Ability you made9. Link effect to your enchantment10. link enchantment to weapon Scriptname YourScript_Script extends activemagiceffect actor myTarget ; References the actorSpell Property YourSpell auto ; References your spell, change property to sparks EVENT OnEffectStart(Actor Target, Actor Caster) myTarget = target RegisterForAnimationEvent(target, "blockstartout") ; Registering for block RegisterForAnimationEvent(target, "BlockStop") ; Registering for block stop ENDEVENT Event OnAnimationEvent(ObjectReference akSource, string asEventName) if (akSource == myTarget) if asEventName == "blockstartout" ; when block, this event happens. YourSpell.Cast(mytarget) ; Yourspell if asEventName == "BlockStop"; when u stop block this even happens myTarget.InterruptCast() ; interupt concentration spell "sparks" endif endif endEventEvent OnRaceSwitchComplete() ; event here needed if u ever transform so script starts again Utility.Wait(1.0) RegisterForAnimationEvent(target, "blockStartOut") RegisterForAnimationEvent(target, "BlockStop") EndEvent Best regards Edited November 6, 2017 by GSGlobe Link to comment Share on other sites More sharing options...
jrseriel Posted November 7, 2017 Author Share Posted November 7, 2017 (edited) Hey thank you for the possible solution. Though I see "on contact", sparks is an aimed concentration spell. So basically I would instead change it to a constant effect with no cost, so that when you block the weapon casts sparks wherever I am aiming. I may have misread or interpretted what is going on there, but this is what I am trying to do. Edited November 7, 2017 by jrseriel Link to comment Share on other sites More sharing options...
GSGlobe Posted November 7, 2017 Share Posted November 7, 2017 As far as weapon enchants goes, only a contact spell is an option. So how the above bashing perk entry work is that. When you bash "contact" with npc, the perk does its thing -> apply spell -> sparks to target npc. The way the block works is that, "contact" magic effect is just a placeholder for the ability, when you equip that weapon linking to the enchantment, you gain a Ability "which is always active while you have the weapon equipped", this ability registers for animation "block" start and block "out" meaning, when you block you cast sparks, when you stop blocking, it interupts the cast. Link to comment Share on other sites More sharing options...
jrseriel Posted November 7, 2017 Author Share Posted November 7, 2017 Thank you for the help. I will try this out tomorrow and see what I get! Link to comment Share on other sites More sharing options...
jrseriel Posted December 2, 2017 Author Share Posted December 2, 2017 I finally got around to trying this out. But I do not understand your script. If I copy and paste it I get compilation error. When I copy and paste this... Scriptname YourScript_Script extends activemagiceffect actor myTarget ; References the actor Spell Property YourSpell auto ; References your spell, change property to sparks EVENT OnEffectStart(Actor Target, Actor Caster) myTarget = target RegisterForAnimationEvent(target, "blockstartout") ; Registering for block RegisterForAnimationEvent(target, "BlockStop") ; Registering for block stop ENDEVENT Event OnAnimationEvent(ObjectReference akSource, string asEventName) if (akSource == myTarget) if asEventName == "blockstartout" ; when block, this event happens. YourSpell.Cast(mytarget) ; Yourspell if asEventName == "BlockStop"; when u stop block this even happens myTarget.InterruptCast() ; interupt concentration spell "sparks" endif endif endEvent Event OnRaceSwitchComplete() ; event here needed if u ever transform so script starts again Utility.Wait(1.0) RegisterForAnimationEvent(target, "blockStartOut") RegisterForAnimationEvent(target, "BlockStop") EndEvent Any help would be appreciated. Link to comment Share on other sites More sharing options...
GSGlobe Posted December 2, 2017 Share Posted December 2, 2017 (edited) Copy paste this into a script you make. Change Property "castSpell" -> Sparks Make this an ability and then link it to your enchantment or however you want it. Might need on race change if you ever transform into a werewolf or vampire so it begins to register again without reequipping the weapon / shield enchantment after your back in human form. spell property castSpell autoactor myTarget EVENT OnEffectStart(Actor Target, Actor Caster) myTarget = target RegisterForAnimationEvent(target, "blockstartout") RegisterForAnimationEvent(target, "BlockStop") ENDEVENT Event OnAnimationEvent(ObjectReference akSource, string asEventName) if (akSource == myTarget) if asEventName == "blockstartout" castSpell.cast(myTarget) elseif asEventName == "BlockStop" myTarget.InterruptCast() endif endifendEvent This part here,you can paste into the end of the script if you're going to be using a transformation. Event OnRaceSwitchComplete() ; event here needed if u ever transform so script starts againUtility.Wait(1.0)RegisterForAnimationEvent(target, "blockStartOut")RegisterForAnimationEvent(target, "BlockStop")EndEvent EDIT: I'll be happy to help if you write down your concerns or questions. Edited December 2, 2017 by GSGlobe Link to comment Share on other sites More sharing options...
jrseriel Posted December 3, 2017 Author Share Posted December 3, 2017 Thank you for all of your help. I was able to get this to work however, it causes my other effects on the enchantment to stop working. Link to comment Share on other sites More sharing options...
GSGlobe Posted December 3, 2017 Share Posted December 3, 2017 Cant help you If you dont Tell me what stopped working. Link to comment Share on other sites More sharing options...
Recommended Posts