Jump to content

Coordinates to Region File Calculator


bigc90210

Recommended Posts

  • 1 year later...

Good Morning BigC,

 

Great job on the Coordinates to Region File Calculator program you have created and shared with the community.

Any chance you could share the actual formula used to perform the calculations?

 

I myself might like to incorporate a function directly into my own server manager wherein an admin could type in a command and...

 

For Example: my manager program would shut down the server delete the offending files and then reboot the server.

 

Or...

 

For Example: my manager program would begin saving and backing up a certain region on a scheduled basis etc...

 

And while they could go and download your program and open it and follow all the steps required it would be so much more efficient if I simply add it into my server manager and they could use the game interface.

 

So any chance you would be willing to share the formula for calculation?

 

I understand if you feel reluctant to and if that is the case is there anybody else that has worked out the math already that would be willing to share?

 

Thanks in advance for any assistance. :bee:

Link to comment
Share on other sites

  • 2 months later...

Bigc's download isn't working for me to know if his formula works this way, but this should cover what you're looking for :)

 


;AutoIT3 language:

Func _RegionToCoordMinMax($Coord)

  If $Coord < 0 Then
  Global $rMinMark = (($Coord*"512")+1)
  Global $rMaxMark = (($Coord*"512")+"512")
  If $rMaxMark = 0 Then
	 Global $rMaxMark = "-0"
  EndIf
  Else
  Global $rMinMark = ($Coord*"512")
  Global $rMaxMark = (($Coord*"512")+"511")
  EndIf

EndFunc

Func _CoordToRegion($Coord, $Dir)

  If $Dir = "South" Or $Dir = "West" Then
	  Global $RegionMark = ("-" & (((StringSplit(($Coord/"512"), "."))[1])+"1"))
  Else
	  Global $RegionMark = ((StringSplit(($Coord/"512"), "."))[1])
  EndIf

EndFunc

 

2 important things to note; first, NESW converts to XYZ at 1:1 ratios so "0 West or South" is "-0 XYZ" <-- negative zero!

 

so an r.-1.-1.7rg file's max would be -0XYZ or 0 west and -0XYZ or 0 south.

 

The second thing is /loc rounds the numbers and console LP does not.

0.0 to 0.4 = 0

0.5 to 1.4 = 1

This is important because it means the game shows a coordinate is the crack between two blocks where a player figures he's standing on the coordinate when he stands on the center of the block. it can confuse a player :/ it also means the 0 coordinate is actually represented by -0 and 0 and yet there's only one crack. (I don't think the game actually thinks this, I just don't think they thought it through when setting the rounding to happen.)

Link to comment
Share on other sites

  • 1 month later...

this looks cool. I need to check it out. my question:

 

1. if I just go to the saved game an delete a region file, will the game just re-create/add a fresh new one automatically or do I need to save all the regions at the start and replace them?

 

2. how big are region files and are they the smallest item you can replace? basically I want to take hub city and the surrounding 8 cities and replace those every 30 days so they are fresh and rebuilt. how do you suggest or recommend I do that? ideally a script I can run on windows server (2012/R2) :)

 

3. how big are region files? 512x 512 blocks square?

Link to comment
Share on other sites

so I seem to have run into a problem.

 

using the tool at my hub city I it told me that R 0.0.7rg needed to be replaced. well that only replaced part of the city. if I fly to all four corners of the city enter the coordinates it always returns 0,0 as the region file when in fact it can't be since the city is something like 1200 blocks by 800+ blocks.

Link to comment
Share on other sites

  • 1 year later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...