Jump to content

[LE] Weapon Projectile Script


BuddhaSante

Recommended Posts

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 activemagiceffect

Spell Property SpellHoriz auto
Spell Property SpellVert auto

Actor SelfRef

Event OnEffectStart(Actor akTarget, Actor akCaster)
SelfRef = akCaster
registerForAnimationEvent(SelfRef, "AttackPowerStanding_FXstart")
registerForAnimationEvent(SelfRef, "AttackPowerRight_FXstart")
registerForAnimationEvent(SelfRef, "AttackPowerLeft_FXstart")
registerForAnimationEvent(SelfRef, "AttackPowerBackward_FXstart")
registerForAnimationEvent(SelfRef, "AttackPowerForward_FXstart")
endEvent

Event OnEffectFinish(Actor akTarget, Actor akCaster)
;;Automatically Unregisterd when Ability Removed
ENDEVENT

Event 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)
endif
endEVENT

 

 

Complex

 

 

scriptName SwordsMagicScript extends activemagiceffect

actor property selfref auto hidden

spell property OneHandedSpellForward auto
spell property OneHandedSpellStand auto
spell property OneHandedSpellSide auto
spell property OneHandedSpellBack auto

spell property OneHandedSpellForwardLeft auto
spell property OneHandedSpellStandLeft auto
spell property OneHandedSpellSideLeft auto
spell property OneHandedSpellBackLeft auto

spell property SpellForward auto
spell property SpellStand auto
spell property SpellSide auto
spell property SpellBack auto

spell property AxeSpellForward auto
spell property AxeSpellStand auto
spell property AxeSpellSide auto
spell property AxeSpellBack auto

spell property UnarmedSpellForward auto
spell property UnarmedSpellStand auto
spell property UnarmedSpellSide auto
spell property UnarmedSpellBack auto

spell property SpellBash auto

Float property Direction auto
Float property Speed auto


function OnEffectStart(actor akTarget, actor akCaster)

selfref = akCaster
self.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")
endFunction

function 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)
endIf
elseIf 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 PowerAttack
if selfref.GetEquippedItemType(0) == 6
if Speed == 0.000000
AxeSpellStand.Cast(selfref as objectreference, none)
elseIf Speed > 0.000000
if Direction == 1.00000 || Direction == 0.000000
if selfref.IsSprinting() == 0
AxeSpellForward.Cast(selfref as objectreference, none)
endIf
elseIf Direction == 0.250000
AxeSpellSide.Cast(selfref as objectreference, none)
elseIf Direction == 0.750000
AxeSpellSide.Cast(selfref as objectreference, none)
elseIf Direction == 0.500000
AxeSpellBack.Cast(selfref as objectreference, none)
endIf
endIf
elseIf selfref.GetEquippedItemType(1) == 1 || selfref.GetEquippedItemType(1) == 2 || selfref.GetEquippedItemType(1) == 3 || selfref.GetEquippedItemType(1) == 4
if Speed == 0.000000
OneHandedSpellStand.Cast(selfref as objectreference, none)
elseIf Speed > 0.000000
if Direction == 1.00000 || Direction == 0.000000
if selfref.IsSprinting() == 0
OneHandedSpellForward.Cast(selfref as objectreference, none)
endIf
elseIf Direction == 0.250000
OneHandedSpellSide.Cast(selfref as objectreference, none)
elseIf Direction == 0.750000
OneHandedSpellSide.Cast(selfref as objectreference, none)
elseIf Direction == 0.500000
OneHandedSpellBack.Cast(selfref as objectreference, none)
endIf
endIf
elseIf selfref.GetEquippedItemType(1) == 0
if Speed == 0.000000
UnarmedSpellStand.Cast(selfref as objectreference, none)
elseIf Speed > 0.000000
if Direction == 1.00000 || Direction == 0.000000
UnarmedSpellForward.Cast(selfref as objectreference, none)
elseIf Direction == 0.250000
UnarmedSpellSide.Cast(selfref as objectreference, none)
elseIf Direction == 0.750000
UnarmedSpellSide.Cast(selfref as objectreference, none)
elseIf Direction == 0.500000
UnarmedSpellBack.Cast(selfref as objectreference, none)
endIf
endIf
endIf
endIf
elseIf EventName == "WeaponLeftSwing"
Direction = selfref.GetAnimationVariableFloat("Direction")
Speed = selfref.GetAnimationVariableFloat("Speed")
Bool PowerAttack = selfref.GetAnimationVariableBool("bAllowRotation")
if PowerAttack
if selfref.GetEquippedItemType(0) == 6
if Speed == 0.000000
AxeSpellStand.Cast(selfref as objectreference, none)
elseIf Speed > 0.000000
if Direction == 1.00000 || Direction == 0.000000
if selfref.IsSprinting() == 0
AxeSpellForward.Cast(selfref as objectreference, none)
endIf
elseIf Direction == 0.250000
AxeSpellSide.Cast(selfref as objectreference, none)
elseIf Direction == 0.750000
AxeSpellSide.Cast(selfref as objectreference, none)
elseIf Direction == 0.500000
AxeSpellBack.Cast(selfref as objectreference, none)
endIf
endIf
elseIf selfref.GetEquippedItemType(1) == 1 || selfref.GetEquippedItemType(1) == 2 || selfref.GetEquippedItemType(1) == 3 || selfref.GetEquippedItemType(1) == 4
if Speed == 0.000000
OneHandedSpellStandLeft.Cast(selfref as objectreference, none)
elseIf Speed > 0.000000
if Direction == 1.00000 || Direction == 0.000000
if selfref.IsSprinting() == 0
OneHandedSpellForwardLeft.Cast(selfref as objectreference, none)
endIf
elseIf Direction == 0.250000
OneHandedSpellSideLeft.Cast(selfref as objectreference, none)
elseIf Direction == 0.750000
OneHandedSpellSideLeft.Cast(selfref as objectreference, none)
elseIf Direction == 0.500000
OneHandedSpellBackLeft.Cast(selfref as objectreference, none)
endIf
endIf
elseIf selfref.GetEquippedItemType(1) == 0
if Speed == 0.000000
UnarmedSpellStand.Cast(selfref as objectreference, none)
elseIf Speed > 0.000000
if Direction == 1.00000 || Direction == 0.000000
UnarmedSpellForward.Cast(selfref as objectreference, none)
elseIf Direction == 0.250000
UnarmedSpellSide.Cast(selfref as objectreference, none)
elseIf Direction == 0.750000
UnarmedSpellSide.Cast(selfref as objectreference, none)
elseIf Direction == 0.500000
UnarmedSpellBack.Cast(selfref as objectreference, none)
endIf
endIf
endIf
endIf
endIf
endFunction

function 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 by bonsante89
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...