Jump to content

Getting ObjRef of what you're looking at


timtimman

Recommended Posts

I wonder if it is a way to get the ObjectReference of what you're currently looking at, as in what's in your crosshairs.

 

There should be something since you have things react with the UI popping up "Activate" and such but is there any way to make a function in Papyrus? Or something akin to clicking the item to get the Ref with console up.

 

I simply want to be able to select and manipulate any object. Best I've found so far is GetPlayerGrabbedRef but that only works for items that can be grabbed, and excludes too much not including Actors and other structures.

 

One other way to do it is to have an invisible object with a trigger volume hovering in front of the player and using the OnTriggerEvent. But that doesn't trigger for everything either.

 

Is there a function to find a Ref on a specific coordinate? Or on interception of something else?

 

 

Any insight would be greatly appreciated.

Link to comment
Share on other sites

I've previously used a method in skyrim which uses papyrus to cast a spell from the player, that spell has a projectile which has an explosion. That explosion spawns an item that has a script attached that would use the find closest object in list function, then you would attach a list of objects you want to find the ref of. Problem is it seems in fallout 4, it doesn't appear to work on static objects.

Link to comment
Share on other sites

Without knowing what you're looking for, taking a shot in the dark.

 

Would these help?

http://www.creationkit.com/fallout4/index.php?title=RegisterForDetectionLOSGain_-_ScriptObject

 

http://www.creationkit.com/fallout4/index.php?title=OnGainLOS_-_ScriptObject

 

Function RegisterForDetectionLOSGain(Actor akViewer, ObjectReference akTarget) native

 

Event OnGainLOS(ObjectReference akViewer, ObjectReference akTarget)

 

They give an example of registering the event for a 'secret document', it uses ObjectReference so it should work for many things I would guess.

Link to comment
Share on other sites

I'm not looking for GainLOS as you have to "know" what you're looking for (and as pointed out wouldn't be cross hair accurate). And from what I've gathered, it's very intensive with the added negative of making all registered objects persistent.

 

The spell seems to be the best (but not really good) way of doing it. But would require a list with all references in the game (hardly convenient) not to mention that it would need to be updated at least 2 times per second to make a good "search". And it would work on statics (which I would like, but not a biggie). That would all probably be very taxing.

 

 

I think I'm going to write this off and agree with DDProductions83, fubared.

 

Thank you.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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