Jump to content

Getting Actor / Object Reference under crosshair


Recommended Posts

Disclaimer: this has been asked a few years ago, but didn't find an answer.

I am in need of finding the ObjectRef under the crosshair. I want to add an extra menu under the rollover widget that I can populate via Papyrus. With f4se is easy enough to add/register the extra swf menu, but I have no way of populating it because I don't know what the current rollover widget refers to.

I know I can do an "Add Activate Choice" perk, but that doesn't work well. Actors have only one extra available choice (i need a few more), and it's very buggy (I can clarify if needed).

The base game doesn't seem to have the required functions. The closest I could find are GetHeadingAngle / FindAllReferencesOfType. AFAIK these are very expensive, and don't really solve the problem. I couldn't find anything in the papyrus f4se api either.

 

What I thought about:

 

1: Hacking hudmenu and sending an f4se event when the rollover widget is rendered: is hacky, and I still don't know the reference, only when the reference changes. Also possibly very slow.

2: Hacking HUD++: The mod Hud Plus Plus seem to do just that: find the reference under the crosshair and display a card based on the type. The source is available, but it's way beyond me.

 

I could add the extra menu as a "sub-menu" of the secondary actor activation, but it requires an extra click and it won't feel right.

 

Any ideas? Am i missing something obvious?

 

Edit: SKSE has GetCurrentCrosshairRef, which would help. Still would need to know when this ref changes, to avoid making a perpetual timer, which is expensive and slow.

Edited by johndoebowler
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...