You must be logged in to do that.

EntitySetWanderRect

EntitySetWanderRect
void EntitySetWanderRect(int entity, int x1, int y1, int x2, int y2)

Documentation

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.

Example Usage

// 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 );
Talkback

There are no talkbacks on this documentation page yet. Post the first?

Post a new comment?

Ben McGraw's lovingly crafted this website from scratch for years.
It's a lot prettier this go around because of Jon Wofford.
Verge-rpg.com is a member of the lunarnet irc network, and would like to take this opportunity to remind you that regardless how babies taste, it is wrong to eat them.