Jump to content

A simple condition to aply a perk effect only to left hand or right hand ?


Recommended Posts

Hello,

 

Is there a way to make a perk only apply to the hand the weapon is in ?

I'd like to add damage, but only if the weapon attacking is in the right hand, and a different kind of damage if the weapon is in the left hand.

I tried the condition "getequippeditemtype" but it only check if a weapon is equipped is the left or the right, not if it's the weapon actually used. So if I dual wield, I'll get both bonuses, regardless of the hand attacking.

 

is it possible without script ?

 

Thanks.

Link to comment
Share on other sites

Using the engine's default Condition Functions it's not possible, you can only achieve this with scripting with a running quest or adding/removing an 'Ability Spell' that will listen for the equipped object and where is equipped.


But, there is still the issue that the perk/perks added will not be able to detect when to apply damage, and this is because of how damage is applied by the engine, it's directly connected to the player's camera and not to the weapon.


For example: If you have an enemy in front of you and in third person you rotate the camera to an angle that the enemy is no longer in the center / the field of the camera where damage is applied, no matter how and what attack you do you will not apply damage to the anemy.

Link to comment
Share on other sites

You can use the GetEquipped condition. According to the Wiki, this condition only works for armor or weapons in the right hand. https://www.creationkit.com/index.php?title=GetEquipped

Sadly, to my knowledge, this condition check if you have a weapon equipped, not if the weapon is used. So it will not only apply to the weapon you use to attack with, it will apply to all attacks, regardless of the weapon used, as long as it is equipped.

 

 

 

Using the engine's default Condition Functions it's not possible, you can only achieve this with scripting with a running quest or adding/removing an 'Ability Spell' that will listen for the equipped object and where is equipped.
But, there is still the issue that the perk/perks added will not be able to detect when to apply damage, and this is because of how damage is applied by the engine, it's directly connected to the player's camera and not to the weapon.
For example: If you have an enemy in front of you and in third person you rotate the camera to an angle that the enemy is no longer in the center / the field of the camera where damage is applied, no matter how and what attack you do you will not apply damage to the anemy.

 

Thanks, that what I feared.

Edited by Arael54
Link to comment
Share on other sites

So you want an effect to apply when the actor attacks with any weapon in the right hand? If so, then yes you will need a script. You can use animation events. You can make an ability spell and put a script on the magic effect, something like this:

 

Actor Target

Event OnEffectStart(Actor akTarget, Actor akCaster) 
    Target = akTarget
    If Target.GetEquippedWeapon()
        RegisterForAnimationEvent(Target, "weaponSwing") ;weaponSwing fires when attacking with right hand. weaponLeftSwing for left.
    Endif
EndEvent 

Event OnObjectEquipped(Form akBaseObject, ObjectReference akReference)
    If Target.GetEquippedWeapon() ;target has weapon in right hand
        RegisterForAnimationEvent(Target, "weaponSwing")
    Endif
EndEvent 

Event OnObjectUnequipped(Form akBaseObject, ObjectReference akReference) 
    If !Target.GetEquippedWeapon() ;target does not have weapon in right hand
        UnRegisterForAnimationEvent(Target, "weaponSwing")
    Endif
EndEvent

Event OnAnimationEvent(ObjectReference akSource, String asEventName) 
    ;do something 
EndEvent

Here's a list of animation events for reference. https://www.creationkit.com/index.php?title=Animation_Events

Link to comment
Share on other sites

Thank you. This and a answer in another thread gave me roughly the idea of what I should do I think.

I want to add a stagger effect, with a different magnitude relative to the type of weapon used (dagger, bow, etc).

So I think the difference between left weapon and right weapon is not necessary anymore, but I need to make a different animation (on swing ? Would it work as expected ?) event for each type of weapon (bow, sword, etc), each with a different spell attached with a different stagger value.

I'm pretty sure don't have the knowledge to do this yet. I have to find some mods which do something similar to understand it a bit better.

 

Thank you again.

 

Edit : In fact, the mod "Dynamic animation casting" let you do exactly what I was looking for.

Edited by Arael54
Link to comment
Share on other sites

  • Recently Browsing   0 members

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