Advanced - Port Distances
Posted: Wed Jul 03, 2013 3:00 pm
Since it has been requested, here is the full data to get port distance.
We use longtitude - latitude straight off the map you see, in straight lines affected by a global variable in order to control speed at anytime we want.
Longitude-Latitude (in array format to encourage scripted tools creation)
(I left regions in the array in purpose as they will be used in some future version)
Functions used:
If you use it with ship speed guide:
viewtopic.php?f=13&t=76
you can create your own calculating tools
We use longtitude - latitude straight off the map you see, in straight lines affected by a global variable in order to control speed at anytime we want.
Longitude-Latitude (in array format to encourage scripted tools creation)
- Code: Select all
$ports = array (
"1" => array("name" => "Kanoni", "x_cd" => "47", "y_cd" => "202", "region" => "1"),
"2" => array("name" => "Baramas", "x_cd" => "141", "y_cd" => "173", "region" => "1"),
"3" => array("name" => "St.Martins", "x_cd" => "169", "y_cd" => "63", "region" => "1"),
"4" => array("name" => "Pania", "x_cd" => "362", "y_cd" => "89", "region" => "2"),
"5" => array("name" => "Regis", "x_cd" => "437", "y_cd" => "147", "region" => "2"),
"6" => array("name" => "Goroum", "x_cd" => "524", "y_cd" => "100", "region" => "2"),
"7" => array("name" => "New land", "x_cd" => "239", "y_cd" => "303", "region" => "4"),
"8" => array("name" => "Hannes", "x_cd" => "674", "y_cd" => "87", "region" => "3"),
"9" => array("name" => "Vaasburg", "x_cd" => "443", "y_cd" => "274", "region" => "5"),
"10" => array("name" => "Seaglory", "x_cd" => "341", "y_cd" => "398", "region" => "5""),
"11" => array("name" => "Tortuga", "x_cd" => "259", "y_cd" => "477", "region" => "4"),
"12" => array("name" => "Tzogos", "x_cd" => "234", "y_cd" => "587", "region" => "4"),
"13" => array("name" => "Aiora", "x_cd" => "453", "y_cd" => "577", "region" => "5"),
"14" => array("name" => "Thorakas", "x_cd" => "590", "y_cd" => "393", "region" => "5"),
"15" => array("name" => "Gasp", "x_cd" => "679", "y_cd" => "471", "region" => "6"),
"16" => array("name" => "Neapolis", "x_cd" => "583", "y_cd" => "192", "region" => "2"),
"17" => array("name" => "Caspian", "x_cd" => "678", "y_cd" => "253", "region" => "6"),
"18" => array("name" => "Prote", "x_cd" => "761", "y_cd" => "168", "region" => "3"),
"19" => array("name" => "Chalkos", "x_cd" => "902", "y_cd" => "116", "region" => "3"),
"20" => array("name" => "Psaral", "x_cd" => "872", "y_cd" => "343", "region" => "6"),
"21" => array("name" => "Akrotiri", "x_cd" => "888", "y_cd" => "587", "region" => "6")
);
(I left regions in the array in purpose as they will be used in some future version)
Functions used:
- Code: Select all
$x = abs($x1 - $x2);
$y = abs($y1 - $y2);
$total = $x + $y;
$global_var =10;
$distance = round($total * $global_var * 50);
If you use it with ship speed guide:
viewtopic.php?f=13&t=76
you can create your own calculating tools