View Single Post
  #13  
Unread 12-28-2008, 11:40 PM
lordebon lordebon is offline
Fetish Core author
This person is a EQ2Map developer.
Featured
 
Join Date: Jun 2005
Server: Crushbone
Posts: 2,667
Default

Basically you are finding 2 points both in-game locs and in terms of pixels on the map. With those common points (chosen far apart as possible for maximum accuracy) the zone rect calculator will extrapolate out to find the /loc locations of the upper left most pixel and the lower rightmost pixel (i.e. the zone rect).

Essentially it's a scaling function. You create a scale for both the x and y.

(pixel_x1 - pixel_x2)/(loc_x1 - loc_x2) = X_scale in # of pixels per in game meter, for example. Y can be calculated the same way

Then, knowing the map is cornered by pixel(0,0) to pixel(436,506) it basically uses the known points and the calculated scale to find loc[pixel(0,0)] and loc[pixel(436,506)], i.e. the in-game /locs for those two pixels. That is your zonerect.

And yeah, GM9 covered the heights pretty well. The dividing lines should be the same... that is, for a structure like this:

Level A
Level B
Level C

heightmin of level A should be = heightmax of level B. And heightmin of level B should be = heightmax of level C. That way the transitions are precise and predictable and the game always knows which map to display.
__________________
Reply With Quote