| General | Hosted Sites | Civ5 | CivRev | Civ4Col | Civ4 | Civ3 | Civ2 | Civ1 | Misc | Marketplace |
![]() |
|
|
Welcome to Civilization Fanatics' Center. You are currently viewing our site as a guest which gives you limited access to our site features. By joining our free community, you will be able to participate in the discussions, search the forum, send private messages, vote in polls, upload your own screenshots to the gallery, and access many other special features. Registration is fast, simple and absolutely free, so sign up today! If you have any problems with the registration process or your account login, please contact support. |
|
|||||||
![]() |
|
|
Thread Tools |
|
|
#1 |
|
Bytes and Nibblers
Join Date: Nov 2005
Location: Texas
Posts: 10,263
|
Coordinates
There's two coordinate systems used by the game, rectangular (also called cartesian or grid) and hex. Different parts of the lua code use different systems, so it's important to identify which one the function you're working with uses. Most things like plot:GetX() use the rectangular system. It's the one we're used to in most things in life. The hex form is tilted to line up along tile boundaries. I suspect it's used by the game core since adjacency is probably easier to calculate.
You can use these functions to convert between the two: rectX rectY = ToGridFromHex(hexX, hexY) hexX hexY = ToHexFromGrid(rectX, rectY) Y values are vertical, and X values horizontal. They start at the bottom left of the map and progress in these positive directions: Rectangular Hex
__________________
![]() We are the Modders. CiV will be assimilated. We will enhance its biological and technological distinctiveness with our own. Resistance is futile. Communitas Expansion Pack Wiki - Discussion - News Forum Icons ~ Starting Civ5 Mods ~ Forum Tables Last edited by Thalassicus; Jul 30, 2011 at 03:41 PM. |
|
|
|
![]() |
| Bookmarks |
|
| Thread Tools | |
|
|