Jump to content

Sword that fires Thunderbolt when charged attack


CyranGE

Recommended Posts

Why not scripts? I hope you havnen't fallen for the myth that scripts will break your game? Most scripts are harmless, and only run when certain conditions are met, which makes them very stable!

 

Anyways. What you are trying to do can not be done without scripts(I think...). You need to find out when the player powerattacks, which is done via OnAnimationEvent after registering certain animations. Anyways, I made an enchantment on a sword which did something similar (Of course, this is a bit more complicated as the enchantment I had planned was a bit more.. tricky than just firing on power attack.)

 

 

Anyways. Here is my thread which shows the scripts used. I am not going to do it for you (My main PC crashed a few days ago...), but I can at least assist as I just did something similar myself!

http://www.darkcreations.org/forums/topic/9718-matth-learns-scripting/

 

Okay. Let me try to run you, or anybody trying, through what needs to be done to get a spell effect done on power attack. Basically, we are finding out exactly when the player uses a power attack, then we use a Spell.cast(Player) function, which instantly cast a spell without needing the actor(player here) to have the spell or have them cast it. It's the same thing the soul gems does when they shoot spells at you in ruins!

 

So, first of we need to track the power attack. If you plan to use a 2 handed greatsword, you can simply register the same animations Bloodskal uses. Otherwise we need to use a little trick. We will use a hidden perk to give the player this effect, which we add/remove on equip/drop/unequip of whatever weapon. So we add a magic effect at Constant and Self. We add it to a spell at Ability and then add it to a Perk and set it to Hidden.

The rough code for the magic effect will be:

Event OnEffectStart(Actor akTarget, Actor akCaster)
	
	selfref = akCaster
; ---------------------------------------------------------------------------------------------------------------------------

	registerForAnimationEvent(akCaster, "weaponSwing")		
		;if	registerForAnimationEvent(akCaster, "weaponSwing") as bool == True
			;Debug.Messagebox("Animations Register succesfull")
		;endif


; ---------------------------------------------------------------------------------------------------------------------------
	

EndEvent
 

	Event OnAnimationEvent(ObjectReference akSource, string EventName)
	
		If Game.Getplayer().GetEquippedWeapon(false) == MAT85AranedeanWeapon
			if eventname == "weaponSwing" &&\
				 selfref.GetAnimationVariableBool("bAllowRotation") &&\
		  		 !selfref.GetAnimationVariableBool("isBlocking") &&\
		  		 !selfref.GetAnimationVariableBool("isBashing") &&\
		  	 	 !selfref.GetAnimationVariableBool("isSneaking") &&\
                                  AwesomeSpell.Cast(ak)

	EndEvent

Okay. BAsically: Once the player gets the effect, the OnEffectStart starts. Here we must register the animation we plan to use. Now, to track a powerattack outside of the 2 handed greatsword, we will check for a lot of stuff. To avoid confusion: GetAnimationVariableBool will check if the animation is a powerattack without actually checking for a power attack. It works flawlessly.

 

Second we make a new event OnAnimationEvent, which starts as soon as the registered event happens. So we check if the player swings the sword; Then we check if it's a power attack by limiting the possibilitites. You can copy and paste all the GetAnimationVariablesBools. Then we tell the script to cast the spell.

 

A second note: This only worked with the weapon in the right hand. If you have the waepon in the left hand, you fire the spell with your righthand weapon(or unarmed). So I made sure to limit the effect only if you had the weapon equipped by doing Game.GetPlayer().GetEquippedWeapon(False) == MyWeapon. False means "Is it in the right hand?"

 

If you have never scripted before, then this tells you very little. Though if you find somebody with just the barest scripting experience (This was my first script, actually...) then they should be able to assist you further!

Edited by Matth85
Link to comment
Share on other sites

You shouldn't be! If the scripter is not absolutely retarded and ends up writing a 1000 line code that runs 4 infinite while loops, then scripts are nothing to be afraid of!

 

Anyways. I do not got my main PC aviliable (It sort of broke down... Now I use my study PC which is a HP Stream Notebook 13. Not much power!) so I can not assist you beyond what I have already done. I got all the codes in the thread and the logic explained.

 

Your choice is to learn how to script (Which, admitedly, is not hard. Papyrus is a very friendly language!), try to use what I have given you and make it work or hope somebody with some basic scripting knowledge comes about and takes what I just mentioned and makes it :)

 

Best of luck!

Link to comment
Share on other sites

The title says it all, a simple and script-free (if possible) mod that adds 1 sword(any name and mesh) in the game. . .

by charged attack, I mean power attack :smile:

It is already possible to do

http://www.nexusmods.com/skyrim/mods/43123/?

http://www.nexusmods.com/skyrim/mods/23416/?

 

-Download both mods

-Assign the thunderbolt spell to a ring through MCM using Smart Config

-Use More Hotkeys Please and assign the ring you created to a key.

-To get the effect desired, pick the key you use for power attacking.

-For instance, if you attack with your left mouse click and power attack holding left mouse click, set the hotkey to "press and hold" left mouse click, now anytime you perform a power attack, you will activate the spell ring and fire the desired spell at the same time. (it works the same way if you are using a controller)

Link to comment
Share on other sites

  • Recently Browsing   0 members

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