Difference between revisions of "Sectorid"

From Vendetta Lua
Jump to: navigation, search
(New page: = sectorid = == Description == The sectorid is a numeric value representing a sector in the universe == See Also == Function_Index#GetCurrentSectorid, [[Function_Index#SplitSectorid]...)
 
 
(10 intermediate revisions by 6 users not shown)
Line 1: Line 1:
= sectorid =
+
The sectorid is a numeric value representing a sector in the universe. Currently it's ranging from 1 (Sol II A-1) to 7680 (Dantia P-16)
  
== Description ==
+
Given systemid (s), and coordinates (x, y), you could determine the sectorid mathematically using the following formula
The sectorid is a numeric value representing a sector in the universe
+
  
== See Also ==
+
sectorid = (s-1)*256 + (x-1)*16 + y
[[Function_Index#GetCurrentSectorid]], [[Function_Index#SplitSectorid]], [[Function_Index#LocationStr]], [[Function_Index#ShortLocationStr]]
+
 
 +
Take note that SplitSectorid returns a triple (systemid, sectorh, sectorv) with the coordinates swapped, so sectorh = y and sectorv = x.
 +
 
 +
= See Also =
 +
 
 +
* [[API Index#GetCurrentSectorid|GetCurrentSectorid]]
 +
* [[API Index#SplitSectorid|SplitSectorid]]
 +
* [[API Index#LocationStr|LocationStr]]
 +
* [[API Index#ShortLocationStr|ShortLocationStr]]
 +
[[Category:Functions/Values]]

Latest revision as of 11:04, 28 March 2023

The sectorid is a numeric value representing a sector in the universe. Currently it's ranging from 1 (Sol II A-1) to 7680 (Dantia P-16)

Given systemid (s), and coordinates (x, y), you could determine the sectorid mathematically using the following formula

sectorid = (s-1)*256 + (x-1)*16 + y

Take note that SplitSectorid returns a triple (systemid, sectorh, sectorv) with the coordinates swapped, so sectorh = y and sectorv = x.

See Also