Difference between revisions of "Talk:GetPositionX - ObjectReference"
Jump to navigation
Jump to search
imported>Lisselli m |
imported>Lisselli (Removed my last edit and added a working function.) |
||
Line 3: | Line 3: | ||
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. | 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. | ||
[[User:Lisselli|Lisselli]] ([[User talk:Lisselli|talk]])[[User:Lisselli|Lisselli]] ([[User talk:Lisselli|talk]]) 2017-10-06T11:57:52 (EDT) | [[User:Lisselli|Lisselli]] ([[User talk:Lisselli|talk]])[[User:Lisselli|Lisselli]] ([[User talk:Lisselli|talk]]) 2017-10-06T11:57:52 (EDT) | ||
== GetCoordinateX == | |||
<source lang="papyrus"> | |||
Float Function GetCoordinateX(ObjectReference akRef) | |||
; Converts the object's position to the X coordinate of the cell. | |||
return Math.Floor(akRef.GetPositionX() / 4096.0) | |||
EndFunction | |||
</source> | |||
Use this to get the exact X coordinate for the cell. To be used only for exterior cells. [[User:Lisselli|Lisselli]] ([[User talk:Lisselli|talk]]) 2017-10-27T06:31:57 (EDT) |
Revision as of 05:31, 27 October 2017
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
Float Function GetCoordinateX(ObjectReference akRef)
; Converts the object's position to the X coordinate of the cell.
return Math.Floor(akRef.GetPositionX() / 4096.0)
EndFunction
Use this to get the exact X coordinate for the cell. To be used only for exterior cells. Lisselli (talk) 2017-10-27T06:31:57 (EDT)