OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: StonedSoldier on 20 Jan 2004, 16:35:55

Title: Grid Reference
Post 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

Title: Re:Grid Reference
Post by: icarus_uk on 20 Jan 2004, 17:29:55
In a script;

_posx = getpos unitname select 0
_posy = getpos unitname select 1

UnitName Sidechat format ["My position is %1, %2", _posx, _posy]
Title: Re:Grid Reference
Post by: Artak on 20 Jan 2004, 18:23:53
You can find a reference from the editors depot tutorials.

Quote
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.
Title: Re:Grid Reference
Post by: icarus_uk on 20 Jan 2004, 18:27:48
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.