Stop character aggression OnHit

Post » Sat Nov 17, 2012 9:04 pm

Hey guys, is there a way to stop an npc/creature from turning enemy when you hit them with an arrow or sword? I'm thinking I'll need to add an OnHit event to the weapon itself, but is it possible and if so how? I can't find anything on the wiki about it :)
User avatar
Devin Sluis
 
Posts: 3389
Joined: Wed Oct 24, 2007 4:22 am

Post » Sat Nov 17, 2012 5:37 pm

Why did I post this here??!! Lol, could a mod please move this to the Creation Kit forum :)
User avatar
Jesus Duran
 
Posts: 3444
Joined: Wed Aug 15, 2007 12:16 am

Post » Sat Nov 17, 2012 7:53 pm

It's easier to set the NPC as friend to the player and to ignore friendly fire. If ths didn't fit you, the function you need to use on the onhit event is stopcombatalarm() . Don't forget to deactivate the onhit event (using states is a way) for a while after each use, to avoid a continuous damage spell causing bloatting.
User avatar
LijLuva
 
Posts: 3347
Joined: Wed Sep 20, 2006 1:59 am

Post » Sun Nov 18, 2012 7:45 am

Funny, Beth uses just StopCombat in their carriage script, but looking your suggestion amgepo, I'd say http://www.creationkit.com/StopCombatAlarm_-_Actor was the correct function!
User avatar
jennie xhx
 
Posts: 3429
Joined: Wed Jun 21, 2006 10:28 am

Post » Sat Nov 17, 2012 5:39 pm

Will that work on any actor? I want to be able to have any actor not initiate combat atall when hit with a weapon. Not for cheating, just playing with a little cool idea ;)

Edit:

I should probably have said I'd like to attach a script to the weapon. So is is possible to do that? I know it's easy to attach a script to a particular actor itself, but I want all actors.
User avatar
Charlie Ramsden
 
Posts: 3434
Joined: Fri Jun 15, 2007 7:53 pm


Return to V - Skyrim