Difference between revisions of "ObjectUnderReticle"
imported>JT (Created page with "{{Function |CSWikiPage = ObjectUnderReticle |origin = VEGAS1 |summary = Yields an object an arbitrary distance away from the crosshairs. |name = ObjectUnderReticle |argum...") |
imported>JT m (converted from set to let since the example was NVSE only, but forgot to convert the "to" as well... heh) |
||
Line 22: | Line 22: | ||
ref tgt | ref tgt | ||
let target | let target := ObjectUnderReticle 0 2048 ;Check for object within 30 m/96 ft | ||
if ( GetType target == 42 || GetType target == 43 ) | if ( GetType target == 42 || GetType target == 43 ) | ||
;We have an actor under the crosshairs! | ;We have an actor under the crosshairs! |
Revision as of 16:33, 27 April 2016
Link to TES4 Construction Set Wiki: ObjectUnderReticle.
A function included in the GECK Version 1.1.0.262 for Fallout: New Vegas.
Description
Yields an object an arbitrary distance away from the crosshairs.
Syntax
ObjectUnderReticle MinRange:Int MaxRange:Int
ObjectUnderReticle performs a raytrace to find the object under the crosshairs out to any arbitrary distance in game units, between the MinRange and MaxRange, and returns the first object underneath the crosshairs within that range. It performs a similar function to GetCrosshairRef, but it is not limited to activation range. Distances are specified in BSUnits (128 is roughly equal to 6 feet/1.8 m).
Also similar to GetCrosshairRef, this will return statics and other game objects with collision data as well as "activatable" objects like actors, items, and activators, so filtering with GetObjectType using NVSE is generally necessary.
Example (NVSE)
ref tgt let target := ObjectUnderReticle 0 2048 ;Check for object within 30 m/96 ft if ( GetType target == 42 || GetType target == 43 ) ;We have an actor under the crosshairs! target.Kill PlayerRef ;player kills target using cosmic mind rays endif