OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: StonedSoldier on 20 Jan 2004, 16:35:55
-
i have a question is there a way so that a unit can detect its loaction and gives its position (grid reference) over sidechat
-
In a script;
_posx = getpos unitname select 0
_posy = getpos unitname select 1
UnitName Sidechat format ["My position is %1, %2", _posx, _posy]
-
You can find a reference from the editors depot tutorials.
Map Grid to X/Y Coordinates Table Jerommeke 1.0
You can build a script based on what icarus told you and using the reference above to give the position in map grids.
-
Yes of course, the way I said it will give distances from the origin. You want to then convert those numbers into a grid referance, ie letters and numbers. Doing that on the fly mid mission however, I think will be tricky.