BlowingKush
I hit the blunt but the blunt hit me.
- Reaction score
- 188
i hope they release a Warcraft I editor with it too
OMGOMGOMG MINE IS TOO!!! I STARTED FREAKING OUT!!! and it keeps making a "click" noise... this sucks.
//--------------------------------------------------------------------------------------------------
// Regions
//
// Regions are comprised of any number of basic shapes (rectangles, circles, etc). Each shape
// can be specified as positive or negative. A point is considered within the region if it is
// within a least one positive shape but not within any negative shapes.
//
// Example:
// An L-shaped region could be created with either
//
// (a) Two positive rectangles
// _
// | | <-- (+)
// | |
// |_|___
// |_____| <-- (+)
//
// (b) One positive and one negative rectangle
// _____
// _|___ |
// | | | |
// | | | | <-- (-)
// | |___|_|
// |_____| <-- (+)
//
// The "bounds" of the region are defined as the smallest rectangle which contains all positive
// shapes. The "center" is the average of the center of all positive shapes, weighted by area.
//
// The "offset" of the region is relative to the shape coordinates. The center and bounds take
// the offset into account.
//
//--------------------------------------------------------------------------------------------------
native region RegionEmpty ();
native region RegionEntireMap ();
native region RegionPlayableMap ();
native void RegionPlayableMapSet (region r);
native region RegionRect (fixed minx, fixed miny, fixed maxx, fixed maxy);
native region RegionCircle (point center, fixed radius);
native region RegionFromId (int id);
native void RegionAddRect (region r, bool positive, fixed minx, fixed miny, fixed maxx, fixed maxy);
native void RegionAddCircle (region r, bool positive, point center, fixed radius);
native void RegionAddRegion (region r, region regToAdd);
native void RegionSetOffset (region r, point offset);
native point RegionGetOffset (region r);
native bool RegionContainsPoint (region r, point p);
// RegionRandomPoint attempts to find a random point somewhere within the region. For regions
// containing only a single positive shape, this is guaranteed to work, but for more complex
// sets of shapes it may give up after a maximum number of tries and return (0, 0).
//
native point RegionRandomPoint (region r);
native point RegionGetBoundsMin (region r);
native point RegionGetBoundsMax (region r);
native point RegionGetCenter (region r);
// Setting the center will adjust the offset such that
// the region becomes centered on the given point.
//
native void RegionSetCenter (region r, point p);
// RegionAttachToUnit will attach the region to the given unit such that the region center
// is always at the unit's position plus the given offset. Use a null unit to detach the region
// from whatever unit it may already be attached to.
//
native void RegionAttachToUnit (region r, unit u, point offset);
native unit RegionGetAttachUnit (region r);
Took me awhile, but here's my test map. It will follow in third person view the hero Zuk'rah. Use C to attack the unit like 200 units in front of you...