PDA

View Full Version : fn_PosToGrid.sqf - module functions



Dr_Eyeball
Jun 9 2009, 09:55
The posToGrid script function only works for Chernarus.
The correct "offset" to apply for Utes is 5120. (Chernarus uses 15360.)

To add support for Utes (and future terrain addons), you can change the code to something like:

private ['_yOffset'];

_yOffset = switch toLower(worldName) do
{
case 'chernarus': {15360};
case 'utes': {5120};
default {15360};
};
_xgrid = floor (_x / 100);
_ygrid = floor ((_yOffset - _y) / 100);
Ref File: ".\ArmA 2\AddOns\modules\Functions\misc\fn_PosToGrid.sqf"

Let us know if you find a fast automatic method.

Serclaes
Jun 9 2009, 15:01
Could you post an example how you used that function? I just spent 2 hours trying to figure that out but the only return i get is "ANY" and the .rpt isn't very helpful either.

Spooner
Jun 9 2009, 15:32
The world-to-grid function in SPON Map is still universal (Absolutely any A1 or A2 map!), but it will be a while until I get it ported to A2.

Mike84
Jun 9 2009, 15:58
big thumbs up @<hidden> bis for keeping this hoop for us to jump over

CarlGustaffa
Jun 9 2009, 23:06
Oh no..... This nightmare again... Why can't they just give us a builtin command? AI reports proper grids all the time.

I'm using the SPON_Map for this. But getting simple grid readouts adds quite a lot of additional data to the mission compared to the gain.

But anyway, hopefully all islands will follow the new system at least, no more letters.

What is needed if someone wants the correct northing? Currently the northing is inverse.

Spooner
Jun 12 2009, 19:03
Well, yes, having SPON Map just for this one function is overkill. But then how can anyone play without it? :P