- Found in:
- Vanilla
Description
Wiki Description
Returns the distance between this radio transmitter and the player (Pipboy radio).
Documentation Comment
Get the distance between this radio transmitter and the player
Caveats
CK Wiki - Notes
- When called on a repeater, you get the distance to that specific repeater.
- When called on a source transmitter with active repeaters, you get the range to the closest of those refs.
Some key differences between this function and ObjectReference.GetDistance(...):
- This function is only valid when run on active, limited-range radio transmitters on frequencies detectable by the Pipboy. Transmitter refs become active when they are both Enabled and filling a Quest Alias.
- This function only returns a valid distance if the player is within the transmitter's outer radius (Max Weak Distance). OnPipboyRadioDetection can be used to determine when this is the case.
- This function will 'go through teleport doors', returning the cumulative straight-line distance from the ref to the player based on a pathfinding search.
- Distance to active transmitters is updated twice a second if no pathfinding search is required (ref & player in the same space), and once every 5 seconds otherwise.
Examples
; Find out how far away the player is from the transmitter ref.
Debug.Trace("Player is " + MyTransmitterRef.GetTransmitterDistance() + " units away from MyTransmitterRef.")Auto-Generated Example
float returnedValue = myObjectReference__toCallFunctionOn.GetTransmitterDistance()Related Pages
Additional References
View this function’s page on the Fallout 4 Creation Kit Wiki
