gulogulo Posted May 27, 2012 Share Posted May 27, 2012 Hi, Is there any way to obtain a reference of the actor that the player is looking at? Im talking about the actor that is within reach of the player (player can "activate" the actor). Thanks in advance Link to comment Share on other sites More sharing options...
MichikoUnknownFox Posted May 27, 2012 Share Posted May 27, 2012 GetCrosshairRef, which I believe is a SKSE function. It'll work on anything that the crosshair is targeting though, regardless of distance. If you want to limit the range, you can include that in the script via GetDistance. Link to comment Share on other sites More sharing options...
steve40 Posted May 28, 2012 Share Posted May 28, 2012 (edited) Probably you could use a statement like "TargetRef = Game.GetPlayer().GetCombatTarget()" in a script. When used specifically in this way it returns the npc reference that your cursor is pointing at. I think it might work this way even if you haven't started a fight, but I'm not sure. Ie. I'm assuming that anyone within your sights would be considered as a combat target even if you haven't initiated combat. Alternatively, use the function HasLOS in combination with GetDistance to achieve what you want. Another possibility is IsNearPlayer which returns false if an object is definitely out of sight from the player, so if it returns true there's a strong chance that the player could be looking at the target, or in a position to do so. of course, if they are actually in dialogue then you could simply use GetDialogueTarget. Edited May 28, 2012 by steve40 Link to comment Share on other sites More sharing options...
gulogulo Posted May 28, 2012 Author Share Posted May 28, 2012 @HosokawaTakuya Where can I find this GetCrosshairRef. There was something like that in Oblivion, but I cant find anything like that in Creation Wiki pages or i documentation of SKSE @steve40 Thanks for the tips but it wont due. You see its for smell abilities. I want to learn the scent of an actor even if it is a bloody cold corpse. Link to comment Share on other sites More sharing options...
gulogulo Posted May 30, 2012 Author Share Posted May 30, 2012 Nevermind. Its done. Link to comment Share on other sites More sharing options...
Recommended Posts