Locational Damage Script Available?

Post » Sun May 27, 2012 11:26 am

It's been far too long since I've been here, but noticed there were some mods with locational damage! :-D

I'm just curious if there are any such open-source scripts available?

I don't really want to change the way it works, but just simply add features on top of the idea.

Thank you, and hope everyone's doing well!
User avatar
Flutterby
 
Posts: 3379
Joined: Mon Sep 25, 2006 11:28 am

Post » Sun May 27, 2012 4:09 pm

I might be completely wrong, but i believe Duke Patricks mod uses locational damage... not sure how.
User avatar
Marguerite Dabrin
 
Posts: 3546
Joined: Tue Mar 20, 2007 11:33 am

Post » Sun May 27, 2012 6:01 am

IIRC, in Duke Patrick's Oblivion mod it was done through trigonometry based on the camera angle and the distance between you and your target.
User avatar
Katey Meyer
 
Posts: 3464
Joined: Sat Dec 30, 2006 10:14 pm

Post » Sun May 27, 2012 1:53 am

Doesn't Skyrim use a variation of VATS in FO? I mean, the setting changes for ranged and magic killmove attacks literally is under the [VATS] settings.

Unless it was just the same name, but not the full system. Which is really too bad since that would probably make identifiable body parts so much easier for modding.
User avatar
Tracy Byworth
 
Posts: 3403
Joined: Sun Jul 02, 2006 10:09 pm

Post » Sun May 27, 2012 11:36 am

http://skyrim.nexusmods.com/downloads/file.php?id=12615

behold.

I use this mod.

just realized you were looking for an open-script. I dunno, you could try messaging the guy who made this mod.
User avatar
Captian Caveman
 
Posts: 3410
Joined: Thu Sep 20, 2007 5:36 am

Post » Sun May 27, 2012 2:52 am

Thank you all for the replies! And yes, I've downloaded both mods, though I haven't tried them (I haven't even played Skyrim in months!). Sadly, I don't believe the scripts are editable or even readable as is. Oh well.


IIRC, in Duke Patrick's Oblivion mod it was done through trigonometry based on the camera angle and the distance between you and your target.

Ah, trigonometry? Now that is interesting... and far beyond my expertise, haha! I wonder... if that's the case, does locational damage also apply to creatures such as giants, dragons, and spiders?


Doesn't Skyrim use a variation of VATS in FO? I mean, the setting changes for ranged and magic killmove attacks literally is under the [VATS] settings.

Unless it was just the same name, but not the full system. Which is really too bad since that would probably make identifiable body parts so much easier for modding.

I believe that a lot of the VATS code is still in Skyrim, but unless I'm mistaken, the devs disabled it. Such a sad thing :-(


Ps. If anyone is curious as to what I'm wanting to do, it's the next step in a mod/script I'm working on... one that's been on hold for MONTHS! :-P

Basically, it is meant to give attacks different types of damage (cut/pierce/concussive) based on the weapon, and also give each type of armor different resistances to those new damages. Perhaps the most important thing, however, is that armor will be able to fully protect its wearer if its resistance to damage is great enough. That is, a steel dagger will NEVER do more than ZERO damage to someone wearing Daedric armor.

At the same time, if a steel axe penetrates your iron armor, you will receive 100% of damage. Armor isn't an absorber (save for concussive damage)... it's mostly a hit-or-miss factor now. Either your armor protects you or it doesn't ;-)

But without locational damage, I based my script on the cuirass only. I would much prefer it to be locational, however. Would make it much more realistic... especially if I make one strike lethal, which seems to be both fun and challenging to me ;-D
User avatar
adam holden
 
Posts: 3339
Joined: Tue Jun 19, 2007 9:34 pm

Post » Sun May 27, 2012 7:50 am

I believe that a lot of the VATS code is still in Skyrim, but unless I'm mistaken, the devs disabled it. Such a sad thing :-(
FO3's VATS code was cannibalized for the killmove system, apparently. I highly doubt the locational damage code is still present, but I won't say there isn't a chance, even if SKSE might be needed to expose it. The SKSE devs might be able to give you more information based on their experience with Skyrim's internal workings.
User avatar
Bedford White
 
Posts: 3307
Joined: Tue Jun 12, 2007 2:09 am

Post » Sun May 27, 2012 2:46 pm

Thank you all for the replies! And yes, I've downloaded both mods, though I haven't tried them (I haven't even played Skyrim in months!). Sadly, I don't believe the scripts are editable or even readable as is. Oh well.




Ah, trigonometry? Now that is interesting... and far beyond my expertise, haha! I wonder... if that's the case, does locational damage also apply to creatures such as giants, dragons, and spiders?




I believe that a lot of the VATS code is still in Skyrim, but unless I'm mistaken, the devs disabled it. Such a sad thing :-(


Ps. If anyone is curious as to what I'm wanting to do, it's the next step in a mod/script I'm working on... one that's been on hold for MONTHS! :-P

Basically, it is meant to give attacks different types of damage (cut/pierce/concussive) based on the weapon, and also give each type of armor different resistances to those new damages. Perhaps the most important thing, however, is that armor will be able to fully protect its wearer if its resistance to damage is great enough. That is, a steel dagger will NEVER do more than ZERO damage to someone wearing Daedric armor.

At the same time, if a steel axe penetrates your iron armor, you will receive 100% of damage. Armor isn't an absorber (save for concussive damage)... it's mostly a hit-or-miss factor now. Either your armor protects you or it doesn't ;-)

But without locational damage, I based my script on the cuirass only. I would much prefer it to be locational, however. Would make it much more realistic... especially if I make one strike lethal, which seems to be both fun and challenging to me ;-D
I've been waiting for something like this to come along... is it ready for a release? even just the cuirass?
User avatar
matt oneil
 
Posts: 3383
Joined: Tue Oct 09, 2007 12:54 am

Post » Sun May 27, 2012 11:53 am

Doesn't Skyrim use a variation of VATS in FO? I mean, the setting changes for ranged and magic killmove attacks literally is under the [VATS] settings.

Unless it was just the same name, but not the full system. Which is really too bad since that would probably make identifiable body parts so much easier for modding.
I think it's just the name, not the full system, sadly. Though I'd love for someone to prove me wrong. ;)
User avatar
Sakura Haruno
 
Posts: 3446
Joined: Sat Aug 26, 2006 7:23 pm

Post » Sun May 27, 2012 2:45 am

I've been waiting for something like this to come along... is it ready for a release? even just the cuirass?

Haha, I haven't touched it in MONTHS. Now that it's summer, I hope to restart.

I was getting pretty far along in my initial plan until I got the great idea that I needed to implement support for all types of creatures, haha! Maybe I should have stuck with humanoids for the first version.

For it to actually be useful, I think I'll have to figure out how to work Skyproc, seeing that I need to add a perk and spells to every actor in the game. Right now, I've manually placed them on the actors in the tutorial dungeon. It's amazing how different the game plays when one arrow or sword strike can end your day (as can be experienced in the room with 5 or 6 stormcloaks... including 2 archers). Of course, that's wearing leather or mail. Try it in Daedric, and you should be as invulnerable to those guys as Superman is against bullets... though I don't know about wooden chairs (for some reason, Superman always ducked those).

I will definitely try to get a workable version soon, though... even just for playable races with cuirasses. There are still some buggy issues with weapons not getting their values set properly. Not sure why, though.
User avatar
Jason Rice
 
Posts: 3445
Joined: Thu Aug 16, 2007 3:42 pm

Post » Sun May 27, 2012 10:37 am

Haha, I haven't touched it in MONTHS. Now that it's summer, I hope to restart.

I was getting pretty far along in my initial plan until I got the great idea that I needed to implement support for all types of creatures, haha! Maybe I should have stuck with humanoids for the first version.

For it to actually be useful, I think I'll have to figure out how to work Skyproc, seeing that I need to add a perk and spells to every actor in the game. Right now, I've manually placed them on the actors in the tutorial dungeon. It's amazing how different the game plays when one arrow or sword strike can end your day (as can be experienced in the room with 5 or 6 stormcloaks... including 2 archers). Of course, that's wearing leather or mail. Try it in Daedric, and you should be as invulnerable to those guys as Superman is against bullets... though I don't know about wooden chairs (for some reason, Superman always ducked those).

I will definitely try to get a workable version soon, though... even just for playable races with cuirasses. There are still some buggy issues with weapons not getting their values set properly. Not sure why, though.
Sounds good. Any thoughts on how you'll make it work for mod-added weapons/armour? Were you planning to have the piercing/concussion levels dependent on the type of weapon, or on specific weapons? Or on both the type and "grade" i.e. iron, ebony, etc. And how would improving alter these values?
If you used Skyproc, you could have it scan weapons added by mods, and implement accordingly, a la Automatic Spells.
And while having it quickly is good, you'll want to address creatures eventually, yeah. Though a system with a few generic types, based on weight/size/health to determine how tough they are, might be required, if you have to scan and alter all mod added creatures, too...

And it's alright for some, my summer doesn't start for 2 months yet! :P
User avatar
Kay O'Hara
 
Posts: 3366
Joined: Sun Jan 14, 2007 8:04 pm

Post » Sun May 27, 2012 9:21 am

The entire project really began when I found out that Skyrim uses keywords for items, etc. I've based my script around those.

Anything's possible, really, but to begin with, I am basing damage/resistant types on the keywords of weapons/armor. So every weapon that has the keywords (of something like) "WeaponTypeDagger" and "MaterialTypeIron" will have the same values. However, every weapon should have a specific value for each weapon type... a dagger will have high cutting and pierce values, but it will also have SOME concussive value also (but very little). Of course, heavier material types such as Dwarven and Ebony will have higher concussive values. Materials such as Glass and Daedric will give higher cutting/piercing values. Same is true for arrows, etc.

To be honest, I really don't care for the way I've got the damage effects classified at the moment, so I may completely change them to be more versatile.

Of course, the problem comes when modded weapons/armors/creatures do not have proper keywords implemented. Hopefully, patches could easily be applied adding the needed keywords to make everything work as it should. Of course, I've never modded anything, so I'm not the person to ask about that kind of stuff :-P


Ps. I haven't figured out how "improving/upgrading" would work yet... at least not for the initial version. I suppose more keywords could be added for condition, but that's for down-the-road. My main goal is to make weapons truly lethal, but at the same time, make armor truly protective. Chainmail should give you a fighting chance against cutting weapons... at least from getting sliced open. But it won't do much good against the concussive force behind the weapon. And solid plate armor should keep you safe unless something penetrates it. Wearing Daedric makes you feel like a tank. You're not invincible, but you're not going to go down against anyone with lower-tier weapons.

PPs. Even with all of the set values that weapons/armor have, there is still a "dice-roll" effect on every strike. The key is that every weapon has its own particular set of "dice" to roll, one for each damage type, and also depending on if it's a power attack or not. I believe that's 6 "dice" altogether... rolling 3 of them depending on the type of attack.
User avatar
Jhenna lee Lizama
 
Posts: 3344
Joined: Wed Jun 06, 2007 5:39 am

Post » Sun May 27, 2012 2:28 am

I'm doing something vaguely similar, thought you might want to take a gander at my code. This is a script that is dynamically attached to an actor by a cloak.
Scriptname d20damaged extends activemagiceffectKeyword Property d2damager autoKeyword Property d4damager autoKeyword Property d6damager autoKeyword Property d8damager autoKeyword Property d10damager autoKeyword Property d12damager autoKeyword Property CrescentAxeKey autoFaction Property DnDLinearDamageAdjuster autoFaction Property DnDTHAC0 autoFaction Property DnDArmorClass autoFaction Property DnDBonusWithSlash autoFaction Property DnDBonusWithBash autoFaction Property DnDBonusWithPierce autoFaction Property DnDBonusAgainstSlash autoFaction Property DnDBonusAgainstBash autoFaction Property DnDBonusAgainstPierce autoFaction Property DnDSlashResist autoFaction Property DnDPierceResist autoFaction Property DnDBashResist autoKeyword Property DnDSlashingWeap autoKeyword Property DnDPiercingWeap autoKeyword Property DnDBashingWeap autoKeyword Property DnDWeapon autoActor MySelfEvent OnEffectStart(Actor akTarget, Actor akCaster)   Myself = akTarget   Debug.Notification(akTarget as string)endEventEvent OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, \  bool abBashAttack, bool abHitBlocked)if akSource.HasKeyword(DnDWeapon)==1  int damagetype = 0  float damagetotal = 0  if akSource.HasKeyword(DnDSlashingWeap)==1	 damagetype = 1  endIf  if akSource.HasKeyword(DnDPiercingWeap)==1	 damagetype = 2  endIf  if akSource.HasKeyword(DnDBashingWeap)==1	 damagetype = 3  endIf   int d20roll = Utility.randomint(1,20)   Actor attacker = akAggressor as actor  if akSource.HasKeyword(d2damager) ==1  int d2random = Utility.randomint(1,2)			 int ModdedD2 = d2random +  (attacker.GetFactionRank(DnDLinearDamageAdjuster) as int)			damagetotal = damagetotal + Moddedd2  endif  if akSource.HasKeyword(d4damager) ==1  int d4random = Utility.randomint(1,4)			 int ModdedD4 = d4random +  (attacker.GetFactionRank(DnDLinearDamageAdjuster) as int)			damagetotal = damagetotal + Moddedd4  endif  if akSource.HasKeyword(d6damager) ==1  int d6random = Utility.randomint(1,6)			 int ModdedD6 = d6random +  (attacker.GetFactionRank(DnDLinearDamageAdjuster) as int)			damagetotal = damagetotal +Moddedd6  endif  if akSource.HasKeyword(d8damager) ==1  int d8random = Utility.randomint(1,8)			 int ModdedD8 = d8random + (attacker.GetFactionRank(DnDLinearDamageAdjuster) as int)			damagetotal = damagetotal +Moddedd8  endif  if akSource.HasKeyword(d10damager) ==1  int d10random = Utility.randomint(1,10)			 int ModdedD10 = d10random + (attacker.GetFactionRank(DnDLinearDamageAdjuster) as int)			damagetotal = damagetotal + Moddedd10  endif  if akSource.HasKeyword(d12damager) ==1  int d12random = Utility.randomint(1,12)			 int ModdedD12 = d12random + (attacker.GetFactionRank(DnDLinearDamageAdjuster) as int)			damagetotal = damagetotal +Moddedd12  endif  if akSource.HasKeyword(CrescentAxeKey) ==1  int Crescentrandom = Utility.randomint(2,7)			 int Moddedcrescent = crescentrandom + (attacker.GetFactionRank(DnDLinearDamageAdjuster) as int)			damagetotal = damagetotal + ModdedCrescent  endifint hitchance = 0hitchance = hitchance +d20roll + attacker.GetFactionRank(DnDTHAC0) as int +- Myself.GetFactionRank(DnDArmorClass) as intif damagetype==1   hitchance = hitchance + attacker.GetFactionRank(DnDBonusWithSlash) as int +- Myself.GetFactionRank(DnDBonusAgainstSlash) as int   damagetotal = damagetotal * (100-(5*Myself.GetFactionRank(DnDSlashResist)))/100endIfif damagetype==2   hitchance = hitchance + attacker.GetFactionRank(DnDBonusWithPierce) as int +- Myself.GetFactionRank(DnDBonusAgainstPierce) as int   damagetotal = damagetotal * (100-(5*Myself.GetFactionRank(DnDPierceResist)))/100endIfif damagetype==3   hitchance = hitchance + attacker.GetFactionRank(DnDBonusWithBash) as int +- Myself.GetFactionRank(DnDBonusAgainstBash) as int   damagetotal = damagetotal * (100-(5*Myself.GetFactionRank(DnDBashResist)))/100endIfif hitchance>=0Myself.DamageAV("health", damageTotal)endIfendIFEndEvent
User avatar
Queen
 
Posts: 3480
Joined: Fri Dec 29, 2006 1:00 pm

Post » Sun May 27, 2012 4:04 am

I'm doing something vaguely similar, thought you might want to take a gander at my code. This is a script that is dynamically attached to an actor by a cloak.

Very nice! I take it that it's going to be a Dungeons & Dragons type of combat system?

I started my script as one that extended Active Magic Effect, but I ran into some problems with getting equipped armor. And by setting weapon values on every hit, it caused terrible lag. So I ended up changing my script to extend Actor. By doing so, I could set values of equipped armor and weapons on (un)equip. Made it SO much faster!

I believe this is my current code. Maybe someone can make heads or tails out of it. It is a mess, I'm afraid... especially with racial additions. All of it needs to be updated with valid logic... I fear I was writing it on the fly.
Spoiler

Scriptname SAWDOnHit extends Actor{SAWD OnHit Damage Calculation}Race Property BretonRace autoRace Property BretonRaceVampire autoRace Property ImperialRace autoRace Property ImperialRaceVampire autoRace Property NordRace autoRace Property NordRaceVampire autoRace Property RedguardRace autoRace Property RedguardRaceVampire autoRace Property OrcRace autoRace Property OrcRaceVampire autoRace Property WoodElfRace autoRace Property WoodElfRaceVampire autoRace Property DarkElfRace autoRace Property DarkElfRaceVampire autoRace Property HighElfRace autoRace Property HighElfRaceVampire autoRace Property ArgonianRace autoRace Property ArgonianRaceVampire autoRace Property KhajiitRace autoRace Property KhajiitRaceVampire autoRace Property ElderRace autoRace Property ElderRaceVampire autoRace Property FalmerRace autoRace Property DwarvenCenturionRace autoFaction property ghostFaction autoFaction property IceWraithFaction autoFaction property SkeletonFaction autoFaction property VampireFaction autoFaction property VampirePCFaction autoFaction property WispFaction autoFaction property AtronachFlameFaction autoFaction property AtronachFrostFaction autoFaction property AtronachStormFaction autoFaction property DragonPriestFaction autoFaction property DraugrFaction autoFaction property DwarvenAutomatonFaction autoFaction property DragonFaction autoFaction property AlduinFaction autoFaction property GiantFaction autoFaction property WerewolfFaction autoFaction property PlayerWerewolfFaction autoFaction property MammothFaction autoKeyword property ActorTypeDwarven autoKeyword property ActorTypeFamiliar autoKeyword property ActorTypeGhost autoKeyword property ActorTypeUndead autoKeyword property ActorTypeDragon autoKeyword property ActorTypeGiant autoKeyword property ActorTypeDaedra autoKeyword property VendorItemAnimalHide autoKeyword property ArmorMaterialDaedric autoKeyword property ArmorMaterialDragonplate autoKeyword property ArmorMaterialDragonscale autoKeyword property ArmorMaterialDwarven autoKeyword property ArmorMaterialEbony autoKeyword property ArmorMaterialElven autoKeyword property ArmorMaterialElvenGilded autoKeyword property ArmorMaterialGlass autoKeyword property ArmorMaterialHide autoKeyword property ArmorMaterialImperialHeavy autoKeyword property ArmorMaterialImperialLight autoKeyword property ArmorMaterialImperialStudded autoKeyword property ArmorMaterialIron autoKeyword property ArmorMaterialIronBanded autoKeyword property ArmorMaterialLeather autoKeyword property ArmorMaterialOrcish autoKeyword property ArmorMaterialScaled autoKeyword property ArmorMaterialSteel autoKeyword property ArmorMaterialSteelPlate autoKeyword property ArmorMaterialStormcloak autoKeyword property ArmorMaterialStudded autoKeyword property ArmorNightingale autoKeyword property ArmorDarkBrotherhood autoKeyword property ArmorCuirass autoKeyword property ArmorShield autoKeyword property VendorItemArrow autoKeyword property WeapTypeBoundArrow autoKeyword property WeapTypeBow autoKeyword property WeapTypeDagger autoKeyword property WeapTypeSword autoKeyword property WeapTypeGreatsword autoKeyword property WeapTypeWarAxe autoKeyword property WeapTypeBattleaxe autoKeyword property WeapTypeMace autoKeyword property WeapTypeWarhammer autoKeyword property WeapTypeStaff autoKeyword property WeapMaterialDaedric autoKeyword property WeapMaterialDraugr autoKeyword property WeapMaterialDraugrHoned autoKeyword property WeapMaterialDwarven autoKeyword property WeapMaterialEbony autoKeyword property WeapMaterialElven autoKeyword property WeapMaterialFalmer autoKeyword property WeapMaterialFalmerHoned autoKeyword property WeapMaterialGlass autoKeyword property WeapMaterialImperial autoKeyword property WeapMaterialIron autoKeyword property WeapMaterialOrcish autoKeyword property WeapMaterialSilver autoKeyword property WeapMaterialSteel autoKeyword property WeapMaterialWood autoSPELL PROPERTY SAWDKneel AUTOSPELL PROPERTY SAWDStagger AUTOSPELL PROPERTY SAWDBleedHeavy AUTOSPELL PROPERTY SAWDBleedModerate AUTOSPELL PROPERTY SAWDBleedLight AUTOArmor property myArmor autoArmor property myShield autoWeapon property myWeapon autoint PROPERTY myRPenetrationMin = 0 AUTOint PROPERTY myRPenetrationMax = 0 AUTOint PROPERTY myRCutMin = 0 AUTOint PROPERTY myRCutMax = 0 AUTOint PROPERTY myRConcussionMin = 0 AUTOint PROPERTY myRConcussionMax = 0 AUTOint PROPERTY myRpPenetrationMin = 0 AUTOint PROPERTY myRpPenetrationMax = 0 AUTO int PROPERTY myRpConcussionMin = 0 AUTOint PROPERTY myRpConcussionMax = 0 AUTOint PROPERTY myLPenetrationMin = 0 AUTOint PROPERTY myLPenetrationMax = 0 AUTOint PROPERTY myLCutMin = 0 AUTOint PROPERTY myLCutMax = 0 AUTOint PROPERTY myLConcussionMin = 0 AUTOint PROPERTY myLConcussionMax = 0 AUTOint PROPERTY myLpPenetrationMin = 0 AUTOint PROPERTY myLpPenetrationMax = 0 AUTO int PROPERTY myLpConcussionMin = 0 AUTOint PROPERTY myLpConcussionMax = 0 AUTOint myPenetrationMin = 0int myPenetrationMax = 0int myCutMin = 0int myCutMax = 0int myConcussionMin = 0int myConcussionMax = 0int mypPenetrationMin = 0int mypPenetrationMax = 0int mypConcussionMin = 0int mypConcussionMax = 0int aPenetrationMin = 0int aPenetrationMax = 0int aCutMin = 0int aCutMax = 0int aConcussionMin = 0int aConcussionMax = 0int apPenetrationMin = 0int apPenetrationMax = 0int apConcussionMin = 0int apConcussionMax = 0int ResistPenetration = 0int ResistCut = 0int ResistCutTemp = 0int ResistConcussion = 0int nResistPenetration = 1int nResistCut = 1int nResistConcussion = 1int sResistPenetration = 0int sResistCut = 0int sResistConcussion = 0int ArrowPenetration = 0int ArrowConcussion = 0int PenetrationMin = 0int PenetrationMax = 0 int CutMin = 0int CutMax = 0int ConcussionMin = 0int ConcussionMax = 0int pPenetrationMin = 0int pPenetrationMax = 0 int pConcussionMin = 0int pConcussionMax = 0int nPenetrationMin = 0int nPenetrationMax = 0 int nCutMin = 0int nCutMax = 0int nConcussionMin = 0int nConcussionMax = 0int npPenetrationMin = 0int npPenetrationMax = 0 int npConcussionMin = 0int npConcussionMax = 0int PenetrationRoll = 0int CutRoll = 0int ConcussionRoll = 0int PenetrationSuccess = 0int CutSuccess = 0int ConcussionSuccess = 0int Bleeder = 3int Bleed = 0int Magical = 0int AntiMagic = 0int Damageint Physical = 1int Stagger = 0Function DetectActorType()if (Self.HasKeyword(ActorTypeDwarven)) || (Self.HasKeyword(ActorTypeFamiliar)) || (Self.HasKeyword(ActorTypeGhost)) || (Self.HasKeyword(ActorTypeUndead)) || (Self.IsInFaction(ghostFaction)) || (Self.IsInFaction(IceWraithFaction)) || (Self.IsInFaction(SkeletonFaction)) || (Self.IsInFaction(VampireFaction)) || (Self.IsInFaction(VampirePCFaction)) || (Self.IsInFaction(WispFaction)) || (Self.IsInFaction(AtronachFlameFaction)) || (Self.IsInFaction(AtronachFrostFaction)) || (Self.IsInFaction(AtronachStormFaction)) || (Self.IsInFaction(DragonPriestFaction)) || (Self.IsInFaction(DraugrFaction)) || (Self.IsInFaction(DwarvenAutomatonFaction))Bleeder = 0elseif (Self.HasKeyword(ActorTypeDragon)) || (Self.IsInFaction(DragonFaction)) || (Self.IsInFaction(AlduinFaction))Bleeder = 1elseif (Self.HasKeyword(ActorTypeGiant)) || (Self.IsInFaction(GiantFaction)) || (Self.IsInFaction(MammothFaction))Bleeder = 2ElseBleeder = 3endif if (Self.HasKeyword(ActorTypeFamiliar)) || (Self.HasKeyword(ActorTypeGhost)) || (Self.HasKeyword(ActorTypeUndead)) || (Self.HasKeyword(ActorTypeDaedra)) || (Self.IsInFaction(ghostFaction)) || (Self.IsInFaction(IceWraithFaction)) || (Self.IsInFaction(SkeletonFaction)) || (Self.IsInFaction(VampireFaction)) || (Self.IsInFaction(VampirePCFaction)) || (Self.IsInFaction(WispFaction)) || (Self.IsInFaction(AtronachFlameFaction)) || (Self.IsInFaction(AtronachFrostFaction)) || (Self.IsInFaction(AtronachStormFaction)) || (Self.IsInFaction(DragonPriestFaction)) || (Self.IsInFaction(DraugrFaction)) || (Self.IsInFaction(WerewolfFaction)) || (Self.IsInFaction(PlayerWerewolfFaction))Magical = 1ElseMagical = 0endifif (Self.HasKeyword(ActorTypeFamiliar)) || (Self.HasKeyword(ActorTypeGhost))Physical = 0elseif (Self.HasKeyword(ActorTypeGiant)) || (Self.IsInFaction(GiantFaction)) || (Self.HasKeyword(ActorTypeDragon)) || (Self.IsInFaction(DragonFaction)) || (Self.IsInFaction(AlduinFaction)) || (Self.IsInFaction(MammothFaction)) || (Self.GetRace() == DwarvenCenturionRace) Physical = 2elsePhysical = 1endifif (Self.GetRace() == BretonRace) || (Self.GetRace() == ImperialRace) || (Self.GetRace() == NordRace) || (Self.GetRace() == WoodElfRace) || (Self.GetRace() == DarkElfRace) || (Self.GetRace() == HighElfRace) || (Self.GetRace() == OrcRace) || (Self.GetRace() == RedguardRace) || (Self.GetRace() == ElderRace) || (Self.GetRace() == FalmerRace)nResistPenetration = 1nResistCut = 1nResistConcussion = 1nPenetrationMin = 0nPenetrationMax = 0 nCutMin = 0nCutMax = 0nConcussionMin = 1nConcussionMax = 10npPenetrationMin = 0npPenetrationMax = 0 npConcussionMin = 1npConcussionMax = 20elseif (Self.GetRace() == BretonRaceVampire) || (Self.GetRace() == ImperialRaceVampire) || (Self.GetRace() == NordRaceVampire) || (Self.GetRace() == WoodElfRaceVampire) || (Self.GetRace() == DarkElfRaceVampire) || (Self.GetRace() == HighElfRaceVampire) || (Self.GetRace() == OrcRaceVampire) || (Self.GetRace() == RedguardRaceVampire) || (Self.GetRace() == ElderRaceVampire)nResistPenetration = 1nResistCut = 1nResistConcussion = 20nPenetrationMin = 0nPenetrationMax = 0 nCutMin = 0nCutMax = 0nConcussionMin = 1nConcussionMax = 15npPenetrationMin = 0npPenetrationMax = 0 npConcussionMin = 1npConcussionMax = 25elseif  (Self.GetRace() == ArgonianRace) || (Self.GetRace() == KhajiitRace)nResistPenetration = 6nResistCut = 1nResistConcussion = 1nPenetrationMin = 0nPenetrationMax = 20 nCutMin = 0nCutMax = 1nConcussionMin = 1nConcussionMax = 10npPenetrationMin = 0npPenetrationMax = 25 npConcussionMin = 1npConcussionMax = 20elseif (Self.GetRace() == ArgonianRaceVampire) || (Self.GetRace() == KhajiitRaceVampire)nResistPenetration = 6nResistCut = 1nResistConcussion = 20nPenetrationMin = 0nPenetrationMax = 25 nCutMin = 0nCutMax = 1nConcussionMin = 1nConcussionMax = 15npPenetrationMin = 0npPenetrationMax = 30 npConcussionMin = 1npConcussionMax = 25elseif (Self.GetRace() == ActorTypeDremora)nResistPenetration = 1nResistCut = 1nResistConcussion = 1nPenetrationMin = 0nPenetrationMax = 0 nCutMin = 0nCutMax = 0nConcussionMin = 1nConcussionMax = 15npPenetrationMin = 0npPenetrationMax = 0 npConcussionMin = 1npConcussionMax = 25elseif (Self.HasKeyword(ActorTypeDwarven))nResistPenetration = 175nResistCut = 170nResistConcussion = 175elseif (Self.IsInFaction(SkeletonFaction))nResistPenetration = 80nResistCut = 80nResistConcussion = 20elseif (Self.HasKeyword(ActorTypeDragon))nResistPenetration = 150nResistCut = 150nResistConcussion = 150elseif (Self.HasKeyword(ActorTypeDraugr))nResistPenetration = 1nResistCut = 1nResistConcussion = 20endifEndFunctionFunction DetectArmorResistances(Armor fArmor)If ( myArmor.HasKeyword(ArmorCuirass))  ResistPenetration = 0  ResistCut = 0  ResistConcussion = 0  If ( myArmor.HasKeyword(ArmorMaterialDaedric))   ResistPenetration = 250   ResistCut = 250   ResistConcussion = 250  ElseIf ( myArmor.HasKeyword(ArmorMaterialDragonplate))   ResistPenetration = 225   ResistCut = 225   ResistConcussion = 225  ElseIf ( myArmor.HasKeyword(ArmorMaterialEbony))   ResistPenetration = 200   ResistCut = 200   ResistConcussion = 200  ElseIf ( myArmor.HasKeyword(ArmorMaterialDwarven))   ResistPenetration = 175   ResistCut = 170   ResistConcussion = 175   ElseIf ( myArmor.HasKeyword(ArmorMaterialOrcish))   ResistPenetration = 150   ResistCut = 150   ResistConcussion = 150  ElseIf ( myArmor.HasKeyword(ArmorMaterialDragonscale))   ResistPenetration = 150   ResistCut = 150   ResistConcussion = 150  ElseIf ( myArmor.HasKeyword(ArmorMaterialImperialHeavy))   ResistPenetration = 140   ResistCut = 140   ResistConcussion = 140  ElseIf ( myArmor.HasKeyword(ArmorMaterialSteelPlate))   ResistPenetration = 130   ResistCut = 130   ResistConcussion = 130  ElseIf ( myArmor.HasKeyword(ArmorMaterialGlass))   ResistPenetration = 130   ResistCut = 130   ResistConcussion = 130    ElseIf ( myArmor.HasKeyword(ArmorMaterialSteel))   ResistPenetration = 120   ResistCut = 120   ResistConcussion = 120   ElseIf ( myArmor.HasKeyword(ArmorMaterialIronBanded))   ResistPenetration = 110   ResistCut = 110   ResistConcussion = 110  ElseIf ( myArmor.HasKeyword(ArmorMaterialElvenGilded))   ResistPenetration = 110   ResistCut = 110   ResistConcussion = 110    ElseIf ( myArmor.HasKeyword(ArmorMaterialIron))   ResistPenetration = 100   ResistCut = 100   ResistConcussion = 100   ElseIf ( myArmor.HasKeyword(ArmorMaterialElven))   ResistPenetration = 100   ResistCut = 100   ResistConcussion = 100    ElseIf ( myArmor.HasKeyword(ArmorMaterialScaled))   ResistPenetration = 75   ResistCut = 90   ResistConcussion = 60  ElseIf ( myArmor.HasKeyword(ArmorMaterialImperialStudded))   ResistPenetration = 60   ResistCut = 80   ResistConcussion = 40    ElseIf ( myArmor.HasKeyword(ArmorMaterialStormcloak))   ResistPenetration = 50   ResistCut = 75   ResistConcussion = 35  ElseIf ( myArmor.HasKeyword(ArmorNightingale))   ResistPenetration = 50   ResistCut = 35   ResistConcussion = 30    ElseIf ( myArmor.HasKeyword(ArmorMaterialStudded))   ResistPenetration = 45   ResistCut = 35   ResistConcussion = 30   ElseIf ( myArmor.HasKeyword(ArmorMaterialImperialLight))   ResistPenetration = 40   ResistCut = 30   ResistConcussion = 25  ElseIf ( myArmor.HasKeyword(ArmorMaterialLeather))   ResistPenetration = 40   ResistCut = 30   ResistConcussion = 25    ElseIf ( myArmor.HasKeyword(ArmorDarkBrotherhood))   ResistPenetration = 30   ResistCut = 30   ResistConcussion = 20  ElseIf ( myArmor.HasKeyword(ArmorMaterialHide))   ResistPenetration = 15   ResistCut = 15   ResistConcussion = 15  ElseIf ( myArmor.HasKeyword(VendorItemAnimalHide))   ResistPenetration = 15   ResistCut = 15   ResistConcussion = 15    Else   ResistPenetration = 0   ResistCut = 0   ResistConcussion = 0  EndIfEndIfendFunctionFunction DetectShieldResistances(Armor fShield)If ( myShield.HasKeyword(ArmorShield))  sResistPenetration = 0  sResistCut = 0  sResistConcussion = 0  If ( myShield.HasKeyword(ArmorMaterialDaedric))   sResistPenetration = 250   sResistCut = 250   sResistConcussion = 250  ElseIf ( myShield.HasKeyword(ArmorMaterialDragonplate))   sResistPenetration = 225   sResistCut = 225   sResistConcussion = 225  ElseIf ( myShield.HasKeyword(ArmorMaterialEbony))   sResistPenetration = 200   sResistCut = 200   sResistConcussion = 200  ElseIf ( myShield.HasKeyword(ArmorMaterialDwarven))   sResistPenetration = 175   sResistCut = 170   sResistConcussion = 175   ElseIf ( myShield.HasKeyword(ArmorMaterialOrcish))   sResistPenetration = 150   sResistCut = 150   sResistConcussion = 150  ElseIf ( myShield.HasKeyword(ArmorMaterialDragonscale))   sResistPenetration = 150   sResistCut = 150   sResistConcussion = 150  ElseIf ( myShield.HasKeyword(ArmorMaterialImperialHeavy))   sResistPenetration = 140   sResistCut = 140   sResistConcussion = 140  ElseIf ( myShield.HasKeyword(ArmorMaterialSteelPlate))   sResistPenetration = 130   sResistCut = 130   sResistConcussion = 130  ElseIf ( myShield.HasKeyword(ArmorMaterialGlass))   sResistPenetration = 130   sResistCut = 130   sResistConcussion = 130    ElseIf ( myShield.HasKeyword(ArmorMaterialSteel))   sResistPenetration = 120   sResistCut = 120   sResistConcussion = 120   ElseIf ( myShield.HasKeyword(ArmorMaterialIronBanded))   sResistPenetration = 110   sResistCut = 110   sResistConcussion = 110  ElseIf ( myShield.HasKeyword(ArmorMaterialElvenGilded))   sResistPenetration = 110   sResistCut = 110   sResistConcussion = 110    ElseIf ( myShield.HasKeyword(ArmorMaterialIron))   sResistPenetration = 100   sResistCut = 100   sResistConcussion = 100   ElseIf ( myShield.HasKeyword(ArmorMaterialElven))   sResistPenetration = 100   sResistCut = 100   sResistConcussion = 100    ElseIf ( myShield.HasKeyword(ArmorMaterialScaled))   sResistPenetration = 75   sResistCut = 90   sResistConcussion = 60  ElseIf ( myShield.HasKeyword(ArmorMaterialImperialStudded))   sResistPenetration = 60   sResistCut = 80   sResistConcussion = 40    ElseIf ( myShield.HasKeyword(ArmorMaterialStormcloak))   sResistPenetration = 50   sResistCut = 75   sResistConcussion = 35  ElseIf ( myShield.HasKeyword(ArmorNightingale))   sResistPenetration = 50   sResistCut = 35   sResistConcussion = 30    ElseIf ( myShield.HasKeyword(ArmorMaterialStudded))   sResistPenetration = 45   sResistCut = 35   sResistConcussion = 30   ElseIf ( myShield.HasKeyword(ArmorMaterialImperialLight))   sResistPenetration = 40   sResistCut = 30   sResistConcussion = 25  ElseIf ( myShield.HasKeyword(ArmorMaterialLeather))   sResistPenetration = 40   sResistCut = 30   sResistConcussion = 25    ElseIf ( myShield.HasKeyword(ArmorDarkBrotherhood))   sResistPenetration = 30   sResistCut = 30   sResistConcussion = 20  ElseIf ( myShield.HasKeyword(ArmorMaterialHide))   sResistPenetration = 15   sResistCut = 15   sResistConcussion = 15  ElseIf ( myShield.HasKeyword(VendorItemAnimalHide))   sResistPenetration = 15   sResistCut = 15   sResistConcussion = 15    Else   sResistPenetration = 0   sResistCut = 0   sResistConcussion = 0  EndIfEndIfendFunctionFunction DetectWeaponDamages(Weapon fWeapon)if ( myWeapon.HasKeyword(WeapTypeDagger) || myWeapon.HasKeyword(WeapTypeSword) || myWeapon.HasKeyword(WeapTypeGreatsword) || myWeapon.HasKeyword(WeapTypeWarAxe) || myWeapon.HasKeyword(WeapTypeBattleaxe))  CutMin = 0  CutMax = 0  if ( myWeapon.HasKeyword(WeapMaterialIron))   CutMin = 1   CutMax = 50  ElseIf ( myWeapon.HasKeyword(WeapMaterialSteel))   CutMin = 2   CutMax = 53  ElseIf ( myWeapon.HasKeyword(WeapMaterialImperial))   CutMin = 3   CutMax = 55  ElseIf ( myWeapon.HasKeyword(WeapMaterialSilver))   CutMin = 1   CutMax = 45    ElseIf ( myWeapon.HasKeyword(WeapMaterialOrcish))   CutMin = 4   CutMax = 62  ElseIf ( myWeapon.HasKeyword(WeapMaterialDwarven))   CutMin = 7   CutMax = 65    ElseIf ( myWeapon.HasKeyword(WeapMaterialFalmer))   CutMin = 3   CutMax = 57  ElseIf ( myWeapon.HasKeyword(WeapMaterialFalmerHoned))   CutMin = 8   CutMax = 67  ElseIf ( myWeapon.HasKeyword(WeapMaterialElven))   CutMin = 10   CutMax = 70  ElseIf ( myWeapon.HasKeyword(WeapMaterialGlass))   CutMin = 20   CutMax = 75  ElseIf ( myWeapon.HasKeyword(WeapMaterialDraugr))   CutMin = 1   CutMax = 48  ElseIf ( myWeapon.HasKeyword(WeapMaterialDraugrHoned))   CutMin = 4   CutMax = 59   ElseIf ( myWeapon.HasKeyword(WeapMaterialEbony))   CutMin = 30   CutMax = 90  ElseIf ( myWeapon.HasKeyword(WeapMaterialDaedric))   CutMin = 40   CutMax = 100  ElseIf ( myWeapon.HasKeyword(WeapMaterialWood))   CutMin = 0   CutMax = 0   Else   CutMin = 0   CutMax = 0    EndIfElse  CutMin = 0  CutMax = 0EndIfPenetrationMin = 0PenetrationMax = 0ConcussionMin = 0ConcussionMax = 0If ( myWeapon.HasKeyword(WeapTypeBow))  if ( myWeapon.HasKeyword(WeapMaterialIron))   PenetrationMin = 26   PenetrationMax = 265   ConcussionMin = 1   ConcussionMax = 10    ElseIf ( myWeapon.HasKeyword(WeapMaterialSteel))   PenetrationMin = 27   PenetrationMax = 270   ConcussionMin = 1   ConcussionMax = 10   ElseIf ( myWeapon.HasKeyword(WeapMaterialImperial))   PenetrationMin = 27   PenetrationMax = 275   ConcussionMin = 1   ConcussionMax = 10   ElseIf ( myWeapon.HasKeyword(WeapMaterialSilver))   PenetrationMin = 26   PenetrationMax = 260   ConcussionMin = 1   ConcussionMax = 10     ElseIf ( myWeapon.HasKeyword(WeapMaterialOrcish))   PenetrationMin = 30   PenetrationMax = 300   ConcussionMin = 1   ConcussionMax = 15   ElseIf ( myWeapon.HasKeyword(WeapMaterialDwarven))   PenetrationMin = 34   PenetrationMax = 340   ConcussionMin = 1   ConcussionMax = 20	   ElseIf ( myWeapon.HasKeyword(WeapMaterialFalmer))   PenetrationMin = 31   PenetrationMax = 310   ConcussionMin = 1   ConcussionMax = 23    ElseIf ( myWeapon.HasKeyword(WeapMaterialFalmerHoned))   PenetrationMin = 35   PenetrationMax = 350   ConcussionMin = 1   ConcussionMax = 23  ElseIf ( myWeapon.HasKeyword(WeapMaterialElven))   PenetrationMin = 41   PenetrationMax = 410   ConcussionMin = 1   ConcussionMax = 10  ElseIf ( myWeapon.HasKeyword(WeapMaterialGlass))   PenetrationMin = 32   PenetrationMax = 320   ConcussionMin = 1   ConcussionMax = 15  ElseIf ( myWeapon.HasKeyword(WeapMaterialDraugr))   PenetrationMin = 16   PenetrationMax = 163   ConcussionMin = 1   ConcussionMax = 10  ElseIf ( myWeapon.HasKeyword(WeapMaterialDraugrHoned))   PenetrationMin = 18   PenetrationMax = 185   ConcussionMin = 1   ConcussionMax = 10  ElseIf ( myWeapon.HasKeyword(WeapMaterialEbony))   PenetrationMin = 36   PenetrationMax = 360   ConcussionMin = 3   ConcussionMax = 25  ElseIf ( myWeapon.HasKeyword(WeapMaterialDaedric))   PenetrationMin = 40   PenetrationMax = 400   ConcussionMin = 4   ConcussionMax = 30  ElseIf ( myWeapon.HasKeyword(WeapMaterialWood))   PenetrationMin = 9   PenetrationMax = 90   ConcussionMin = 1   ConcussionMax = 8  Else   PenetrationMin = 0   PenetrationMax = 0   ConcussionMin = 0   ConcussionMax = 0    EndIf   ; ArrowPenetration = 0  ; ArrowConcussion = 0   ; if ( akProjectile.HasKeyword(WeapMaterialIron))   ; ArrowPenetration = 5   ; ArrowConcussion = 0  ; ElseIf ( akProjectile.HasKeyword(WeapMaterialSteel))   ; ArrowPenetration = 10   ; ArrowConcussion = 1  ; ElseIf ( akProjectile.HasKeyword(WeapMaterialImperial))   ; ArrowPenetration = 15   ; ArrowConcussion = 1  ; ElseIf ( akProjectile.HasKeyword(WeapMaterialSilver))   ; ArrowPenetration = 1   ; ArrowConcussion = 0   ; ElseIf ( akProjectile.HasKeyword(WeapMaterialOrcish))   ; ArrowPenetration = 20   ; ArrowConcussion = 2  ; ElseIf ( akProjectile.HasKeyword(WeapMaterialDwarven))   ; ArrowPenetration = 25   ; ArrowConcussion = 2   ; ElseIf ( akProjectile.HasKeyword(WeapMaterialFalmer))   ; ArrowPenetration = 22   ; ArrowConcussion = 3  ; ElseIf ( akProjectile.HasKeyword(WeapMaterialFalmerHoned))   ; ArrowPenetration = 30   ; ArrowConcussion = 3  ; ElseIf ( akProjectile.HasKeyword(WeapMaterialElven))   ; ArrowPenetration = 50   ; ArrowConcussion = 5  ; ElseIf ( akProjectile.HasKeyword(WeapMaterialGlass))   ; ArrowPenetration = 35   ; ArrowConcussion = 3  ; ElseIf ( akProjectile.HasKeyword(WeapMaterialDraugr))   ; ArrowPenetration = 3   ; ArrowConcussion = 0  ; ElseIf ( akProjectile.HasKeyword(WeapMaterialDraugrHoned))   ; ArrowPenetration = 17   ; ArrowConcussion = 1  ; ElseIf ( akProjectile.HasKeyword(WeapMaterialEbony))   ; ArrowPenetration = 40   ; ArrowConcussion = 4  ; ElseIf ( akProjectile.HasKeyword(WeapMaterialDaedric))   ; ArrowPenetration = 45   ; ArrowConcussion = 4  ; ElseIf ( akProjectile.HasKeyword(WeapMaterialWood))   ; ArrowPenetration = 0   ; ArrowConcussion = 0  ; Else   ; ArrowPenetration = 0   ; ArrowConcussion = 0    ; EndIf   ; PenetrationMin = ( PenetrationMin + ArrowPenetration )  ; PenetrationMax = ( PenetrationMax + ArrowPenetration )  ; ConcussionMin = ( ConcussionMin + ArrowConcussion )  ; ConcussionMax = ( ConcussionMax + ArrowConcussion ) Elseif ( myWeapon.HasKeyword(WeapTypeDagger))  if ( myWeapon.HasKeyword(WeapMaterialIron))   PenetrationMin = 1   PenetrationMax = 35   ConcussionMin = 1   ConcussionMax = 10   pPenetrationMin = 10   pPenetrationMax = 130   pConcussionMin = 1   pConcussionMax = 10    ElseIf ( myWeapon.HasKeyword(WeapMaterialSteel))   PenetrationMin = 1   PenetrationMax = 37   ConcussionMin = 1   ConcussionMax = 10   pPenetrationMin = 13   pPenetrationMax = 140   pConcussionMin = 1   pConcussionMax = 10     ElseIf ( myWeapon.HasKeyword(WeapMaterialImperial))   PenetrationMin = 1   PenetrationMax = 39   ConcussionMin = 1   ConcussionMax = 10   pPenetrationMin = 15   pPenetrationMax = 145   pConcussionMin = 1   pConcussionMax = 10  ElseIf ( myWeapon.HasKeyword(WeapMaterialSilver))   PenetrationMin = 1   PenetrationMax = 33   ConcussionMin = 1   ConcussionMax = 10   pPenetrationMin = 8   pPenetrationMax = 125   pConcussionMin = 1   pConcussionMax = 10     ElseIf ( myWeapon.HasKeyword(WeapMaterialOrcish))   PenetrationMin = 2   PenetrationMax = 41   ConcussionMin = 1   ConcussionMax = 15   pPenetrationMin = 20   pPenetrationMax = 180   pConcussionMin = 1   pConcussionMax = 10    ElseIf ( myWeapon.HasKeyword(WeapMaterialDwarven))   PenetrationMin = 5   PenetrationMax = 45   ConcussionMin = 1   ConcussionMax = 20   pPenetrationMin = 25   pPenetrationMax = 200   pConcussionMin = 1   pConcussionMax = 17     ElseIf ( myWeapon.HasKeyword(WeapMaterialFalmer))   PenetrationMin = 3   PenetrationMax = 42   ConcussionMin = 1   ConcussionMax = 23   pPenetrationMin = 20   pPenetrationMax = 185   pConcussionMin = 2   pConcussionMax = 18    ElseIf ( myWeapon.HasKeyword(WeapMaterialFalmerHoned))   PenetrationMin = 5   PenetrationMax = 48   ConcussionMin = 1   ConcussionMax = 23   pPenetrationMin = 32   pPenetrationMax = 225   pConcussionMin = 2   pConcussionMax = 18     ElseIf ( myWeapon.HasKeyword(WeapMaterialElven))   PenetrationMin = 3   PenetrationMax = 40   ConcussionMin = 1   ConcussionMax = 10   pPenetrationMin = 22   pPenetrationMax = 190   pConcussionMin = 1   pConcussionMax = 10  ElseIf ( myWeapon.HasKeyword(WeapMaterialGlass))   PenetrationMin = 4   PenetrationMax = 43   ConcussionMin = 1   ConcussionMax = 15   pPenetrationMin = 24   pPenetrationMax = 230   pConcussionMin = 1   pConcussionMax = 15  ElseIf ( myWeapon.HasKeyword(WeapMaterialDraugr))   PenetrationMin = 1   PenetrationMax = 34   ConcussionMin = 1   ConcussionMax = 10   pPenetrationMin = 9   pPenetrationMax = 128   pConcussionMin = 1   pConcussionMax = 10  ElseIf ( myWeapon.HasKeyword(WeapMaterialDraugrHoned))   PenetrationMin = 2   PenetrationMax = 40   ConcussionMin = 1   ConcussionMax = 10   pPenetrationMin = 17   pPenetrationMax = 155   pConcussionMin = 1   pConcussionMax = 10  ElseIf ( myWeapon.HasKeyword(WeapMaterialEbony))   PenetrationMin = 7   PenetrationMax = 55   ConcussionMin = 3   ConcussionMax = 25   pPenetrationMin = 40   pPenetrationMax = 255   pConcussionMin = 3   pConcussionMax = 19  ElseIf ( myWeapon.HasKeyword(WeapMaterialDaedric))   PenetrationMin = 10   PenetrationMax = 65   ConcussionMin = 4   ConcussionMax = 30   pPenetrationMin = 75   pPenetrationMax = 300   pConcussionMin = 4   pConcussionMax = 20    ElseIf ( myWeapon.HasKeyword(WeapMaterialWood))   PenetrationMin = 0   PenetrationMax = 10   ConcussionMin = 1   ConcussionMax = 8    pPenetrationMin = 1   pPenetrationMax = 50   pConcussionMin = 1   pConcussionMax = 8  Else   PenetrationMin = 0   PenetrationMax = 0   ConcussionMin = 0   ConcussionMax = 0   pPenetrationMin = 0   pPenetrationMax = 0   pConcussionMin = 0   pConcussionMax = 0     EndIfElseif ( myWeapon.HasKeyword(WeapTypeSword))  if ( myWeapon.HasKeyword(WeapMaterialIron))   PenetrationMin = 1   PenetrationMax = 150   ConcussionMin = 69   ConcussionMax = 138   pPenetrationMin = 15   pPenetrationMax = 135   pConcussionMin = 1   pConcussionMax = 20  ElseIf ( myWeapon.HasKeyword(WeapMaterialSteel))   PenetrationMin = 1   PenetrationMax = 155   ConcussionMin = 71   ConcussionMax = 142   pPenetrationMin = 18   pPenetrationMax = 145   pConcussionMin = 1   pConcussionMax = 20  ElseIf ( myWeapon.HasKeyword(WeapMaterialImperial))   PenetrationMin = 1   PenetrationMax = 160   ConcussionMin = 73   ConcussionMax = 146   pPenetrationMin = 20   pPenetrationMax = 150   pConcussionMin = 1   pConcussionMax = 20  ElseIf ( myWeapon.HasKeyword(WeapMaterialSilver))   PenetrationMin = 1   PenetrationMax = 140   ConcussionMin = 75   ConcussionMax = 150   pPenetrationMin = 13   pPenetrationMax = 130   pConcussionMin = 1   pConcussionMax = 20  ElseIf ( myWeapon.HasKeyword(WeapMaterialOrcish))   PenetrationMin = 5   PenetrationMax = 175   ConcussionMin = 85   ConcussionMax = 170   pPenetrationMin = 25   pPenetrationMax = 185   pConcussionMin = 1   pConcussionMax = 22  ElseIf ( myWeapon.HasKeyword(WeapMaterialDwarven))   PenetrationMin = 15   PenetrationMax = 210   ConcussionMin = 100   ConcussionMax = 200   pPenetrationMin = 30   pPenetrationMax = 205   pConcussionMin = 3   pConcussionMax = 25  ElseIf ( myWeapon.HasKeyword(WeapMaterialFalmer))   PenetrationMin = 10   PenetrationMax = 185   ConcussionMin = 105   ConcussionMax = 210   pPenetrationMin = 27   pPenetrationMax = 190   pConcussionMin = 4   pConcussionMax = 27  ElseIf ( myWeapon.HasKeyword(WeapMaterialFalmerHoned))   PenetrationMin = 20   PenetrationMax = 225   ConcussionMin = 105   ConcussionMax = 210   pPenetrationMin = 48   pPenetrationMax = 235   pConcussionMin = 4   pConcussionMax = 27  ElseIf ( myWeapon.HasKeyword(WeapMaterialElven))   PenetrationMin = 5   PenetrationMax = 180   ConcussionMin = 80   ConcussionMax = 160   pPenetrationMin = 27   pPenetrationMax = 195   pConcussionMin = 1   pConcussionMax = 20  ElseIf ( myWeapon.HasKeyword(WeapMaterialGlass))   PenetrationMin = 10   PenetrationMax = 200   ConcussionMin = 95   ConcussionMax = 185   pPenetrationMin = 29   pPenetrationMax = 230   pConcussionMin = 2   pConcussionMax = 22  ElseIf ( myWeapon.HasKeyword(WeapMaterialDraugr))   PenetrationMin = 1   PenetrationMax = 145   ConcussionMin = 72   ConcussionMax = 144   pPenetrationMin = 14   pPenetrationMax = 133   pConcussionMin = 1   pConcussionMax = 20  ElseIf ( myWeapon.HasKeyword(WeapMaterialDraugrHoned))   PenetrationMin = 3   PenetrationMax = 165   ConcussionMin = 72   ConcussionMax = 144   pPenetrationMin = 22   pPenetrationMax = 160   pConcussionMin = 1   pConcussionMax = 20  ElseIf ( myWeapon.HasKeyword(WeapMaterialEbony))   PenetrationMin = 25   PenetrationMax = 255   ConcussionMin = 115   ConcussionMax = 225   pPenetrationMin = 45   pPenetrationMax = 255   pConcussionMin = 5   pConcussionMax = 30  ElseIf ( myWeapon.HasKeyword(WeapMaterialDaedric))   PenetrationMin = 35   PenetrationMax = 285   ConcussionMin = 130   ConcussionMax = 255   pPenetrationMin = 80   pPenetrationMax = 305   pConcussionMin = 5   pConcussionMax = 35  ElseIf ( myWeapon.HasKeyword(WeapMaterialWood))   PenetrationMin = 1   PenetrationMax = 10   ConcussionMin = 35   ConcussionMax = 70    pPenetrationMin = 0   pPenetrationMax = 50   pConcussionMin = 1   pConcussionMax = 15  Else   PenetrationMin = 0   PenetrationMax = 0   ConcussionMin = 0   ConcussionMax = 0   pPenetrationMin = 0   pPenetrationMax = 0   pConcussionMin = 0   pConcussionMax = 0  EndIfElseif ( myWeapon.HasKeyword(WeapTypeGreatsword))  if ( myWeapon.HasKeyword(WeapMaterialIron))   PenetrationMin = 5   PenetrationMax = 165   ConcussionMin = 90   ConcussionMax = 155   pPenetrationMin = 20   pPenetrationMax = 140   pConcussionMin = 2   pConcussionMax = 25  ElseIf ( myWeapon.HasKeyword(WeapMaterialSteel))   PenetrationMin = 5   PenetrationMax = 170   ConcussionMin = 95   ConcussionMax = 160   pPenetrationMin = 23   pPenetrationMax = 150   pConcussionMin = 2   pConcussionMax = 25  ElseIf ( myWeapon.HasKeyword(WeapMaterialImperial))   PenetrationMin = 5   PenetrationMax = 175   ConcussionMin = 100   ConcussionMax = 165   pPenetrationMin = 25   pPenetrationMax = 155   pConcussionMin = 2   pConcussionMax = 25  ElseIf ( myWeapon.HasKeyword(WeapMaterialSilver))   PenetrationMin = 5   PenetrationMax = 155   ConcussionMin = 105   ConcussionMax = 170    pPenetrationMin = 18   pPenetrationMax = 135   pConcussionMin = 2   pConcussionMax = 25  ElseIf ( myWeapon.HasKeyword(WeapMaterialOrcish))   PenetrationMin = 10   PenetrationMax = 190   ConcussionMin = 115   ConcussionMax = 195   pPenetrationMin = 30   pPenetrationMax = 190   pConcussionMin = 3   pConcussionMax = 27  ElseIf ( myWeapon.HasKeyword(WeapMaterialDwarven))   PenetrationMin = 20   PenetrationMax = 225   ConcussionMin = 130   ConcussionMax = 230    pPenetrationMin = 35   pPenetrationMax = 210   pConcussionMin = 5   pConcussionMax = 35  ElseIf ( myWeapon.HasKeyword(WeapMaterialFalmer))   PenetrationMin = 15   PenetrationMax = 195   ConcussionMin = 135   ConcussionMax = 245   pPenetrationMin = 32   pPenetrationMax = 195   pConcussionMin = 6   pConcussionMax = 37  ElseIf ( myWeapon.HasKeyword(WeapMaterialFalmerHoned))   PenetrationMin = 25   PenetrationMax = 250   ConcussionMin = 135   ConcussionMax = 245   pPenetrationMin = 43   pPenetrationMax = 240   pConcussionMin = 6   pConcussionMax = 37  ElseIf ( myWeapon.HasKeyword(WeapMaterialElven))   PenetrationMin = 10   PenetrationMax = 195   ConcussionMin = 110   ConcussionMax = 180   pPenetrationMin = 32   pPenetrationMax = 200   pConcussionMin = 2   pConcussionMax = 25  ElseIf ( myWeapon.HasKeyword(WeapMaterialGlass))   PenetrationMin = 15   PenetrationMax = 215   ConcussionMin = 120   ConcussionMax = 205   pPenetrationMin = 34   pPenetrationMax = 235   pConcussionMin = 4   pConcussionMax = 30  ElseIf ( myWeapon.HasKeyword(WeapMaterialDraugr))   PenetrationMin = 5   PenetrationMax = 160   ConcussionMin = 98   ConcussionMax = 163   pPenetrationMin = 19   pPenetrationMax = 138   pConcussionMin = 2   pConcussionMax = 25  ElseIf ( myWeapon.HasKeyword(WeapMaterialDraugrHoned))   PenetrationMin = 7   PenetrationMax = 180   ConcussionMin = 98   ConcussionMax = 163   pPenetrationMin = 27   pPenetrationMax = 165   pConcussionMin = 2   pConcussionMax = 25  ElseIf ( myWeapon.HasKeyword(WeapMaterialEbony))   PenetrationMin = 30   PenetrationMax = 270   ConcussionMin = 160   ConcussionMax = 260   pPenetrationMin = 50   pPenetrationMax = 260   pConcussionMin = 6   pConcussionMax = 40  ElseIf ( myWeapon.HasKeyword(WeapMaterialDaedric))   PenetrationMin = 40   PenetrationMax = 300   ConcussionMin = 180   ConcussionMax = 280   pPenetrationMin = 85   pPenetrationMax = 310   pConcussionMin = 7   pConcussionMax = 45  ElseIf ( myWeapon.HasKeyword(WeapMaterialWood))   PenetrationMin = 1   PenetrationMax = 15   ConcussionMin = 45   ConcussionMax = 90   pPenetrationMin = 1   pPenetrationMax = 50   pConcussionMin = 2   pConcussionMax = 20  Else   PenetrationMin = 0   PenetrationMax = 0   ConcussionMin = 0   ConcussionMax = 0     pPenetrationMin = 0   pPenetrationMax = 0   pConcussionMin = 0   pConcussionMax = 0  EndIfElseif ( myWeapon.HasKeyword(WeapTypeWarAxe))  if ( myWeapon.HasKeyword(WeapMaterialIron))   PenetrationMin = 5   PenetrationMax = 165   ConcussionMin = 65   ConcussionMax = 145   pPenetrationMin = 90   pPenetrationMax = 180   pConcussionMin = 80   pConcussionMax = 170  ElseIf ( myWeapon.HasKeyword(WeapMaterialSteel))   PenetrationMin = 5   PenetrationMax = 170   ConcussionMin = 68   ConcussionMax = 150   pPenetrationMin = 93   pPenetrationMax = 185   pConcussionMin = 83   pConcussionMax = 175  ElseIf ( myWeapon.HasKeyword(WeapMaterialImperial))   PenetrationMin = 5   PenetrationMax = 175   ConcussionMin = 70   ConcussionMax = 155   pPenetrationMin = 95   pPenetrationMax = 190   pConcussionMin = 85   pConcussionMax = 180  ElseIf ( myWeapon.HasKeyword(WeapMaterialSilver))   PenetrationMin = 5   PenetrationMax = 155   ConcussionMin = 75   ConcussionMax = 160   pPenetrationMin = 87   pPenetrationMax = 175   pConcussionMin = 90   pConcussionMax = 185    ElseIf ( myWeapon.HasKeyword(WeapMaterialOrcish))   PenetrationMin = 10   PenetrationMax = 190   ConcussionMin = 85   ConcussionMax = 180   pPenetrationMin = 110   pPenetrationMax = 215   pConcussionMin = 100   pConcussionMax = 205  ElseIf ( myWeapon.HasKeyword(WeapMaterialDwarven))   PenetrationMin = 20   PenetrationMax = 225   ConcussionMin = 95   ConcussionMax = 200   pPenetrationMin = 120   pPenetrationMax = 235   pConcussionMin = 110   pConcussionMax = 225  ElseIf ( myWeapon.HasKeyword(WeapMaterialFalmer))   PenetrationMin = 13   PenetrationMax = 200   ConcussionMin = 100   ConcussionMax = 207   pPenetrationMin = 112   pPenetrationMax = 220   pConcussionMin = 115   pConcussionMax = 233  ElseIf ( myWeapon.HasKeyword(WeapMaterialFalmerHoned))   PenetrationMin = 25   PenetrationMax = 245   ConcussionMin = 100   ConcussionMax = 207   pPenetrationMin = 125   pPenetrationMax = 242   pConcussionMin = 115   pConcussionMax = 233  ElseIf ( myWeapon.HasKeyword(WeapMaterialElven))   PenetrationMin = 10   PenetrationMax = 195   ConcussionMin = 80   ConcussionMax = 170   pPenetrationMin = 105   pPenetrationMax = 205   pConcussionMin = 95   pConcussionMax = 195  ElseIf ( myWeapon.HasKeyword(WeapMaterialGlass))   PenetrationMin = 15   PenetrationMax = 215   ConcussionMin = 90   ConcussionMax = 190   pPenetrationMin = 115   pPenetrationMax = 225   pConcussionMin = 105   pConcussionMax = 215  ElseIf ( myWeapon.HasKeyword(WeapMaterialDraugr))   PenetrationMin = 5   PenetrationMax = 150   ConcussionMin = 69   ConcussionMax = 153   pPenetrationMin = 89   pPenetrationMax = 178   pConcussionMin = 84   pConcussionMax = 178  ElseIf ( myWeapon.HasKeyword(WeapMaterialDraugrHoned))   PenetrationMin = 7   PenetrationMax = 180   ConcussionMin = 69   ConcussionMax = 153   pPenetrationMin = 100   pPenetrationMax = 200   pConcussionMin = 84   pConcussionMax = 178  ElseIf ( myWeapon.HasKeyword(WeapMaterialEbony))   PenetrationMin = 30   PenetrationMax = 270   ConcussionMin = 105   ConcussionMax = 215   pPenetrationMin = 130   pPenetrationMax = 250   pConcussionMin = 120   pConcussionMax = 240  ElseIf ( myWeapon.HasKeyword(WeapMaterialDaedric))   PenetrationMin = 40   PenetrationMax = 300   ConcussionMin = 115   ConcussionMax = 240   pPenetrationMin = 140   pPenetrationMax = 275   pConcussionMin = 130   pConcussionMax = 265  ElseIf ( myWeapon.HasKeyword(WeapMaterialWood))   PenetrationMin = 1   PenetrationMax = 55   ConcussionMin = 35   ConcussionMax = 70   pPenetrationMin = 5   pPenetrationMax = 75   pConcussionMin = 40   pConcussionMax = 90    Else   PenetrationMin = 0   PenetrationMax = 0   ConcussionMin = 0   ConcussionMax = 0    pPenetrationMin = 0   pPenetrationMax = 0   pConcussionMin = 0   pConcussionMax = 0  EndIfElseif ( myWeapon.HasKeyword(WeapTypeBattleaxe))  if ( myWeapon.HasKeyword(WeapMaterialIron))   PenetrationMin = 108   PenetrationMax = 215   ConcussionMin = 93   ConcussionMax = 175   pPenetrationMin = 133   pPenetrationMax = 265   pConcussionMin = 113   pConcussionMax = 215  ElseIf ( myWeapon.HasKeyword(WeapMaterialSteel))   PenetrationMin = 110   PenetrationMax = 220   ConcussionMin = 95   ConcussionMax = 180   pPenetrationMin = 135   pPenetrationMax = 270   pConcussionMin = 115   pConcussionMax = 220  ElseIf ( myWeapon.HasKeyword(WeapMaterialImperial))   PenetrationMin = 113   PenetrationMax = 225   ConcussionMin = 98   ConcussionMax = 185   pPenetrationMin = 138   pPenetrationMax = 275   pConcussionMin = 118   pConcussionMax = 225  ElseIf ( myWeapon.HasKeyword(WeapMaterialSilver))   PenetrationMin = 105   PenetrationMax = 210   ConcussionMin = 100   ConcussionMax = 190    pPenetrationMin = 130   pPenetrationMax = 260   pConcussionMin = 120   pConcussionMax = 230  ElseIf ( myWeapon.HasKeyword(WeapMaterialOrcish))   PenetrationMin = 125   PenetrationMax = 250   ConcussionMin = 110   ConcussionMax = 220   pPenetrationMin = 150   pPenetrationMax = 300   pConcussionMin = 130   pConcussionMax = 260  ElseIf ( myWeapon.HasKeyword(WeapMaterialDwarven))   PenetrationMin = 145   PenetrationMax = 290   ConcussionMin = 130   ConcussionMax = 260    pPenetrationMin = 170   pPenetrationMax = 340   pConcussionMin = 150   pConcussionMax = 300  ElseIf ( myWeapon.HasKeyword(WeapMaterialFalmer))   PenetrationMin = 128   PenetrationMax = 255   ConcussionMin = 135   ConcussionMax = 270   pPenetrationMin = 155   pPenetrationMax = 310   pConcussionMin = 155   pConcussionMax = 310  ElseIf ( myWeapon.HasKeyword(WeapMaterialFalmerHoned))   PenetrationMin = 150   PenetrationMax = 270   ConcussionMin = 135   ConcussionMax = 270   pPenetrationMin = 175   pPenetrationMax = 350   pConcussionMin = 155   pConcussionMax = 310  ElseIf ( myWeapon.HasKeyword(WeapMaterialElven))   PenetrationMin = 120   PenetrationMax = 240   ConcussionMin = 105   ConcussionMax = 200   pPenetrationMin = 145   pPenetrationMax = 290   pConcussionMin = 125   pConcussionMax = 240  ElseIf ( myWeapon.HasKeyword(WeapMaterialGlass))   PenetrationMin = 135   PenetrationMax = 270   ConcussionMin = 120   ConcussionMax = 240   pPenetrationMin = 160   pPenetrationMax = 320   pConcussionMin = 140   pConcussionMax = 280  ElseIf ( myWeapon.HasKeyword(WeapMaterialDraugr))   PenetrationMin = 107   PenetrationMax = 213   ConcussionMin = 97   ConcussionMax = 183   pPenetrationMin = 132   pPenetrationMax = 163   pConcussionMin = 117   pConcussionMax = 123  ElseIf ( myWeapon.HasKeyword(WeapMaterialDraugrHoned))   PenetrationMin = 118   PenetrationMax = 235   ConcussionMin = 97   ConcussionMax = 183   pPenetrationMin = 142   pPenetrationMax = 185   pConcussionMin = 117   pConcussionMax = 123  ElseIf ( myWeapon.HasKeyword(WeapMaterialEbony))   PenetrationMin = 155   PenetrationMax = 310   ConcussionMin = 140   ConcussionMax = 280   pPenetrationMin = 180   pPenetrationMax = 360   pConcussionMin = 160   pConcussionMax = 320  ElseIf ( myWeapon.HasKeyword(WeapMaterialDaedric))   PenetrationMin = 175   PenetrationMax = 350   ConcussionMin = 160   ConcussionMax = 320   pPenetrationMin = 200   pPenetrationMax = 400   pConcussionMin = 180   pConcussionMax = 360  ElseIf ( myWeapon.HasKeyword(WeapMaterialWood))   PenetrationMin = 0   PenetrationMax = 0   ConcussionMin = 40   ConcussionMax = 80   pPenetrationMin = 10   pPenetrationMax = 90   pConcussionMin = 55   pConcussionMax = 110  Else   PenetrationMin = 0   PenetrationMax = 0   ConcussionMin = 0   ConcussionMax = 0   pPenetrationMin = 0   pPenetrationMax = 0   pConcussionMin = 0   pConcussionMax = 0  EndIfElseif ( myWeapon.HasKeyword(WeapTypeMace))  if ( myWeapon.HasKeyword(WeapMaterialIron))   PenetrationMin = 65   PenetrationMax = 145   ConcussionMin = 75   ConcussionMax = 155   pPenetrationMin = 80   pPenetrationMax = 170   pConcussionMin = 90   pConcussionMax = 180  ElseIf ( myWeapon.HasKeyword(WeapMaterialSteel))   PenetrationMin = 68   PenetrationMax = 150   ConcussionMin = 78   ConcussionMax = 160   pPenetrationMin = 83   pPenetrationMax = 175   pConcussionMin = 93   pConcussionMax = 185  ElseIf ( myWeapon.HasKeyword(WeapMaterialImperial))   PenetrationMin = 70   PenetrationMax = 155   ConcussionMin = 80   ConcussionMax = 165   pPenetrationMin = 85   pPenetrationMax = 180   pConcussionMin = 95   pConcussionMax = 190  ElseIf ( myWeapon.HasKeyword(WeapMaterialSilver))   PenetrationMin = 75   PenetrationMax = 160   ConcussionMin = 85   ConcussionMax = 170   pPenetrationMin = 90   pPenetrationMax = 185   pConcussionMin = 100   pConcussionMax = 195    ElseIf ( myWeapon.HasKeyword(WeapMaterialOrcish))   PenetrationMin = 85   PenetrationMax = 180   ConcussionMin = 95   ConcussionMax = 190   pPenetrationMin = 100   pPenetrationMax = 205   pConcussionMin = 110   pConcussionMax = 215  ElseIf ( myWeapon.HasKeyword(WeapMaterialDwarven))   PenetrationMin = 95   PenetrationMax = 200   ConcussionMin = 105   ConcussionMax = 210    pPenetrationMin = 110   pPenetrationMax = 225   pConcussionMin = 120   pConcussionMax = 235  ElseIf ( myWeapon.HasKeyword(WeapMaterialFalmer))   PenetrationMin = 80   PenetrationMax = 185   ConcussionMin = 110   ConcussionMax = 218   pPenetrationMin = 102   pPenetrationMax = 210   pConcussionMin = 125   pConcussionMax = 242  ElseIf ( myWeapon.HasKeyword(WeapMaterialFalmerHoned))   PenetrationMin = 100   PenetrationMax = 208   ConcussionMin = 110   ConcussionMax = 218   pPenetrationMin = 115   pPenetrationMax = 232   pConcussionMin = 125   pConcussionMax = 242  ElseIf ( myWeapon.HasKeyword(WeapMaterialElven))   PenetrationMin = 80   PenetrationMax = 170   ConcussionMin = 90   ConcussionMax = 180   pPenetrationMin = 95   pPenetrationMax = 195   pConcussionMin = 105   pConcussionMax = 205  ElseIf ( myWeapon.HasKeyword(WeapMaterialGlass))   PenetrationMin = 90   PenetrationMax = 190   ConcussionMin = 100   ConcussionMax = 200   pPenetrationMin = 105   pPenetrationMax = 215   pConcussionMin = 115   pConcussionMax = 225  ElseIf ( myWeapon.HasKeyword(WeapMaterialDraugr))   PenetrationMin = 63   PenetrationMax = 143   ConcussionMin = 79   ConcussionMax = 163   pPenetrationMin = 68   pPenetrationMax = 168   pConcussionMin = 94   pConcussionMax = 188  ElseIf ( myWeapon.HasKeyword(WeapMaterialDraugrHoned))   PenetrationMin = 75   PenetrationMax = 165   ConcussionMin = 79   ConcussionMax = 163   pPenetrationMin = 90   pPenetrationMax = 185   pConcussionMin = 94   pConcussionMax = 188  ElseIf ( myWeapon.HasKeyword(WeapMaterialEbony))   PenetrationMin = 105   PenetrationMax = 215   ConcussionMin = 115   ConcussionMax = 225   pPenetrationMin = 120   pPenetrationMax = 240   pConcussionMin = 130   pConcussionMax = 250  ElseIf ( myWeapon.HasKeyword(WeapMaterialDaedric))   PenetrationMin = 115   PenetrationMax = 240   ConcussionMin = 125   ConcussionMax = 250   pPenetrationMin = 130   pPenetrationMax = 265   pConcussionMin = 140   pConcussionMax = 275  ElseIf ( myWeapon.HasKeyword(WeapMaterialWood))   PenetrationMin = 0   PenetrationMax = 0   ConcussionMin = 10   ConcussionMax = 35   pPenetrationMin = 1   pPenetrationMax = 55   pConcussionMin = 50   pConcussionMax = 100  Else   PenetrationMin = 0   PenetrationMax = 0   ConcussionMin = 0   ConcussionMax = 0    pPenetrationMin = 0   pPenetrationMax = 0   pConcussionMin = 0   pConcussionMax = 0  EndIfElseif ( myWeapon.HasKeyword(WeapTypeWarhammer))  if ( myWeapon.HasKeyword(WeapMaterialIron))   PenetrationMin = 0   PenetrationMax = 0   ConcussionMin = 108   ConcussionMax = 215   pPenetrationMin = 0   pPenetrationMax = 0   pConcussionMin = 133   pConcussionMax = 265  ElseIf ( myWeapon.HasKeyword(WeapMaterialSteel))   PenetrationMin = 0   PenetrationMax = 0   ConcussionMin = 110   ConcussionMax = 220   pPenetrationMin = 0   pPenetrationMax = 0   pConcussionMin = 135   pConcussionMax = 270  ElseIf ( myWeapon.HasKeyword(WeapMaterialImperial))   PenetrationMin = 0   PenetrationMax = 0   ConcussionMin = 113   ConcussionMax = 225   pPenetrationMin = 0   pPenetrationMax = 0   pConcussionMin = 138   pConcussionMax = 275  ElseIf ( myWeapon.HasKeyword(WeapMaterialSilver))   PenetrationMin = 0   PenetrationMax = 0   ConcussionMin = 115   ConcussionMax = 230   pPenetrationMin = 0   pPenetrationMax = 0   pConcussionMin = 140   pConcussionMax = 280  ElseIf ( myWeapon.HasKeyword(WeapMaterialOrcish))   PenetrationMin = 0   PenetrationMax = 0   ConcussionMin = 125   ConcussionMax = 250   pPenetrationMin = 0   pPenetrationMax = 0   pConcussionMin = 150   pConcussionMax = 300  ElseIf ( myWeapon.HasKeyword(WeapMaterialDwarven))   PenetrationMin = 0   PenetrationMax = 0   ConcussionMin = 145   ConcussionMax = 290    pPenetrationMin = 0   pPenetrationMax = 0   pConcussionMin = 170   pConcussionMax = 340  ElseIf ( myWeapon.HasKeyword(WeapMaterialFalmer))   PenetrationMin = 0   PenetrationMax = 0   ConcussionMin = 150   ConcussionMax = 300   pPenetrationMin = 0   pPenetrationMax = 0   pConcussionMin = 175   pConcussionMax = 350  ElseIf ( myWeapon.HasKeyword(WeapMaterialFalmerHoned))   PenetrationMin = 0   PenetrationMax = 0   ConcussionMin = 155   ConcussionMax = 305   pPenetrationMin = 0   pPenetrationMax = 0   pConcussionMin = 175   pConcussionMax = 355  ElseIf ( myWeapon.HasKeyword(WeapMaterialElven))   PenetrationMin = 0   PenetrationMax = 0   ConcussionMin = 120   ConcussionMax = 240   pPenetrationMin = 0   pPenetrationMax = 0   pConcussionMin = 145   pConcussionMax = 290  ElseIf ( myWeapon.HasKeyword(WeapMaterialGlass))   PenetrationMin = 0   PenetrationMax = 0   ConcussionMin = 135   ConcussionMax = 270   pPenetrationMin = 0   pPenetrationMax = 0   pConcussionMin = 160   pConcussionMax = 320  ElseIf ( myWeapon.HasKeyword(WeapMaterialDraugr))   PenetrationMin = 0   PenetrationMax = 0   ConcussionMin = 105   ConcussionMax = 213   pPenetrationMin = 0   pPenetrationMax = 0   pConcussionMin = 136   pConcussionMax = 273  ElseIf ( myWeapon.HasKeyword(WeapMaterialDraugrHoned))   PenetrationMin = 0   PenetrationMax = 0   ConcussionMin = 105   ConcussionMax = 218   pPenetrationMin = 0   pPenetrationMax = 0   pConcussionMin = 136   pConcussionMax = 278  ElseIf ( myWeapon.HasKeyword(WeapMaterialEbony))   PenetrationMin = 0   PenetrationMax = 0   ConcussionMin = 155   ConcussionMax = 310   pPenetrationMin = 0   pPenetrationMax = 0   pConcussionMin = 180   pConcussionMax = 360  ElseIf ( myWeapon.HasKeyword(WeapMaterialDaedric))   PenetrationMin = 0   PenetrationMax = 0   ConcussionMin = 175   ConcussionMax = 350   pPenetrationMin = 0   pPenetrationMax = 0   pConcussionMin = 200   pConcussionMax = 400  ElseIf ( myWeapon.HasKeyword(WeapMaterialWood))   PenetrationMin = 0   PenetrationMax = 0   ConcussionMin = 50   ConcussionMax = 100   pPenetrationMin = 0   pPenetrationMax = 0   pConcussionMin = 75   pConcussionMax = 150  Else   PenetrationMin = 0   PenetrationMax = 0   ConcussionMin = 0   ConcussionMax = 0   pPenetrationMin = 0   pPenetrationMax = 0   pConcussionMin = 0   pConcussionMax = 0    EndIfEndIfSetDamage()endFunctionFunction SetDamage()myPenetrationMin = PenetrationMinmyPenetrationMax = PenetrationMaxmyCutMin = CutMinmyCutMax = CutMaxmyConcussionMin = ConcussionMinmyConcussionMax = ConcussionMaxmypPenetrationMin = pPenetrationMinmypPenetrationMax = pPenetrationMaxmypConcussionMin = pConcussionMinmypConcussionMax = pConcussionMaxif GetEquippedWeapon(True) == myWeaponSetLeftDamage()elseif GetEquippedWeapon() == myWeaponSetRightDamage() endifendFunctionFunction SetRightDamage()if (Self.GetEquippedItemType(1) == 0)myRPenetrationMin = 0myRPenetrationMax = 0myRCutMin = 0myRCutMax = 0myRConcussionMin = 0myRConcussionMax = 0myRpPenetrationMin = 0myRpPenetrationMax = 0myRpConcussionMin = 0myRpConcussionMax = 0elsemyRPenetrationMin = myPenetrationMinmyRPenetrationMax = myPenetrationMaxmyRCutMin = myCutMinmyRCutMax = myCutMaxmyRConcussionMin = myConcussionMin + 1myRConcussionMax = myConcussionMax + 1myRpPenetrationMin = mypPenetrationMinmyRpPenetrationMax = mypPenetrationMaxmyRpConcussionMin = mypConcussionMin + 1myRpConcussionMax = mypConcussionMax + 1endif;Debug.MessageBox("SetRight    Right " + myRPenetrationMax + " Left " + myLPenetrationMax )endFunctionFunction SetLeftDamage()if (Self.GetEquippedItemType(0) == 0)myLPenetrationMin = 0myLPenetrationMax = 0myLCutMin = 0myLCutMax = 0myLConcussionMin = 0myLConcussionMax = 0myLpPenetrationMin = 0myLpPenetrationMax = 0myLpConcussionMin = 0myLpConcussionMax = 0elsemyLPenetrationMin = myPenetrationMinmyLPenetrationMax = myPenetrationMaxmyLCutMin = myCutMinmyLCutMax = myCutMaxmyLConcussionMin = myConcussionMin + 1myLConcussionMax = myConcussionMax + 1myLpPenetrationMin = mypPenetrationMinmyLpPenetrationMax = mypPenetrationMaxmyLpConcussionMin = mypConcussionMin + 1myLpConcussionMax = mypConcussionMax + 1endif;Debug.MessageBox("SetLeft    Right " + myRPenetrationMax + " Left " + myLPenetrationMax )endFunctionFunction Bleed(int fBleed)Bleed = fBleedif Bleeder == 0Bleed = 0elseif Bleeder == 1if Bleed > 1  Bleed = Bleed - 2Else  Bleed = 0endif elseif Bleeder == 2if Bleed > 0  Bleed = ( Bleed - 1 )Else  Bleed = 0endifendif if Bleed == 1SAWDBleedLight.cast(Self , Self)elseif  Bleed == 2SAWDBleedModerate.cast(Self , Self)elseif  Bleed == 3SAWDBleedHeavy.cast(Self , Self)EndIfBleed = 0endFunctionFunction Damage(int fDamage)Damage = fDamageif Magical == 1if AntiMagic == 1  Damage = Damage * 2elseif AntiMagic == 0  if Physical == 0   Damage = 0  EndIfendifendifSelf.DamageAV("Health", Damage)Damage = 0endFunctionFunction Stagger(int fStagger)Stagger = fStaggerif Physical == 0Stagger = 0Endifif Physical == 2if Stagger > 0  Stagger = Stagger - 1endifEndifif Stagger == 1SAWDStagger.cast(Self , Self)elseif Stagger == 2SAWDKneel.cast(Self , Self)endifStagger = 0endFunctionEvent OnInit()DetectActorType()EndEventEvent OnObjectEquipped(Form akBaseObject, ObjectReference akReference)if akBaseObject as Armorif ( akBaseObject.HasKeyword(ArmorCuirass))  ResistPenetration = nResistPenetration  ResistCut = nResistCut  ResistConcussion = nResistConcussion  myArmor = (akBaseObject as Armor)  DetectArmorResistances(myArmor)  ResistPenetration = ResistPenetration + nResistPenetration  ResistCut = ResistCut + nResistCut  ResistConcussion = ResistConcussion + nResistConcussion  ;Debug.MessageBox(" Risist Penetration " + ResistPenetration + " Risist Cut " + ResistCut + " Risist Concussion " + ResistConcussion )endifif ( akBaseObject.HasKeyword(ArmorShield))  sResistPenetration = 0  sResistCut = 0  sResistConcussion = 0  myShield = (akBaseObject as Armor)  DetectShieldResistances(myShield)  ;Debug.MessageBox(" Risist Penetration " + sResistPenetration + " Risist Cut " + sResistCut + " Risist Concussion " + sResistConcussion )endifendIfif akBaseObject as WeaponmyWeapon = (akBaseObject as Weapon)DetectWeaponDamages(myWeapon)endIfendEventEvent OnObjectUnequipped(Form akBaseObject, ObjectReference akReference)if akBaseObject as Armorif ( akBaseObject.HasKeyword(ArmorCuirass))  ResistPenetration = nResistPenetration  ResistCut = nResistCut  ResistConcussion = nResistConcussion  ;Debug.MessageBox(" Risist Penetration " + ResistPenetration + " Risist Cut " + ResistCut + " Risist Concussion " + ResistConcussion )endifif ( akBaseObject.HasKeyword(ArmorShield))  sResistPenetration = 0  sResistCut = 0  sResistConcussion = 1  ;Debug.MessageBox(" Risist Penetration " + sResistPenetration + " Risist Cut " + sResistCut + " Risist Concussion " + sResistConcussion )endif endIfif akBaseObject as Weaponif (Self.GetEquippedItemType(0) == 0)  myLPenetrationMin = nPenetrationMin  myLPenetrationMax = nPenetrationMax  myLCutMin = nCutMin  myLCutMax = nCutMax  myLConcussionMin = nConcussionMin  myLConcussionMax = nConcussionMax  myLpPenetrationMin = npPenetrationMin  myLpPenetrationMax = npPenetrationMax  myLpConcussionMin = npConcussionMin  myLpConcussionMax = npConcussionMaxendifif (Self.GetEquippedItemType(1) == 0)  myRPenetrationMin = nPenetrationMin  myRPenetrationMax = nPenetrationMax  myRCutMin = nCutMin  myRCutMax = nCutMax  myRConcussionMin = nConcussionMin  myRConcussionMax = nConcussionMax  myRpPenetrationMin = npPenetrationMin  myRpPenetrationMax = npPenetrationMax  myRpConcussionMin = npConcussionMin  myRpConcussionMax = npConcussionMaxendIfendifEndEventEvent OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, \bool abBashAttack, bool abHitBlocked)if (akSource as spell) == NONEif abBashAttack == False  aPenetrationMin = 0  aPenetrationMax = 0  aCutMin = 0  aCutMax = 0  aConcussionMin = 0  aConcussionMax = 0  apPenetrationMin = 0  apPenetrationMax = 0  apConcussionMin = 0  apConcussionMax = 0  AntiMagic = 0   if (akAggressor as SAWDonHit).GetEquippedWeapon(True) == akSource   aPenetrationMin = (akAggressor as SAWDonHit).myLPenetrationMin   aPenetrationMax = (akAggressor as SAWDonHit).myLPenetrationMax   aCutMin = (akAggressor as SAWDonHit).myLCutMin   aCutMax = (akAggressor as SAWDonHit).myLCutMax   aConcussionMin = (akAggressor as SAWDonHit).myLConcussionMin   aConcussionMax = (akAggressor as SAWDonHit).myLConcussionMax   apPenetrationMin = (akAggressor as SAWDonHit).myLpPenetrationMin   apPenetrationMax = (akAggressor as SAWDonHit).myLpPenetrationMax   apConcussionMin = (akAggressor as SAWDonHit).myLpConcussionMin   apConcussionMax = (akAggressor as SAWDonHit).myLpConcussionMax  else   aPenetrationMin = (akAggressor as SAWDonHit).myRPenetrationMin   aPenetrationMax = (akAggressor as SAWDonHit).myRPenetrationMax   aCutMin = (akAggressor as SAWDonHit).myRCutMin   aCutMax = (akAggressor as SAWDonHit).myRCutMax   aConcussionMin = (akAggressor as SAWDonHit).myRConcussionMin   aConcussionMax = (akAggressor as SAWDonHit).myRConcussionMax   apPenetrationMin = (akAggressor as SAWDonHit).myRpPenetrationMin   apPenetrationMax = (akAggressor as SAWDonHit).myRpPenetrationMax   apConcussionMin = (akAggressor as SAWDonHit).myRpConcussionMin   apConcussionMax = (akAggressor as SAWDonHit).myRpConcussionMax  endif   if (akSource.HasKeyword(WeapMaterialSilver)) || (akSource.HasKeyword(WeapMaterialDaedric)) || (akProjectile.HasKeyword(WeapMaterialSilver)) || (akProjectile.HasKeyword(WeapMaterialDaedric))   AntiMagic = 1  Else   AntiMagic = 0  endif   PenetrationRoll = 0  CutRoll = 0  ConcussionRoll = 0   PenetrationSuccess = 0  CutSuccess = 0  ConcussionSuccess = 0  ResistCutTemp = ResistCut   if abPowerAttack == False   if abSneakAttack == False    PenetrationRoll = utility.RandomInt( aPenetrationMin , aPenetrationMax ) + 1    CutRoll = utility.RandomInt( aCutMin , aCutMax ) + 1    ConcussionRoll = utility.RandomInt( aConcussionMin , aConcussionMax ) + 1   else    PenetrationRoll = utility.RandomInt( apPenetrationMax , apPenetrationMax ) + 1    CutRoll = utility.RandomInt( aCutMax , aCutMax ) + 1    ConcussionRoll = utility.RandomInt( apConcussionMax , apConcussionMax ) + 1   EndIf  elseif abPowerAttack == True   if abSneakAttack == False    PenetrationRoll = utility.RandomInt( aPenetrationMin , aPenetrationMax ) + 1    CutRoll = utility.RandomInt( aCutMin , aCutMax ) + 1    ConcussionRoll = utility.RandomInt( aConcussionMin , aConcussionMax ) + 1   else    PenetrationRoll = utility.RandomInt( apPenetrationMax , apPenetrationMax ) + 1    CutRoll = utility.RandomInt( aCutMax , aCutMax ) + 1    ConcussionRoll = utility.RandomInt( apConcussionMax , apConcussionMax ) + 1   endif  endif   If abHitBlocked == False   If ( akSource.HasKeyword(WeapTypeBow))    if PenetrationRoll > ( ResistPenetration * 1.2 )	 PenetrationSuccess = 1    ElseIf  PenetrationRoll > ResistPenetration	 PenetrationSuccess = 2      Else	 PenetrationSuccess = 0    EndIf      ElseIf PenetrationRoll > ResistPenetration    ResistCutTemp = 0    PenetrationSuccess = 1   Else    PenetrationSuccess = 0   EndIf   if CutRoll > ResistCutTemp    CutSuccess = 1   Else    CutSuccess = 0   EndIf   if (ConcussionRoll > 200) && (ConcussionRoll > ( ResistConcussion * 3 ))    ConcussionSuccess = 1   ElseIf  (ConcussionRoll > 100) && ( ConcussionRoll > (ResistConcussion * 2.5 ))    ConcussionSuccess = 2   ElseIf  ConcussionRoll > ( ResistConcussion * 2 )    ConcussionSuccess = 3   ElseIf  ConcussionRoll > ( ResistConcussion * 1.5 )    ConcussionSuccess = 4   ElseIf  ConcussionRoll > ResistConcussion    ConcussionSuccess = 5     Else    ConcussionSuccess = 0   EndIf  Else   if (Self.GetEquippedItemType(0) == 10)    if ConcussionRoll > ( sResistConcussion * 2 )	 Stagger(2)    ElseIf ConcussionRoll > sResistConcussion	 Stagger(1)    Endif   Else    If ConcussionRoll > myRConcussionMin	 Stagger(2)    ElseIf ConcussionRoll > ( myRConcussionMin * 0.5 )	 Stagger(1)    Endif      Endif   ;Debug.MessageBox(" Concussion Roll " + ConcussionRoll + " Shield Resist " + sResistConcussion + " Weapon Resist " + ( myRConcussionMin * 0.5 ))  EndIf   if abPowerAttack == False   If ( akSource.HasKeyword(WeapTypeBow))    If PenetrationSuccess == 1	 Stagger(2)	 Damage(10)	 Bleed(2)    ElseIf PenetrationSuccess == 2	 Stagger(1)	 Damage(5)	 Bleed(1)	    EndIf   ElseIf PenetrationSuccess == 1    Stagger(2)    Damage(25)   Endif   if Cutsuccess == 1    Stagger(2)    Damage(5)    Bleed(2)   EndIf   if ConcussionSuccess == 1    Self.kill()   ElseIf ConcussionSuccess == 2    Stagger(2)    Damage(50)    Bleed(1)   ElseIf ConcussionSuccess == 3    Stagger(2)    Damage(25)   ElseIf ConcussionSuccess == 4    Stagger(1)    Damage(10)     ElseIf ConcussionSuccess == 5    Stagger(1)   EndIf  ElseIf abPowerAttack == True   if ( akSource.HasKeyword(WeapTypeDagger) || akSource.HasKeyword(WeapTypeSword) || akSource.HasKeyword(WeapTypeGreatsword))    if PenetrationSuccess == 1	 Stagger(2)	 Damage(10)	 Bleed(2)    EndIf   ElseIf ( akSource.HasKeyword(WeapTypeWarAxe) || akSource.HasKeyword(WeapTypeBattleaxe))    if PenetrationSuccess == 1	 Stagger(2)	 Damage(25)	 Bleed(3)    EndIf   Else    if PenetrationSuccess == 1	 Stagger(2)	 Damage(25)    EndIf    EndIf   if ConcussionSuccess == 1    Self.kill()   ElseIf ConcussionSuccess == 2    Stagger(2)    Damage(50)    Bleed(1)     ElseIf ConcussionSuccess == 3    Stagger(2)    Damage(25)   ElseIf ConcussionSuccess == 4    Stagger(1)    Damage(10)   ElseIf ConcussionSuccess == 5    Stagger(1)   EndIf  EndIf  if (akAggressor == Game.GetPlayer()) && (AntiMagic == 0) && (Physical == 0)   Debug.Notification("Your weapon is very weak")  endif  if (akAggressor == Game.GetPlayer()) && (aPenetrationMax <= ResistPenetration) && (aCutMax <= ResistCut) && (aConcussionMax <= ResistConcussion) && (apPenetrationMax <= ResistPenetration) && (apConcussionMax <= ResistConcussion)   Debug.Notification("Your weapon is made for physical foes")  endifendifEndIf  ;Debug.MessageBox(" Penetration " + PenetrationRoll + " Risist Penetration " + ResistPenetration + " Penetration Success " + PenetrationSuccess + " Cut " + CutRoll + " Risist Cut " + ResistCutTemp + " Cut Success " + CutSuccess + " Concussion " + ConcussionRoll + " Risist Concussion " + ResistConcussion + " Concussion Success " + ConcussionSuccess )  ;Debug.MessageBox(" Is Left?: " + (akAggressor as SAWDonHit).GetEquippedWeapon() == akSource )  ; Debug.MessageBox(" Target " + Target )  ; Debug.MessageBox(" PenetrationSuccess " + PenetrationSuccess + " Cutsuccess " + Cutsuccess + " ConcussionSuccess " + ConcussionSuccess )  ; Debug.MessageBox(" PowerAttack " + abPowerAttack + " ResistPenetration " + ResistPenetration + " PenetrationMin " + PenetrationMin + " PenetrationMax " + PenetrationMax + " PenetrationRoll " + PenetrationRoll + " ResistCut " + ResistCut + " CutMin " + CutMin + " CutMax " + CutMax + " CutRoll " + CutRoll + " ResistConcussion " + ResistConcussion + " ConcussionMin " + ConcussionMin + " ConcussionMax " + ConcussionMax + " ConcussionRoll " + ConcussionRoll )  ;Debug.MessageBox(" aPenetrationMin " + aPenetrationMin + " aPenetrationMax " + aPenetrationMax + " aCutMin " + aCutMin + " aCutMax " + aCutMax + " aConcussionMin " + aConcussionMin + " aConcussionMax " + aConcussionMax )EndEvent
User avatar
Katie Louise Ingram
 
Posts: 3437
Joined: Sat Nov 18, 2006 2:10 am

Post » Sun May 27, 2012 1:27 am

You spelled resist as risist a few times in there, but I guess it's better to work with that than change them all, right? (it's not designed to be looked at!)
From what I can interpret it seems to work.
Oh, and most mod added weapons should at least have a keyword for crafting/tempering. the point of keywords in vanilla was to improve compatability with addons, wasn't it? so if a mod doesn't work, it's not set up properly!
I'd imagine as improving weapons is mostly sharpening, that it'd just add a bit of cutting/piercing damage. perhaps for blunt objects, that should be concussion, relating to easier swinging, but certainly many of the maces would pierce, so sharpening those bits would help. Improving armour.. probably just add a bit of each type. It shouldn't be too hard to set up something similar to vanilla improvement. Then, if you decide you want to revise that down the line, that's possible. but would give it a more "finished" feel. Still, keep it up!
A release as Cuirass would be good, I see the point of the different areas for different protection, but would a simple way of extending it be taking a weighted average? So if you've got a heavy cuirass, but only light gauntlets, you'll be less protected overall? Not ideal, but simple. You also need to consider spells and perks that change armour values. Eventually.
User avatar
maya papps
 
Posts: 3468
Joined: Mon Aug 07, 2006 3:44 pm

Post » Sun May 27, 2012 1:02 pm

I managed to detect headshots with aimed spells very well by using a custom explosion which creates an activator, a persistent activator reference alias, and a script on the magic effect of the spell.

The explosion tied to the projectile creates an activator at the hit position, which reports its position to a script on the persistent activator then deletes itself. The magic effect moves the persistent activator to the head node of the target, then creates yet another FXEmptyActivator, places it at the head node of the target, and then gets the location difference between the two placed activators to determine the "speed" of the target. This is all reported to the persistent activator, which returns whether it thinks you got a headshot or not.

Trig sounds like the best way to go for melee attacks, but this system is pretty reliable for spells. Arrows would require something similar using explosions unless you are a beast with math, because arrows have variable arcs depending on draw time, so if you somehow factored that in to the camera angle then maybe you could precisely calculate where the arrow will hit, but using an explosion to report the hit location is likely going to be better.
User avatar
lucy chadwick
 
Posts: 3412
Joined: Mon Jul 10, 2006 2:43 am

Post » Sun May 27, 2012 7:43 am

I managed to detect headshots with aimed spells very well by using a custom explosion which creates an activator, a persistent activator reference alias, and a script on the magic effect of the spell.

The explosion tied to the projectile creates an activator at the hit position, which reports its position to a script on the persistent activator then deletes itself. The magic effect moves the persistent activator to the head node of the target, then creates yet another FXEmptyActivator, places it at the head node of the target, and then gets the location difference between the two placed activators to determine the "speed" of the target. This is all reported to the persistent activator, which returns whether it thinks you got a headshot or not.

Trig sounds like the best way to go for melee attacks, but this system is pretty reliable for spells. Arrows would require something similar using explosions unless you are a beast with math, because arrows have variable arcs depending on draw time, so if you somehow factored that in to the camera angle then maybe you could precisely calculate where the arrow will hit, but using an explosion to report the hit location is likely going to be better.

adding explosions requires editing the base objects though, this counts for both arrows and projectiles from spells. This means that your mod will be incompatible with any other mod changing those arrows/projectiles for some other reason, and the mod won't register headshots from newly added arrows/projectiles from other mods.
User avatar
Dawn Farrell
 
Posts: 3522
Joined: Thu Aug 23, 2007 9:02 am

Post » Sun May 27, 2012 5:28 am

I just tried using some trigonometry to figure out hit location but it doesn't work very well, although I guess if I fiddle with it some more I could get something more accurate.

EDIT:

The problem is, what you look at is not necessarily what you hit. If my target reticle is on an NPC's head and I swing with my axe, it hits them in the chest. I'm not sure without testing them all, but the offsets are probably different for each weapon type, and not to mention dependent on the distance from the NPC. This is not even considering power attacks where you could be facing in a completely different direction from where you hit.
User avatar
Wayland Neace
 
Posts: 3430
Joined: Sat Aug 11, 2007 9:01 am

Post » Sun May 27, 2012 9:06 am

Everything has full body part data just like in FO3. That's how it knows where to attach weapons/armor and what to detach when decapitated.
User avatar
benjamin corsini
 
Posts: 3411
Joined: Tue Jul 31, 2007 11:32 pm

Post » Sun May 27, 2012 5:47 am

What if you used animation events to trigger an instantaneous spellcast which would retrieve the location of where you are aiming?
User avatar
Isabell Hoffmann
 
Posts: 3463
Joined: Wed Apr 18, 2007 11:34 pm

Post » Sun May 27, 2012 1:09 pm

You spelled resist as risist a few times in there

Oops, so embarrassing, sorry! I got carried away with copy/paste. No worries, such a thing is fixable in 5 seconds, I believe :-P

Oh my, as for the explanations of how to detect where a hit is located... I think my head is going to explode! :-P
Couldn't they have simply made a way to use multiple collision boxes on one actor???
User avatar
Amysaurusrex
 
Posts: 3432
Joined: Wed Aug 09, 2006 2:45 pm

Post » Sun May 27, 2012 1:06 pm

I am toying around with using impact data to determine the hit position of an arrow or spell for compatability. Unfortunately, impact data cannot create activators, only hazards, but I think it could still work.
User avatar
Sophie Louise Edge
 
Posts: 3461
Joined: Sat Oct 21, 2006 7:09 pm

Post » Sun May 27, 2012 3:28 am

I am curious. Is there a single solution that can detect location of strikes accurately on ALL creatures? A dragon seems like it could be a problem compared to a Nord... and also spiders, etc.
User avatar
Smokey
 
Posts: 3378
Joined: Mon May 07, 2007 11:35 pm

Post » Sun May 27, 2012 9:21 am

Almost every solution to this problem is going to rely on the use of nodes on the actors 3d data. For example, to determine a headshot, more than likely you will be moving some object to the target's NPC Headnode, which has a different name than the head nodes on some creatures. This means that headshots can be determined on a wide range of creatures, but things like arm shots or leg shots are going to be much more difficult to accomplish on creatures that have irregular body shapes.
User avatar
Natalie Taylor
 
Posts: 3301
Joined: Mon Sep 11, 2006 7:54 pm

Post » Sun May 27, 2012 12:15 pm

Oops, so embarrassing, sorry! I got carried away with copy/paste. No worries, such a thing is fixable in 5 seconds, I believe :-P

Oh my, as for the explanations of how to detect where a hit is located... I think my head is going to explode! :-P
Couldn't they have simply made a way to use multiple collision boxes on one actor???

It shouldn't be too difficult to simply "give" actors collision boxes. Make a script concentration aimed spell like this:

Activator Property HeadNode autoActivator Property BodyNode autoActivator Property HandNode autoActivator Property FootNode autoGlobalVariable Property CurrentWeaponX autoGlobalVariable Property CurrentWeaponY autoGlobalVariable Property CurrentWeaponZ autoSpell Property TrackHitAb autoevent OnEffectStart(Actor Target, Actor Caster);this just pops some activators into existence, unmatched to body parts.   if Target.HasSpell(TrackHitAb)==false	  Target.addSpell(TrackHitAb)   endIf   HeadNodeRef = Target.PlaceAtMe(HeadNode)   BodyNodeRef = Target.PlaceAtMe(BodyNode)   HandNodeRef = Target.PlaceAtMe(HandNode)   FootNodeRef = Target.PlaceAtMe(FootNode);this should constantly update the positions of the activators as an infinite loopint i = 1while i==1HeadNodeRef.SplineTranslateToRefNode(Target, Head[], 010, 10000000, float afMaxRotationSpeed = 0.0)   BodyNodeRef.SplineTranslateToRefNode(Target, Torso[], 010, 10000000, float afMaxRotationSpeed = 0.0)   ;same for the other nodesendWhileendEventevent OnUpdate();since we're updating the magic effect, and not the actor we need to limit which activators will report informationif self.GetTargetActor()==Game.GetPlayer().GetCombatTarget()   float HeadNodeX = HeadNodeRef.GetPositionX()   float HeadNodeY = HeadNodeRef.GetPositionY()   float HeadNodeZ = HeadNodeRef.GetPositionZ()   float deltaX = HeadNodeX +- CurrentWeaponX.GetValue() as float   float deltaY = HeadNodeY +- CurrentWeaponY.GetValue() as float   float deltaZ = HeadNodeZ +- CurrentWeaponZ.GetValue() as float   float 2dDelta = Math.sqrt((deltaX*deltaX) + (deltaY*deltaY))   float 3dDelta = Math.sqrt((2dDelta*2dDelta) + (deltaZ*deltaZ)) ; this is the distance between the head node and where the weapon struck   ;now do the same for the body, hands, and feet nodes as well as any others you put inendIf   ;then do some comparisons, or add to an ordered array or whatever and determine which node's activator had the lesser distance to where the weapon struck.endEvent

then make a cloak that is self constant effect that has this concentration spell as associated Item 1. Then make a spell with this cloak effect with a magnitude of 192 (the length of a cell).

Now make a self constant effect script ability called TrackHitAb or something that simply does this:

MagicEffect Property BodyNodeSpawner autoGlobalVariable Property CurrentWeaponX autoGlobalVariable Property CurrentWeaponY autoGlobalVariable Property CurrentWeaponZ autoevent OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, bool abBashAttack, bool abHitBlocked)if akProjectile==NONE   CurrentWeaponX.SetValue(akAggressor.GetEquippedWeapon().GetPositionX() as float)   CurrentWeaponY.SetValue(akAggressor.GetEquippedWeapon().GetPositionY() as float)   CurrentWeaponZ.SetValue(akAggressor.GetEquippedWeapon().GetPositionZ() as float)else   CurrentWeaponX.SetValue(akProjectile.GetPositionX() as float)   CurrentWeaponY.SetValue(akProjectile.GetPositionY() as float)   CurrentWeaponZ.SetValue(akProjectile.GetPositionZ() as float)endIf   BodyNodeSpawner.RegisterForSingleUpdate(0.01)endEvent

I'm not sure if this will work at all, I just wrote it on here, not even in the CK. I think it might be conceptually helpful, although I'm concerned that by the time the player hits a second time the first strike might still be processing due to the amount of computing it needs to do for each individual hit.

TL;DR
When an actor is within 192 feet of the player, they will have a bunch of activators come into existence that are constantly chasing around certain body nodes of theirs at high enough speed that it should be accurate.
Whenever an actor is hit, it updates three global variables with the X,Y, and Z coordinates of the weapon that hit it. Then it updates the initial magic effect that keeps track of the activators.
The activators magic effect then decides where in space the activators are, and finds the distance between each one and the place where the weapon struck. It does some comparison math, and then spits out which node was hit.

After this I think the easiest thing to do would be to set yet another float global as the damage multiplier for the given node. Then you can simply call the damaging script, which just reads this global into the damage formulation.
User avatar
Phillip Hamilton
 
Posts: 3457
Joined: Wed Oct 10, 2007 3:07 pm

Next

Return to V - Skyrim