Talk:GetPositionX - ObjectReference
Revision as of 09:29, 14 January 2019 by imported>Rasikko (→GetCoordinateX: Corrected the math.)
Getting Cell Coordinates
Ever wondered how you can use the Cell View window's coordinates in game? Simple. You take the two values and you multiply them by 4096. If you want to convert an object's in game coordinates to use in the Cell View window, you divide the X and Y values by 4096 and cast as int to remove the decimals. Lisselli (talk)Lisselli (talk) 2017-10-06T11:57:52 (EDT)
GetCoordinateX
Int Function GetCoordinateX(float afPosX)
; Returns the X coordinate.
int posX = afPosX as int
if (posX < 0)
return (posX / 4096) - 1
else
return posX / 4096
endif
EndFunction