Difference between revisions of "Osiris/API/FindValidPosition"

From Divinity Engine Wiki
Jump to: navigation, search
(call -> query, put into standard template form)
m
 
Line 4: Line 4:
 
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).
 
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 =====
 
===== Return Values =====
* '''Success/Failure''': Fails if there no currently active level, or if no valid position could be found within the requested radious.
+
* '''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.
 
* '''_ValidPositionX''': X-coordinate of the found position.
 
* '''_ValidPositionY''': Y-coordinate of the found position.
 
* '''_ValidPositionY''': Y-coordinate of the found position.

Latest revision as of 21:30, 13 September 2018

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