Get Targets In Box
GetTargetsInBox(playerSensitive as Boolean, npcSensitive as Boolean, boxCenter as Vector3, boxWidth as Float, boxHeight as Float, boxDepth as Float) as List of NodeRef
- Indicates whether players are included in the list of returned nodes
- Indicates whether non-playing characters are included in the list of returned nodes.
- The center of the box, in worldspace units
- The width of the box around the center, in worldspace units
- The height of the box around the center, in worldspace units
- The depth of the box around the center, in worldspace units
This function can be called in a script to learn what player nodes are around a given area.
The functions return a list of type noderef, which will include all visible player or character nodes within the defined area.
Other types of assets (waypoints, landscape, etc.) are not targeted in the search.
NPC's can be returned if npcSensitive is set to true.
For more information see: Area Awareness
// The following would print a list of all pc's (and no npc's) within a 2x2x2 radius box at 0,0,0 location in the area pc as boolean = TRUE npc as boolean = FALSE targets as list of noderef origin as vector3 = (0, 0, 0) width as float = 2.0 height as float = 2.0 depth as float = 2.0 targets = GetTargetsInBox(pc, npc, origin, width, height, depth) foreach target in targets println(target.name+" is in the box") .