Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Coordinate conventions on wiki and tibiamaps #278

Closed
jatentaki opened this issue Dec 26, 2023 · 1 comment
Closed

Coordinate conventions on wiki and tibiamaps #278

jatentaki opened this issue Dec 26, 2023 · 1 comment

Comments

@jatentaki
Copy link

TLDR: tibiamaps.io reports coordinates as 32321,32220,7 while tibiawiki as 126.65-125.221-7. I know how the tibiamaps format relates to downloadable file names but how does it work with tibiawiki?

Longer: I'm building a pathfinding tool. It works (locally, in python) and supports "teleports" autogenerated from the maps (stair squares are auto-linked with the one directly above/below whenever possible). This could be a very useful tool, for example to quickly generate quest walkthroughs. Unfortunately the current iteration lacks the myriad of fast transportation options, so I would like to make it coordinate-compatible with tibiawiki to make it easier to populate the database with ship captains, teleports etc.

@BourbonCrow
Copy link
Contributor

BourbonCrow commented Dec 27, 2023

       function client_to_wiki(xy, mod) {
            return Math.floor(xy / 256) + "." + (xy % 256 + Number(mod));
        }

        function wiki_to_client(xy) {
            nums = xy.split(".");
            result = Number(nums[0]) * 256 + Number(nums[1]);
            return result;
        }

this is the dode i found in their https://tibia.fandom.com/wiki/MapConvert page, i hope it helps

https://tibia.fandom.com/load.php?lang=en&modules=MediaWiki%3ACoordinatesConverter.js
thats the JS file for their converter but you will need to beatify it to make sense of it :P

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants