cjhorberg Posted June 2, 2019 Share Posted June 2, 2019 (edited) Hi! I'm working on a simple mod which just adds some new NPCs in the game. I'm trying to make them act realistically to guards by making them flee when a guard hits them or enters combat with them. I was trying to do this by using the -Begin OnHit- thing, and then say something like "if attacker.IsGuard ==1 then forceav confidence 0", something simple like that. My problem is that I don't know how to extract any information from the OnHit block. How to I get the reference of the attacker? I know that you can say "Begin OnHit Player" if you only want the block to run when a player attacks the object, but I want to do this in a versatile way, so that my custom NPC can react differently depending on properties that it extracts from the attacker. Edited June 2, 2019 by cjhorberg Link to comment Share on other sites More sharing options...
cjhorberg Posted June 2, 2019 Author Share Posted June 2, 2019 PS. Just as you can say isActionRef under a Begin onActivate block, only that I want to use it under the onHit block. Link to comment Share on other sites More sharing options...
cjhorberg Posted June 7, 2019 Author Share Posted June 7, 2019 I happened to stumble across the answer myself. http://www.gamesas.com/obtain-onhit-reference-t51050.html Link to comment Share on other sites More sharing options...
Recommended Posts