TheVampire Posted February 18, 2014 Report Share Posted February 18, 2014 Does anyone know of a way to get the map width and height without hardcoding it per map? Link to comment Share on other sites More sharing options...
0 TheVampire Posted February 18, 2014 Author Report Share Posted February 18, 2014 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 More sharing options...
Question
TheVampire
Does anyone know of a way to get the map width and height without hardcoding it per map?
Link to comment
Share on other sites
1 answer to this question
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now