Cloak effect on sword

Post » Sat Nov 17, 2012 11:27 pm

I'm trying to add a cloak enchantment to a sword, the cloak would have to cast when the sword is equipped.
I made the magic effects and enchantments, but the creation kit doesn't let me add the enchantment to the weapon, simply it doesn't show on the list. It seems that weapons can't handle constant effects or self effects. There is any workaround for this? I'm new to scripting and I have trouble with papyrus. Thank you
User avatar
Andrea Pratt
 
Posts: 3396
Joined: Mon Jul 31, 2006 4:49 am

Post » Sat Nov 17, 2012 8:42 pm

you can do what the silver weapons do and use the same script (silverswordscript). but instead of filling the silver perk for the perk property, create a new perk with your magic effect as the perk's ability (entry point ability). that way the weapon will add/remove the perk when equipped/unequipped...... sort of.

there is a bug with hotkeys that breaks the script. if the player uses hotkeys to switch between weapons, the OnEquipped/unequipped lines in the script will not fire, and your perk sync will be thrown off (this is the case with all of the vanilla silver weapons as well)


another approach would be to use the same custom perk, and automatically give it to the player (via immediate quest or whatever), and condition it so that the ability will only activate when the sword is equipped. i'm not sure what condition is the weapon equivalent of WornHasKeyword, but i am sure one of those condition functions will allow you to weed out just your sword either via magic effect keyword or something similar.

if you want this ability to be used by NPCs as well, you can make the ability as a spell instead of a perk
User avatar
Farrah Lee
 
Posts: 3488
Joined: Fri Aug 17, 2007 10:32 pm

Post » Sat Nov 17, 2012 6:00 pm

Is that a cloak effect on just the sword as in the sword becomes invisible not the player?
User avatar
Justin Bywater
 
Posts: 3264
Joined: Tue Sep 11, 2007 10:44 pm

Post » Sat Nov 17, 2012 5:17 pm

It's meant to be that when the sword is drawn by either the player or an npc casts a flame cloak (like the vanilla one) spell on self
User avatar
Gracie Dugdale
 
Posts: 3397
Joined: Wed Jun 14, 2006 11:02 pm

Post » Sat Nov 17, 2012 3:10 pm

you can do what the silver weapons do and use the same script (silverswordscript). but instead of filling the silver perk for the perk property, create a new perk with your magic effect as the perk's ability (entry point ability). that way the weapon will add/remove the perk when equipped/unequipped...... sort of.

there is a bug with hotkeys that breaks the script. if the player uses hotkeys to switch between weapons, the OnEquipped/unequipped lines in the script will not fire, and your perk sync will be thrown off (this is the case with all of the vanilla silver weapons as well)


another approach would be to use the same custom perk, and automatically give it to the player (via immediate quest or whatever), and condition it so that the ability will only activate when the sword is equipped. i'm not sure what condition is the weapon equivalent of WornHasKeyword, but i am sure one of those condition functions will allow you to weed out just your sword either via magic effect keyword or something similar.

if you want this ability to be used by NPCs as well, you can make the ability as a spell instead of a perk

Do this, make an ability, fire cloak on self, constant effect and use the "GetEquipped" condition. Then script an onequip event to give the spell to the actor equipping the sword, that way it should work for NPC's also...I think...
Add an IsWeaponOut condition also and it'll only fire when the weapon is drawn.
User avatar
Lisa
 
Posts: 3473
Joined: Thu Jul 13, 2006 3:57 am


Return to V - Skyrim