Scripting: easiest way to detect onHit events on ANY actor?

Post » Tue Jun 19, 2012 2:58 pm

I am toying with some interesting concepts for combat overhaul, but what I'd like to know is if there is an easy, straightforward way to make a certain script run on any actor in the game, so that when either the player gets hit by something or the player hits something, a proper event is registered and code can be executed?

I would like to avoid having to attach a script to every weapon or actor in the game, so if there is some way to do it globally and automatically, I would love to hear about it. I suspect I should attach this script to the player via quest, but would appreciate if anyone with know-how could explain if onHit events can be attached to the player in such a way.

And it is vital that it works both ways, so that I can detect and reference both the actor being hit and the actor doing the hitting.
User avatar
FirDaus LOVe farhana
 
Posts: 3369
Joined: Thu Sep 13, 2007 3:42 am

Post » Tue Jun 19, 2012 1:00 pm

This should probably be in the creation kit forum.

I would suggest making an ability call a scripted effect. Make the ability invisible to the player. Then give this ability to every race you want to be effected by the ability. The script can then check everything that hits the caster of the ability. and do whatever you like. I do simialr things with the racial power mod I am working on.
User avatar
Cartoon
 
Posts: 3350
Joined: Mon Jun 25, 2007 4:31 pm

Post » Wed Jun 20, 2012 2:33 am

I think http://www.gamesas.com/topic/1349649-dynamically-attaching-scripts-to-actors-near-the-player/ could help you do what you want.
User avatar
Alexander Lee
 
Posts: 3481
Joined: Sun Nov 04, 2007 9:30 pm

Post » Tue Jun 19, 2012 9:34 pm

Helped a lot, thanks!
User avatar
Rinceoir
 
Posts: 3407
Joined: Thu Jun 29, 2006 1:54 am


Return to V - Skyrim