Jump to content
  • 0

Getting Map Width/Height


TheVampire

Question

1 answer to this question

Recommended Posts

  • 0

Figured this out with meatball logic.

 

The grid position on maps starts at 000000 at the top left.

 

You can create an object ofset a tiny bit from 0,0 in the positive direction and get its grid position using mapGridPosition _object.

 

Since you are in the farthest left grid, the first three numbers are 0, and the last 3 are the highest possible grid.

 

If you know each grid is 100m, you now have the height of the left side of the map roughly.

 

mapGridPosition returns the value as a string, which you can use parseNumber to turn into a value.

 

Code example:

_mapTest = createVehicle ["Can_Small", [10,10,0], [], 0, "CAN_COLLIDE"];
_mapGrid = mapGridPosition (getPosASL _mapTest);
//returns string "000153"
_mapHeight = (parseNumber _mapGrid) * 100;
deleteVehicle _mapTest;

hint str(_mapHeight);

Returns 15,300 on Chernarus.

 

Chernarus is 15360 x 15360meters.

 

The inaccuracy is due to a partially filled grid, which isn't a full 100meters.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...