Difference between revisions of "Talk:GetPositionX - ObjectReference"
Jump to navigation
Jump to search
Talk:GetPositionX - ObjectReference (edit)
Revision as of 11:22, 27 October 2017
, 11:22, 27 October 2017→GetCoordinateX: Fixed code to account for negative values.
imported>Lisselli (Removed my last edit and added a working function.) |
imported>Lisselli (→GetCoordinateX: Fixed code to account for negative values.) |
||
Line 7: | Line 7: | ||
<source lang="papyrus"> | <source lang="papyrus"> | ||
Float Function GetCoordinateX(ObjectReference akRef) | Float Function GetCoordinateX(ObjectReference akRef) | ||
; Converts the | ; Converts the objects' position to the X coordinate of the cell. | ||
Float GetPosX = akRef.GetPositionX() | |||
If GetPosX >= 0.0 | |||
Return GetPosX as int | |||
Else | |||
Return Math.Floor(GetPosX) | |||
EndIf | |||
EndFunction | EndFunction | ||
</source> | </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- | Use this to get the exact X coordinate for the cell. To be used only for exterior cells. Takes negative values into account. [[User:Lisselli|Lisselli]] ([[User talk:Lisselli|talk]]) 2017-10-27T12:22:34 (EDT) |