# Map Coordinates

2 replies to this topic

### #1 aavitsland

aavitsland

GMC Member

• GMC Member
• 64 posts
• Version:GM:Studio

Posted 28 May 2012 - 06:39 PM

Hi all.

I am a bit curious as to how I would go to make a map with coordinates.
Lets say I have a worldmap of 3200 x 3200 pixels and I want every 32 pixels to be 1 coordinate.
Like 32:32 = 1:1
and 64:32 = 2:1
and 320:640 = 10:20

So that a player can seach a coordinate to be taken to that point upon request.
I do not ask how to make the search function, only how to make the coordinates.

If anyone can help me, I will be very grateful
• 0

### #2 dannyjenn

dannyjenn

GMC Member

• GMC Member
• 2087 posts
• Version:Mac

Posted 28 May 2012 - 06:53 PM

Hi all.

I am a bit curious as to how I would go to make a map with coordinates.
Lets say I have a worldmap of 3200 x 3200 pixels and I want every 32 pixels to be 1 coordinate.
Like 32:32 = 1:1
and 64:32 = 2:1
and 320:640 = 10:20

So that a player can seach a coordinate to be taken to that point upon request.
I do not ask how to make the search function, only how to make the coordinates.

If anyone can help me, I will be very grateful

```SIZE = 32;
coordinate_x = x div SIZE;
coordinate_y = y div SIZE;```
x and y are the actual x and y coordinates, coordinate_x and coordinate_y are the "new" values. For example, x is 32 and y is 32 so coordinate_x is 1 and coordinate_y is 1... x is 320 and y is 640 so coordinate_x is 10 and coordinate_y is 20
• 0

### #3 aavitsland

aavitsland

GMC Member

• GMC Member
• 64 posts
• Version:GM:Studio

Posted 28 May 2012 - 06:57 PM

Hi all.

I am a bit curious as to how I would go to make a map with coordinates.
Lets say I have a worldmap of 3200 x 3200 pixels and I want every 32 pixels to be 1 coordinate.
Like 32:32 = 1:1
and 64:32 = 2:1
and 320:640 = 10:20

So that a player can seach a coordinate to be taken to that point upon request.
I do not ask how to make the search function, only how to make the coordinates.

If anyone can help me, I will be very grateful

```SIZE = 32;
coordinate_x = x div SIZE;
coordinate_y = y div SIZE;```
x and y are the actual x and y coordinates, coordinate_x and coordinate_y are the "new" values. For example, x is 32 and y is 32 so coordinate_x is 1 and coordinate_y is 1... x is 320 and y is 640 so coordinate_x is 10 and coordinate_y is 20