Jump to content

Bloodskal Blade Script


morgananinuala

Recommended Posts

Posted

There are two ways to do this.
Simple and complex.

 

Simple:

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

Works only with powerattacks from right hand\two handed weapon.

 

And 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

Works with any attack from any hand and any weapon (even with unarmed attacks).

 

Posted

Holy moly!

 

Ok, how do I set it to use custom spells for the effect?

 

In the first one, I take it I swap out 'spellhoriz' and 'spellvert' for the spell id?

 

What about in the complex one?

Posted

Holy moly!

 

Ok, how do I set it to use custom spells for the effect?

 

In the first one, I take it I swap out 'spellhoriz' and 'spellvert' for the spell id?

 

What about in the complex one?

No need to swap anything in this scripts.

 

Open Property window where you attach scripts and set what spells you need at corespondending properties.

Posted

 

Holy moly!

 

Ok, how do I set it to use custom spells for the effect?

 

In the first one, I take it I swap out 'spellhoriz' and 'spellvert' for the spell id?

 

What about in the complex one?

No need to swap anything in this scripts.

 

Open Property window where you attach scripts and set what spells you need at corespondending properties.

 

I'm sorry, what properties window?

 

Also, the CK seems to crash whenever I enter the script into the new script window...

Posted

When you attach this script to magic effect, click on it (in magic effect window), and select "properties" tab.

BTW, it's magic effect type script, so it should be attached to magic effect

in other words, you must not forget to make sure that when your sword is taken in hand, this magic effect with attached script also must be added to your character.

 

Simpliest way to do it all- use copy of vanilla "AbBlank" effect, attach one of my script to it, set what properties that you need, then make passive ability (spell) with this magic effect attached, then make perk with that spell attached, and in the end attach vanilla "silversword" script to your sword, with your new perk selected in properties.

 

P.s. my english is soooo terrible, sorry =)

Posted

When you attach this script to magic effect, click on it (in magic effect window), and select "properties" tab.

BTW, it's magic effect type script, so it should be attached to magic effect

in other words, you must not forget to make sure that when your sword is taken in hand, this magic effect with attached script also must be added to your character.

 

Simpliest way to do it all- use copy of vanilla "AbBlank" effect, attach one of my script to it, set what properties that you need, then make passive ability (spell) with this magic effect attached, then make perk with that spell attached, and in the end attach vanilla "silversword" script to your sword, with your new perk selected in properties.

 

P.s. my english is soooo terrible, sorry =)

Yeah, I figured out how to do that.

 

It's putting the script itself into game that's bugging.

 

I've got the script showing up, but it refuses to compile, and I'm not sure what I'm doing wrong.

 

Here, let me show you the esp, if you have a minute.

Liminal Nuclei.esp

Scripts.rar

Posted

Yeah, I figured out how to do that.

 

It's putting the script itself into game that's bugging.

 

I've got the script showing up, but it refuses to compile, and I'm not sure what I'm doing wrong.

 

Here, let me show you the esp, if you have a minute.

Your scripts archive is corrupted.
Posted

Wait a minute: Can I just create a differently named copy of the bloodskal magic effect, alter the properties to refer to my own spell, and then use THAT in a custom enchant?

 

Let me try that!

Posted

 

Yeah, I figured out how to do that.

 

It's putting the script itself into game that's bugging.

 

I've got the script showing up, but it refuses to compile, and I'm not sure what I'm doing wrong.

 

Here, let me show you the esp, if you have a minute.

Your scripts archive is corrupted.

 

I don't even know how to fix that.

 

You know what? Thanks for helping, but I think this whole thing is just a bit too complicated for my skills.

Posted

Wait a minute: Can I just create a differently named copy of the bloodskal magic effect, alter the properties to refer to my own spell, and then use THAT in a custom enchant?

 

Let me try that!

Not sure if it works.

"BloodSkal enchant" it's simple red glow without any additional effects or scripts, if I remember correct.

You know what? Thanks for helping, but I think this whole thing is just a bit too complicated for my skills.

Well, may be you return to this later, when you improve your modding skill =)
Posted

OK, I got the script into game (finally realized I needed to mod it OUT of Mod Organizer) and attached to a spell, which is attached to a perk, which is added by the silver sword script attached to the blade.

 

And it still doesn't work.

 

Can anyone help troubleshoot?

 

(also, weirdly, the sword is supposed to use Miraak's sword effect, but won't.)

 

EDIT: The sword in question is named Mora's Wrath, 111ApocryphaSword04.

 

Sword script is SwordScript01

Lim.rar

Posted

Well, NWM. Just strange CK crash =)

 

You attached wrong spell with wrong script (why you touched vanilla bloodskal script?) to your passive ability.

Here right spell and perk (I change one of your spell from acid spray to fireball, because "conc-type" spells does not work fine with this system, only "fire and forget-type" spells)

Since I do not hawe your weapon model I can not properly test how it works.

But when I add perk manually, and test weapon-spellcasting feature with another weapon - all works fine.

 

Liminal Nuclei.7z

 

Oh, and one small fact. Do not equip your sword (with attached silversword script) via console or via another script. If you do this, then when you equip the sword, no perks will be added to your character. It's limitation "on equiped" event from silversword script - it fires only with manual equipment of the item.

Posted

Well, NWM. Just strange CK crash =)

 

You attached wrong spell with wrong script (why you touched vanilla bloodskal script?) to your passive ability.

Here right spell and perk (I change one of your spell from acid spray to fireball, because "conc-type" spells does not work fine with this system, only "fire and forget-type" spells)

Since I do not hawe your weapon model I can not properly test how it works.

But when I add perk manually, and test weapon-spellcasting feature with another weapon - all works fine.

 

attachicon.gifLiminal Nuclei.7z

 

Oh, and one small fact. Do not equip your sword (with attached silversword script) via console or via another script. If you do this, then when you equip the sword, no perks will be added to your character. It's limitation "on equiped" event from silversword script - it fires only with manual equipment of the item.

That must be why the Miraak effect never worked, either!

 

Thank you, both effects work now!

Posted

That was a wild ride, lmfao. I'm gonna keep that "complex" version handy for myself.

  • 2 years later...
Posted

Master Azazellz. l like your's sword mod that you gave me before. This script on webpage you give me is can fix energy blast sent out while sneak light attack?  l need to keep energy blast while sneak power attack. But let me try. If something miss l report to you.

Posted
On 1/4/2020 at 9:14 PM, siwaton said:

l need to keep energy blast while sneak power attack.

It will be more difficult, because the “power attack” event was determined through the ability to rotate the character after "WeaponSwing" event start.

And, IIRC, you can't rotate your character while you attacking in sneak mode, so we can't split common attacks and power attacks.

 

UPD

After some testing, I noticed that while sneaking only power attacks in place and simple attacks trigger the effect. All other sneaking power attacks do not trigger an effect.

It seems that everything is more complicated than I though, and in this situation we need to make separate block in the script, or a separate script which will work only while sneaking.
Posted

tfw people barely even communicates, or searches anymore.

 

I made an extensive mod covering all kinds of bloodskal effects, so I might be the clostest thing to an expert in bloodskal beams on the internet lol

Btw, my mod was released with source code, and any authorship claims, I just ask for a simple mention.

 

On that script, everything you need to know about bloodskal beams is probably already there.

 

Sneaking can be disabled normally via 2 ways: either a condition limiting whatever magic effect you have controlling the beams casting (provided you used a sustained effect or an ability to contain the main script) or, simply by using a check on the script asking for conditions.

Which is what I used:

 

Event OnAnimationEvent(ObjectReference akSource, String EventName)

	If SelfRef.IsSneaking()
		Return
	EndIf

;Etc...

However, if I read the last posts right, then Azazellz is correct. Distinguishing between power attacks and regular attacks while sneaking will be problematic since bAllowRotation probably doesnt work the same way that it does while standing. It's more advisable to remove sneak beams entirely since they dont even make sense, gameplay-wise. Why would you openly declare your presence to the enemy with loud magic when stealth is the exact opposite of that? Just my opinion.

 

If you really and I mean REAALLY consider indispensable to keep sneak beams working, then you probably need a special block, starting the same as above, checking it's own conditions inside and deciding whether it should cast a beam or not. To be honest, I'm not sure there even is a way to pull that off since the variables dont seem to cooperate much on making the proper distinction while sneaking. You can always try Animation Catcher to see if any special animation event is triggered only while power-attacking and not with regular strikes, since bAllowRotation is off the table for sneak  hits.

 

Anyway. Feel free to check the script. Or dont. It's a free world.

BloodskalMagicScript.psc

 

Good luck.

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

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