GetInGrid

From GECK
Jump to: navigation, search


A function added by the New Vegas Script Extender.

Description

Similar to GetInSameCell, but checks a grid of cells, making it useful for exteriors. Returns true (1) if the specified reference is within the grid of cells, the size of which is specified by depth. Depth defaults to 0, a value of -1 will use the uGridsToLoad setting.

Syntax

[help]
(bool) GetInGrid Target:reference CellDepth:int IncludeTakenRefs:bool 

Example

if GetInGrid SunnyREF, 1
   ; Sunny is in the same or a next cell to the player (depth 1 = 3x3 cell grid)

if GetInGrid SunnyREF, -1
   ; Sunny is within uGrid range of the player

Notes

  • This function works when checking if a reference is in a interior cell.
  • For a 3x3 grid (depth 1), the reference is in the middle cell of an edge of the grid, not the center cell of the grid itself. For a 5x5 grid (depth 2), another layer of cells are added around the 3x3 grid and the reference will be one cell away from the edge of the grid that is checked - again, not the center of the grid itself.

See Also