SKSE - WeaponArmor Condition?

Post » Tue Nov 20, 2012 12:52 am

Are there SKSE papyrus functions that would allow me to get and set the condition of a weapon or piece of armor? What I mean by "condition" is, when you upgrade your equipment at a grindstone or armor bench, it modifies the item's condition to be greater than 100% - I want to be able to access the variable that determines this.

I'm also looking for an event that fires when an NPC is hit, which can tell me how much damage was done. I'm guessing ObjectReference-&--#62;OnHit() would work, but as far as I can tell it doesn't show how much damage was dealt by the hit.

Also, is there a way to have a script apply to every object of a certain type in the game, without modifying each and every object?

I'm trying to make a mod which will have weapons and armor degrade as they're used, requiring the player to repair their gear (in exacly the same way that they upgrade them now). I would like this to apply to all gear in the game, but I would be satisfied if it only applied to the player's gear, though it must be independant of what that gear is.
User avatar
Lindsay Dunn
 
Posts: 3247
Joined: Sun Sep 10, 2006 9:34 am

Post » Mon Nov 19, 2012 10:07 pm

I don't think so. If you want to find out what functions are added by SKSE you can always open the PSC files in src\skse\scripts\modified with notepad and have a look. Also, this http://www.gamesas.com/topic/1412880-weapon-degradation-any-one-working-on-it/ may interest you.
User avatar
Nathan Barker
 
Posts: 3554
Joined: Sun Jun 10, 2007 5:55 am

Post » Tue Nov 20, 2012 4:05 am

There isn't one, I've requested the same functions in the past.

I'm also looking for an event that fires when an NPC is hit, which can tell me how much damage was done. I'm guessing ObjectReference-&--#62;OnHit() would work, but as far as I can tell it doesn't show how much damage was dealt by the hit.
The only way to tell is to poll the actor's health several times per second and compare the actor value health to the health saved from the last update. It actually works fine but for NPCs, you should of course stop updating if they're far from the player.

Also, is there a way to have a script apply to every object of a certain type in the game, without modifying each and every object?
For what you want to do, you should only need to have a script attached to actors using the weapons/armor. But if you find it necessary to attach a script to the object, I think the answer is no. I'm not sure why you would need to though.
User avatar
Dina Boudreau
 
Posts: 3410
Joined: Thu Jan 04, 2007 10:59 pm

Post » Tue Nov 20, 2012 8:32 am

For what you want to do, you should only need to have a script attached to actors using the weapons/armor. But if you find it necessary to attach a script to the object, I think the answer is no. I'm not sure why you would need to though.


Sorry, allow me to rephrase. I want the script to apply to every actor, not every item. The script itself would dig into the actor's equipment in order to modify the condition of the appropriate item, but it has to be completely independent of which items are equipped.

It's sad that the functions to modify condition don't exist, though... Do you know if they will in a future version of SKSE?
User avatar
Jordan Moreno
 
Posts: 3462
Joined: Thu May 10, 2007 4:47 pm


Return to V - Skyrim