Question about scripted effect on weapon

Post » Sun Aug 08, 2010 5:10 pm

I want to write a scripted spell effect that will increase the current weapon's damage by a small amount (2-5) for 30 minutes. This is to simulate an effect granted by using a sharpening stone. So far I haven't had any luck finding the right way to do it.

I've come up with the following ways to get around it, but I'd rather pull it off as imagined if I can:

- Find the player's current weapon skill and then use the appropriate 'Fortify Skill' effect to boost it. The problem with this is a RP one - using a stone on the weapon wouldn't increase your skill with the weapon, it would increase the effectiveness of the actual weapon. Also, this effect wouldn't stick with the weapon, it would affect any weapons of that type used by the player for the allotted time.

- Use the 'FDamageWeaponMult' setting to increase the weapon's damage multiplier. The problem with this is that as I understand it, using this will increase the multiplier for ALL weapons, not just the equipped one. Obviously, that won't work.

So... any one care to wager a guess? A scripted effect that will basically enchant that specific weapon for 30 minutes, increasing the damage it does by a given amount, but doesn't effect any other weapons the player has and doesn't require charges (lasts 30 minutes regardless of how much the weapon hits).


UPDATE: I think the attribute I want to increase is 'WeaponRating'. According to the damage formula on UESP, this is "the damage shown for the weapon in your character's inventory" and is the base for the damage calculation.
User avatar
Thema
 
Posts: 3461
Joined: Thu Sep 21, 2006 2:36 am

Post » Sun Aug 08, 2010 12:54 pm

might need obse, not sure, but what about making an enchantment that fortifies the correlating skill, then have a script add the enchantment to the weapon when sharpened and remove the enchantment when the timer is up. Now that i think about it i don't think it's possible, but u might be able to doin it via NifSE, so if that's an option i'd talk to either hex_off or dragoonwraith.
User avatar
Brad Johnson
 
Posts: 3361
Joined: Thu May 24, 2007 7:19 pm

Post » Sun Aug 08, 2010 3:53 pm

might need obse, not sure, but what about making an enchantment that fortifies the correlating skill, then have a script add the enchantment to the weapon when sharpened and remove the enchantment when the timer is up. Now that i think about it i don't think it's possible, but u might be able to doin it via NifSE, so if that's an option i'd talk to either hex_off or dragoonwraith.
:facepalm:
NifSE is for in game mesh edits. Not changing weapon damage.
Try using http://cs.elderscrolls.com/constwiki/index.php/ModAttackDamage.
User avatar
Ymani Hood
 
Posts: 3514
Joined: Fri Oct 26, 2007 3:22 am

Post » Sun Aug 08, 2010 5:17 pm

ModAttackDamage is the one which will change all copies of that object. However, you can get around this by using a CloneForm. There are a few hoops to jump through to avoid savegame bloat, but ultimately solution with the least compromise.
User avatar
louise hamilton
 
Posts: 3412
Joined: Wed Jun 07, 2006 9:16 am

Post » Sun Aug 08, 2010 4:34 pm

It's interesting that you brought that up. Another possibility would be to clone their weapon, increase the stats on the cloned weapon, than use the script to swap weapons when they equip it. I'll have to look into that some.

I think if it comes down to it, the least I can do is grab their weapon skill and fortify it for XXX amount of time. Sloppy but it'll work somewhat.
User avatar
Kat Ives
 
Posts: 3408
Joined: Tue Aug 28, 2007 2:11 pm

Post » Sun Aug 08, 2010 9:33 pm

I would tackle this by creating a "sharpening stone" misc item, and in its onequip block, cloning the player's current weapon (making a note of the original and storing the clone in an array), increasing the attack damage of the new weapon, replacing the old one with the new one, and setting a timer. In the gamemode block of the sharpening stone I'd simply check the timer and when it runs out, swap the new weapon back out for the old one - this way you're not increasing the skills, so only the sharpened weapon is affected. You could also ensure that the weapon type is appropriate (sharpening bows for example seems a bit silly...)

The reason for the array of cloned weapons is so that you don't clone more than you have to (which bloats the save game). Basically when you go to make a clone, you can check in that array (using a find by name) and see if its already there - and if so, use that one. You could even tweak the name of the weapon to include the word "sharpened" making it more obvious which weapon is actively sharpened at the time.

That would just about cover it, and shouldn't take more than twenty minutes to write.

HeX
User avatar
Antony Holdsworth
 
Posts: 3387
Joined: Tue May 29, 2007 4:50 am

Post » Sun Aug 08, 2010 3:02 pm

A list of hoops, and brief overview of jumping techniques.

;)
User avatar
Lou
 
Posts: 3518
Joined: Wed Aug 23, 2006 6:56 pm

Post » Sun Aug 08, 2010 9:31 pm

lol
User avatar
hannah sillery
 
Posts: 3354
Joined: Sun Nov 26, 2006 3:13 pm

Post » Sun Aug 08, 2010 10:07 pm

Or, why swap the weapon around at all after cloning? Do a check IsCloneForm, and if it is, just modify the damage. (either enhancing, or reducing, depending on circumstances.) Would dramatically reduce the potential for bloat, wouldn't require an array to track them, thus, making the script much simpler.
User avatar
Katie Louise Ingram
 
Posts: 3437
Joined: Sat Nov 18, 2006 2:10 am

Post » Sun Aug 08, 2010 1:01 pm

I'll give these a try and post an update. May be a few days, though.
User avatar
jeremey wisor
 
Posts: 3458
Joined: Mon Oct 22, 2007 5:30 pm


Return to IV - Oblivion