World vs map coordinates

Forum Archive - from http://theuniversal.net
Locked
User avatar
morbydvisns
Posts: 1889
Joined: Sun Jan 30, 2005 12:51 am

World vs map coordinates

Post by morbydvisns »

Is there any possible way we can get a more... uniform conversion between map and world coordinates? The current way, there are 256 tiles, and 3,000,000 map coordinates in each the x and y axis. That is 11718.75 world points per tile. This makes it difficult for precise world/map coordinate conversion in scripting, because the parser does not do decimals.
Last edited by morbydvisns on Tue Sep 10, 2013 8:52 pm, edited 1 time in total.
User avatar
zaroba
World Owner
World Owner
Posts: 7257
Joined: Fri Oct 10, 2003 11:06 pm
Location: Hereford, PA
Contact:

Post by zaroba »

math might be off off

have 2 buildings on zoric, one at 25,25 and one at 26,26
their world cords are x,y 56152,56152 and 58398,56152
comes out to 2246 world points per tile in each axis.

had the same results with a default 256x256 map and a 2x tile sized 1024x1024 map
User avatar
morbydvisns
Posts: 1889
Joined: Sun Jan 30, 2005 12:51 am

Post by morbydvisns »

make a &command to *say your playerworldx and y, go to the far up/left corner and run it, see what you get
User avatar
morbydvisns
Posts: 1889
Joined: Sun Jan 30, 2005 12:51 am

Post by morbydvisns »

Nevermind, I see what's going on.. at 1200 landscape scale, there are 3 million world coordinates per axis, at 400 landscape scale there are 1 million.
User avatar
zaroba
World Owner
World Owner
Posts: 7257
Joined: Fri Oct 10, 2003 11:06 pm
Location: Hereford, PA
Contact:

Post by zaroba »

ahh, my tests must not have had a large enough difference in tile size
User avatar
Mit
Staff
Staff
Posts: 3551
Joined: Sun Sep 21, 2003 10:14 pm
Location: Unknown

Post by Mit »

does the script function sysMapToWorld help?
i.e.

Code: Select all

$worldX = sysMapToWorld( $mapX )
the world size is basically the position in cm (or tenths of a cm, whatever.. it depends how tiny people are.. ). The tile size/landscape scale is an arbitrary number that affects how big each tile is. Hence the relative scale of map coordinates - i.e. tile coord - and the world coordinates are variable.
User avatar
morbydvisns
Posts: 1889
Joined: Sun Jan 30, 2005 12:51 am

Post by morbydvisns »

Not bad, i'm sure that will come in handy. I just learned of getting more than 256 tiles on the map today =) so that resolved a big chunk of issue for me.
Locked