Fallout2AM Posted February 3, 2015 Share Posted February 3, 2015 it's an event handler, it requires the beta NVSE. It's a standalone object script, it is not linked to anything: scn aaaOnHitEH ref rTarget ref rAttacker ref MyRef Begin Function {rTarget, rAttacker} PrintC "I'm HIT!" endand the event itself can be declared on a quest script, i.e. on get game loaded / restarted, something like this: If GetGameLoaded SetEventHandler "OnHit" aaaOnHitEH "first"::playerref endif Link to comment Share on other sites More sharing options...
Athelbras Posted February 3, 2015 Author Share Posted February 3, 2015 Now I understand. Thank you for your responses. Very much appreciated! Link to comment Share on other sites More sharing options...
Fallout2AM Posted February 3, 2015 Share Posted February 3, 2015 You're welcome :) Link to comment Share on other sites More sharing options...
rickerhk Posted February 15, 2015 Share Posted February 15, 2015 Using player.IsInCombat plus checking player health every frame works. I've used it on both my FO3 and NV companion mods. The condition InsInCombat will return true if enemies are nearby but still searching, so that starts the health monitoring. If health drops - well you've taken hits! Or jumpped off a cliff :) So it isn't perfect... The simplest way to get actor REFs in a cell is with NVSE, but: To run functions on actors in a cell without NVSE: Run a 'Radar' quest script - at 1 or 2 second speed and have it apply a script effect touch spell to the player that detects actors in a certain radius - like 3000 units. Then the scripteffectstart block runs on the actor. From that script you can get their combat state and refId: set MyQuestScript.rEnemy1REF to GetSelf set rTargetREF to GetCombatTarget if rTargetREF == PlayerREF ;Do things, set flags, GetLOS, etc, check player health Unfortunately, GetSelf only returns non zero if the actor was placed in the world by the Geck. If you absolutely need the REFId regardless of the actor's origin, you can place an activator in a remote cell and have the scripteffectstart block also make the actor activate it. An activation block will run even if the cell that the activator is in, is not loaded. Then you can get the REFid of the actor using GetActionREF. Link to comment Share on other sites More sharing options...
RoyBatterian Posted February 15, 2015 Share Posted February 15, 2015 You could possibly use the method that Rex was supposed to use for detecting npc's as well, by using a large radius explosion that does no damage. I'm not entirely sure how much resources that takes up though, but it's been implemented by at least one other person. Link to comment Share on other sites More sharing options...
Athelbras Posted February 22, 2015 Author Share Posted February 22, 2015 @rickerhk, RoyBatterian Thank you!!! Those approaches are new to me, so I will certainly investigate their potential. Link to comment Share on other sites More sharing options...
Recommended Posts