GetTargetsInSphericalAnnulus

From HEWIKI
Jump to: navigation, search

Contents

Get Targets In Spherical Annulus

GetTargetsInSphericalAnnulus(playerSensitive as Boolean, npcSensitive as Boolean, sphereCenter as Vector3, sphereOuterRadius as Float, sphereInnerRadius as Float) as List of NodeRef

Arguments

<playerSensitive> 
Indicates whether players are included in the list of returned nodes
<npcSensitive> 
Indicates whether non-playing characters are included in the list of returned nodes.
<sphereCenter> 
the center of the sphere
<sphereOuterRadius> 
the outer radius of the sphere annulus, in worldspace units
<sphereInnerRadius> 
the inner radius of the sphere annulus, in worldspace units

Description

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

Example

// The following would print a list of all pc's (and no npc's) within a sphere defined below
pc as boolean = TRUE
npc as boolean = FALSE
targets as list of noderef
sphereCenter as vector3 = (0, 0, 0)
sphereOuterRadius as float = 30.0
sphereInnerRadius as float = 10.0
 
targets = GetTargetsInSphere(pc, npc, sphereCenter, sphereOuterRadius, sphereInnerRadius)
foreach target in targets
  println(target.name+" is in the cone")
.
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox