Jump to content
Sign in to follow this  
CombatComm

Get grid reference command??

Recommended Posts

Hey so I did a quick scroll through the comref and didnt see anything that might give me what Im after, although im not great with scripts so I probably wouldent have known anyway. Id like to have a trigger that supplies the player with the approximate location by grid reference of the target. This way it provides a clue but itsnt a marker and so still somewhat a challenge. Id imagine this is possible since somwhere in a script your AI tell you their griid ref. Thanks

Share this post


Link to post
Share on other sites

Cool. So after much research this is the way I went. Unfortunately I receive Any as my hint... any suggestions?

taliban3 = _this select 0;

player sidechat format["%1",taliban3];

mapGrid = (getPos taliban3) call BIS_fnc_PosToGrid;

mapgridX = _mapgrid select 0;

mapgridY = _mapgrid select 1;

hint format["X:%1/Y:%2",_mapgridX,_mapgridY];

Share this post


Link to post
Share on other sites
Cool. So after much research this is the way I went. Unfortunately I receive Any as my hint... any suggestions?

_taliban3 = _this select 0;

player sidechat format["%1", _taliban3];

_mapGrid = (getPos taliban3) call BIS_fnc_PosToGrid;
_mapgridX = _mapgrid select 0;
_mapgridY = _mapgrid select 1;

hint format["X:%1/Y:%2",_mapgridX,_mapgridY]; 

Should work now, you were trying to get a local variable when you assigned a global one.

_neo_

Share this post


Link to post
Share on other sites

Could be a mistake here though

_mapGrid = (getPos taliban3) call BIS_fnc_PosToGrid;

shouldn't it be

_mapGrid = (getPos _taliban3) call BIS_fnc_PosToGrid;

Share this post


Link to post
Share on other sites

Awseome! It worked as NEO suggested. It gave me the grid reference box of 3 characters. Zoomed in this shows exact location. Is there anyway I can reduce the grid value? So instead of X 104, Y 064 I get X 10, Y 06? Might be trying to squeeze a dry orange here but figured id ask

Share this post


Link to post
Share on other sites
Is there anyway I can reduce the grid value? So instead of X 104, Y 064 I get X 10, Y 06?

This is a shot in the dark, because I'm not at an ArmA2-playing computer.

But try dividing the output numbers by 10 and using the round command.

So that a 0 is inserted in front of numbers less than 10 (e.g. 06 rather than 6), you'll just have to set up an if...then... command like this.

if (_number < 10) then {_output = "0" + str (_number)};

You'll probably need to use commands like str and call compile to change between numbers and strings.

Share this post


Link to post
Share on other sites

Wow this one has been rough. Does anyone have another method? Simpler perhaps?

Share this post


Link to post
Share on other sites

you can convert possition with function... You need functions module...

_pos = position player;
_result = _pos call BIS_fnc_PosToGrid;

hint format ["%1",_result];

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×