User Tools

Site Tools


4rpl:commands:movetowardscellandavoid

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
4rpl:commands:movetowardscellandavoid [2021/01/22 15:37] – [Description] Kaiden4rpl:commands:movetowardscellandavoid [2022/03/31 18:42] (current) – [Description] Enhanced. And I learned that the existence of this API confused me A LOT Vertu
Line 6: Line 6:
  
 ===== Description ===== ===== Description =====
-Takes a starting 3D position (a vector) and generates a new 3D position that is moved towards the target map integer coordinates. The resulting point will not be displaced more than +Takes a starting 3D position (a 3-vector) and generates a new 3D position using two variables for the X and Z coordinates that can be used by [[SetUnitPosition]] to move towards the target location. The resulting point will not be displaced more than the delta argument. 
-the delta argument.  The minHeight argument restricts how close, height wise, the resulting point can be to the terrain and/or creeper. +  The minHeight argument restricts how close, height wise, the resulting point can be to the terrain and/or creeper. 
-The checkRange argument is an integer that specifies how many cells outward to inspect when inforcing the minHeight.  A value of 0 means to only check the map cell that the +  The checkRange argument is an integer that specifies how many cells outward to inspect when enforcing the minHeight. A value of 0 means to only check the map cell that the unit is currently occupying
-target lands on+  The checkCreeper argument is a Boolean indicating whether to look at creeper for enforcing the minHeight. 
-The checkCreeper argument is a boolean indicating whether to look at creeper for enforing the minHeight. +  The checkAC argument is a Boolean indicating whether to look at anticreeper for enforcing the minHeight. 
-The checkAC argument is a boolean indicating whether to look at anticreeper for enforing the minHeight. +  The checkPseudoTerrain argument is a Boolean indicating whether to look at invisible pseudo terrain (like from shields) for enforcing the minHeight
-The checkPseudoTerrain argument is a boolean indicating whether to look at invisible pseudo terrain (like a shield creates) for enforcing the minHeight+ 
 +:NOTE:\\ 
 +To clarify, the only difference in this API and [[MoveTowardsAndAvoid]] is that you can independently specify an X coordinate variable and an Z coordinate variable while not needing a Y coordinate variable. The generated next position will not be limited to the X and Z axis unlike how other TowardsCell API's like [[RotateUnitTowardsCell]] tend to behave.\\ 
 +So be sure to avoid thinking of this API as being similar in behavior to the other TowardsCell API's or it will get very confusing very quickly.\\ 
 +If you came to this API thinking it could generate a next position on only the X-Z axis's, a way to do so is to take the resulting V3 and set the Y-vector to the unit's Y-position.
  
 ===== Examples ===== ===== Examples =====
4rpl/commands/movetowardscellandavoid.1611347875.txt.gz · Last modified: 2021/01/22 15:37 by Kaiden