Jump to content

[LE] OnHit Events


Recommended Posts

 

I have a problem with cars. How do you use them?

 

Do you see the problem with your question???

I did do research on OnHit events, but I don't understand how they work, so let me rephrase my question, "How do you use OnHit events to trigger other events?"

 

 

You can't "trigger" most events, only the game engine does that, with the exception of special events that you can "register" for. E.g. you can register for an Update or Animation event, for example, but that is listening for, rather than triggering, the event. However, you can call most functions from within other functions/events e.g:

 

MyFunction(optional parameters)

self.MyFunction(optional parameters)

SomeEvent(optional parameters)

SomeScript.SomeEvent(optional parameters)

SomeObject.SomeFunction(optional parameters)

Link to comment
Share on other sites

I think I get what you wanna do.

 

Youll want to register for animation event "hitframe" or weaponswing / weaponswingleft

 

Then on animation event cast your spell.

 

I can post a working script tomorrow, its bedtime for me now IF you dont understand the above :)

Link to comment
Share on other sites

I think I get what you wanna do.

 

Youll want to register for animation event "hitframe" or weaponswing / weaponswingleft

 

Then on animation event cast your spell.

 

I can post a working script tomorrow, its bedtime for me now IF you dont understand the above :smile:

I did try this method, but the problem is that I want the player to do physical damage then cast that spell. If I use the OnAnimation event it would play it would play during the animation, not when it's finished.

 

EDIT: The HitFrame animation plays when the player hits the target, which I wanted, so thanks. I think it's the same as the weaponswing but I seem to be fine with it.

Edited by PhilTheGamer1111
Link to comment
Share on other sites

use perk entry point apply Combat spell that would only cast spell when you hit a target.
Then you could apply it depending what attack you do with conditions for example isattacktype - I think, if you only want it to apply by a standing power attack for example, or isweapontype or something similar if only a specific weapon type can be used.

If this is not the case, You could make a Ability registering for animation HitFrame, constant script.

then another effect that does similar and take that spell onto a enchantment so that when you hit a target you'll get the ability register for animation event, let it play its course, then unregister for it.

Hit a target -> register for animation event -> player can choose to aim the spell (if its going to be a projectile one) otherwise, the perk entry point is better since it applies to the target directly.

 

I think, I'm a novice so dont take my word for it but I do have working scripts that I made.

Edited by GSGlobe
Link to comment
Share on other sites

  • Recently Browsing   0 members

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