Aller au contenu

Photo

GetNearest functions capture arrays


  • Veuillez vous connecter pour répondre
1 réponse à ce sujet

#1
georage

georage
  • Members
  • 247 messages
Before you knock yourself out trying to use the GetNearest family of functions, be warned that they seem to capture an array of objects, not just an object.

This nearly drove me insane.

Example:

object [] oWP = GetNearestObjectByTag(oPC,  "wp_test", OBJECT_TYPE_WAYPOINT, 6);  //capture the nearest 6 waypoints tagged 'wp_test' in an array
object o2ndClosestWP = oWP[1]; //i assume 0 is closest, 1 second closest, etc.



#2
Craig Graff

Craig Graff
  • Members
  • 608 messages
You may want to check out UT_GetNearestObjectByTag, which acts a lot more like NWN's GetNearestObjectByTag.