void EntitySetWanderRect(int entity, int x1, int y1, int x2, int y2)
This function changes the specified entity's wander mode to Rect.
The entity will wander within the bounds of the map coordinates specified. x1,y1 represents the tile coordinates of the top-left corner of the wander rectangle area, and x2,y2 represents the bottom-right corner.
If the entity is outside the rectangle but adjacent to it he could move inside it. However, if the entity is completely not anywhere near the rectangle, it will not be able to wander.
If anyone would like to report what happens if you use x1,y2 for any other corner and x2,y2 for the opposite, please inform us. I'm too tired to check. -Grue
This function is a part of a small family of Wander-mode effecting Entity functions, which includes: EntitySetWanderDelay, EntitySetWanderRect, EntitySetWanderZone, and EntityStop.
// This sets map entity index 1 to wander within an area between // tile (0,0) and tile (10,10) EntitySetWanderRect( 1, 0,0, 10,10 );
There are no talkbacks on this documentation page yet. Post the first?
Doc Nav |
Your docs |