BuddhaSante Posted November 5, 2019 Share Posted November 5, 2019 (edited) Hey peeps, So I'm working on this weapon projectile script for TES 5 Skyrim SE/LE. what a pain, seems not many discussions have survived on this. As I know of it the script for the bloodskal blade is tied to that weapon and the property cannot be changed. So I believe a similar script needs to be made for each individual weapon which I am most willing to do if someone can school this scripting Noob :laugh:. I spoke with ChizFoShiz creator of Imbued weapons a while back and he said that a lot of the conversations on the topic were moved off site since Bethesda.net revamped. The weapon itself is complex requiring two projectiles, the weapon as well as enchantment with custom magic effect. Plus this big pain in the behind script to tie the projectiles to power attacks on the weapon. I have line code for this script as well as a more complex one I was able to dig up from a long dead forum post which I will leave in spoiler tags. The complex one activates on any hit and works for any weapon including fists. I have tried compiling these scripts myself inside and outside creation kit but it fails out. I believe it mentions the effect doesn't exist. I am unsure what that means. Do I need to put a custom effect in the code? First post in the author forums hope someone can shed some light on this for me. Base Script Scriptname SwordEffectScript extends activemagiceffectSpell Property SpellHoriz autoSpell Property SpellVert autoActor SelfRefEvent OnEffectStart(Actor akTarget, Actor akCaster)SelfRef = akCasterregisterForAnimationEvent(SelfRef, "AttackPowerStanding_FXstart")registerForAnimationEvent(SelfRef, "AttackPowerRight_FXstart")registerForAnimationEvent(SelfRef, "AttackPowerLeft_FXstart")registerForAnimationEvent(SelfRef, "AttackPowerBackward_FXstart")registerForAnimationEvent(SelfRef, "AttackPowerForward_FXstart")endEventEvent OnEffectFinish(Actor akTarget, Actor akCaster);;Automatically Unregisterd when Ability RemovedENDEVENTEvent OnAnimationEvent(ObjectReference akSource, string EventName)if (eventName == "AttackPowerRight_FXstart") || (eventName == "AttackPowerLeft_FXstart") || (eventName == "AttackPowerBackward_FXstart")SpellHoriz.cast(SelfRef)elseif (eventName == "AttackPowerStanding_FXstart") || (eventName == "AttackPowerForward_FXstart")SpellVert.cast(SelfRef)endifendEVENT Complex scriptName SwordsMagicScript extends activemagiceffectactor property selfref auto hiddenspell property OneHandedSpellForward autospell property OneHandedSpellStand autospell property OneHandedSpellSide autospell property OneHandedSpellBack autospell property OneHandedSpellForwardLeft autospell property OneHandedSpellStandLeft autospell property OneHandedSpellSideLeft autospell property OneHandedSpellBackLeft autospell property SpellForward autospell property SpellStand autospell property SpellSide autospell property SpellBack autospell property AxeSpellForward autospell property AxeSpellStand autospell property AxeSpellSide autospell property AxeSpellBack autospell property UnarmedSpellForward autospell property UnarmedSpellStand autospell property UnarmedSpellSide autospell property UnarmedSpellBack autospell property SpellBash autoFloat property Direction autoFloat property Speed autofunction OnEffectStart(actor akTarget, actor akCaster)selfref = akCasterself.registerForAnimationEvent(akCaster as objectreference, "PowerAttack_Start_End")self.registerForAnimationEvent(akCaster as objectreference, "AttackPowerStanding_FXStart")self.registerForAnimationEvent(akCaster as objectreference, "AttackPowerRight_FXStart")self.registerForAnimationEvent(akCaster as objectreference, "AttackPowerLeft_FXStart")self.registerForAnimationEvent(akCaster as objectreference, "AttackPowerBackward_FXStart")self.registerForAnimationEvent(akCaster as objectreference, "AttackPowerForward_FXStart")self.registerForAnimationEvent(akCaster as objectreference, "bashRelease")self.registerForAnimationEvent(akCaster as objectreference, "WeaponSwing")self.registerForAnimationEvent(akCaster as objectreference, "WeaponLeftSwing")endFunctionfunction OnAnimationEvent(objectreference akSource, String EventName)if EventName == "bashRelease"SpellBash.Cast(selfref as objectreference, none)elseIf EventName == "AttackPowerStanding_FXStart"SpellStand.Cast(selfref as objectreference, none)elseIf EventName == "AttackPowerForward_FXStart"if selfref.IsSprinting()SpellForward.Cast(selfref as objectreference, none)endIfelseIf EventName == "AttackPowerRight_FXStart" || EventName == "AttackPowerLeft_FXStart"SpellSide.Cast(selfref as objectreference, none)elseIf EventName == "AttackPowerBackward_FXStart"SpellBack.Cast(selfref as objectreference, none)elseIf EventName == "WeaponSwing"Direction = selfref.GetAnimationVariableFloat("Direction")Speed = selfref.GetAnimationVariableFloat("Speed")Bool PowerAttack = selfref.GetAnimationVariableBool("bAllowRotation")if PowerAttackif selfref.GetEquippedItemType(0) == 6if Speed == 0.000000AxeSpellStand.Cast(selfref as objectreference, none)elseIf Speed > 0.000000if Direction == 1.00000 || Direction == 0.000000if selfref.IsSprinting() == 0AxeSpellForward.Cast(selfref as objectreference, none)endIfelseIf Direction == 0.250000AxeSpellSide.Cast(selfref as objectreference, none)elseIf Direction == 0.750000AxeSpellSide.Cast(selfref as objectreference, none)elseIf Direction == 0.500000AxeSpellBack.Cast(selfref as objectreference, none)endIfendIfelseIf selfref.GetEquippedItemType(1) == 1 || selfref.GetEquippedItemType(1) == 2 || selfref.GetEquippedItemType(1) == 3 || selfref.GetEquippedItemType(1) == 4if Speed == 0.000000OneHandedSpellStand.Cast(selfref as objectreference, none)elseIf Speed > 0.000000if Direction == 1.00000 || Direction == 0.000000if selfref.IsSprinting() == 0OneHandedSpellForward.Cast(selfref as objectreference, none)endIfelseIf Direction == 0.250000OneHandedSpellSide.Cast(selfref as objectreference, none)elseIf Direction == 0.750000OneHandedSpellSide.Cast(selfref as objectreference, none)elseIf Direction == 0.500000OneHandedSpellBack.Cast(selfref as objectreference, none)endIfendIfelseIf selfref.GetEquippedItemType(1) == 0if Speed == 0.000000UnarmedSpellStand.Cast(selfref as objectreference, none)elseIf Speed > 0.000000if Direction == 1.00000 || Direction == 0.000000UnarmedSpellForward.Cast(selfref as objectreference, none)elseIf Direction == 0.250000UnarmedSpellSide.Cast(selfref as objectreference, none)elseIf Direction == 0.750000UnarmedSpellSide.Cast(selfref as objectreference, none)elseIf Direction == 0.500000UnarmedSpellBack.Cast(selfref as objectreference, none)endIfendIfendIfendIfelseIf EventName == "WeaponLeftSwing"Direction = selfref.GetAnimationVariableFloat("Direction")Speed = selfref.GetAnimationVariableFloat("Speed")Bool PowerAttack = selfref.GetAnimationVariableBool("bAllowRotation")if PowerAttackif selfref.GetEquippedItemType(0) == 6if Speed == 0.000000AxeSpellStand.Cast(selfref as objectreference, none)elseIf Speed > 0.000000if Direction == 1.00000 || Direction == 0.000000if selfref.IsSprinting() == 0AxeSpellForward.Cast(selfref as objectreference, none)endIfelseIf Direction == 0.250000AxeSpellSide.Cast(selfref as objectreference, none)elseIf Direction == 0.750000AxeSpellSide.Cast(selfref as objectreference, none)elseIf Direction == 0.500000AxeSpellBack.Cast(selfref as objectreference, none)endIfendIfelseIf selfref.GetEquippedItemType(1) == 1 || selfref.GetEquippedItemType(1) == 2 || selfref.GetEquippedItemType(1) == 3 || selfref.GetEquippedItemType(1) == 4if Speed == 0.000000OneHandedSpellStandLeft.Cast(selfref as objectreference, none)elseIf Speed > 0.000000if Direction == 1.00000 || Direction == 0.000000if selfref.IsSprinting() == 0OneHandedSpellForwardLeft.Cast(selfref as objectreference, none)endIfelseIf Direction == 0.250000OneHandedSpellSideLeft.Cast(selfref as objectreference, none)elseIf Direction == 0.750000OneHandedSpellSideLeft.Cast(selfref as objectreference, none)elseIf Direction == 0.500000OneHandedSpellBackLeft.Cast(selfref as objectreference, none)endIfendIfelseIf selfref.GetEquippedItemType(1) == 0if Speed == 0.000000UnarmedSpellStand.Cast(selfref as objectreference, none)elseIf Speed > 0.000000if Direction == 1.00000 || Direction == 0.000000UnarmedSpellForward.Cast(selfref as objectreference, none)elseIf Direction == 0.250000UnarmedSpellSide.Cast(selfref as objectreference, none)elseIf Direction == 0.750000UnarmedSpellSide.Cast(selfref as objectreference, none)elseIf Direction == 0.500000UnarmedSpellBack.Cast(selfref as objectreference, none)endIfendIfendIfendIfendIfendFunctionfunction OnEffectFinish(actor akTarget, actor akCaster)self.unregisterForAnimationEvent(akCaster as objectreference, "PowerAttack_Start_End")self.unregisterForAnimationEvent(akCaster as objectreference, "AttackPowerStanding_FXStart")self.unregisterForAnimationEvent(akCaster as objectreference, "AttackPowerRight_FXStart")self.unregisterForAnimationEvent(akCaster as objectreference, "AttackPowerLeft_FXStart")self.unregisterForAnimationEvent(akCaster as objectreference, "AttackPowerBackward_FXStart")self.unregisterForAnimationEvent(akCaster as objectreference, "AttackPowerForward_FXStart")self.unregisterForAnimationEvent(akCaster as objectreference, "bashRelease")self.unregisterForAnimationEvent(akCaster as objectreference, "WeaponSwing")self.unregisterForAnimationEvent(akCaster as objectreference, "WeaponLeftSwing")endFunction Edited November 7, 2019 by bonsante89 Link to comment Share on other sites More sharing options...
Thandal Posted November 7, 2019 Share Posted November 7, 2019 Which game? This topic belongs in the correct forum for the specific game. (I would have moved it for you, but you didn't even say.) Link to comment Share on other sites More sharing options...
BuddhaSante Posted November 7, 2019 Author Share Posted November 7, 2019 Yes sorry for Skyrim edited post to reflect Link to comment Share on other sites More sharing options...
Thandal Posted November 7, 2019 Share Posted November 7, 2019 Topic moved. Link to comment Share on other sites More sharing options...
Recommended Posts