Osiris/API/FindValidPosition

From Divinity Engine Wiki
Jump to: navigation, search
Full Definition(s)
  • call FindValidPosition([in](REAL)_SourceX, [in](REAL)_SourceY, [in](REAL)_SourceZ, [in](REAL)_Radius, [in](GUIDSTRING)_Object, [out](REAL)_ValidPositionX, [out](REAL)_ValidPositionY, [out](REAL)_ValidPositionZ)
Description

Finds a valid position for an object on the AI-grid near a source position using a floodfill up to a specified radius. If _Object is non-null and an item or a character, the returned position will have enough space to fit its AI-bounds, and the object itself will be ignored while looking for a new valid position (if you look for a new position for a giant object one metre from its current position, the object would "collide" with itself when placed at that position it were not ignored).

Return Values
  • Success/Failure: Fails if there no currently active level, or if no valid position could be found within the requested radius.
  • _ValidPositionX: X-coordinate of the found position.
  • _ValidPositionY: Y-coordinate of the found position.
  • _ValidPositionZ: Z-coordinate of the found position.
Notes
  • /
See Also