I'm new to the Skyrim modding scene, though I've done some mods of FPS games in the past (UT2004, etc.).
I would like to tweak some of the AI behavior in the game to make it more strategic and challenging. To achieve this goal, I need to collect some data from the game -- specifically, the location of the Aggressor and Target every time an attack lands successfully.
I've sketched up a script to save this information as XML in the log so I can parse it later -- however, I'm not sure how to exactly phrase the new OnHit method to get the info I want.
I was thinking of setting things up so when the Player enters my target Location, a Quest is started, which would run the following script in the background:
Scriptname NewAITestDungeon03Script01 extends ObjectReference Event OnHit(ObjectReference akAggressor, Form akSource, \ Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, \ bool abBashAttack, bool abHitBlocked) if akAggressor == game.getPlayer() Debug.Trace("<EventOnHit><Aggressor><ID>Player</ID><Location>" \ + akAggressor.GetPos axis + "</Location></Aggressor><Target>" \ + "<ID>" + **Reference to Target Actor needed here ** \ + "</ID><Location>" + ** Reference to Target Location needed here ** \ + "</Location></Target></EventOnHit>") else Debug.Trace("<EventOnHit><Aggressor><ID>" + akAggressor \ + "</ID><Location>" + akAggressor.GetPos axis \ + "</Location></Aggressor><Target>" \ + "<ID>Player</ID><Location>" \ + game.getPlayer().GetPos axis \ + "</Location></Target></EventOnHit>") endif EndEvent
I just need to know how to reference the Target when the Aggressor is the Player.
Note I'm hypothesizing that running the Papyrus script from a Quest will render the results I want for all Actors. If this isn’t the Best Practice way of doing things, a pointer or web link in the right direction would be much appreciated!