Interface IPlayerPositionHistory
- Namespace
- SkyrimForge
- Assembly
- SkyrimForge.dll
The positions the player has stood on in the loaded game, and the search for a position near the player to place an actor.
public interface IPlayerPositionHistory
Remarks
A position is recorded each second while the player stands on the ground outdoors, 500 units or more from the last one recorded, and the latest 60 are retained. A load or a new game empties the record. Call members on the game's thread.
Properties
GroundedPosition
The player's position on the ground, or the mount's while riding. It is null while the player is in the air or swimming.
NiPoint3? GroundedPosition { get; }
Property Value
Methods
FindSpawnPosition(float, float, IEnumerable<NiPoint3>?)
Finds a position more than minimumDistance and less than maximumDistance units from the player,
on ground an actor can stand on.
SpawnPosition? FindSpawnPosition(float minimumDistance, float maximumDistance, IEnumerable<NiPoint3>? candidates = null)
Parameters
minimumDistancefloatThe distance the position exceeds.
maximumDistancefloatThe distance the position is within.
candidatesIEnumerable<NiPoint3>Positions in the player's worldspace on which an actor can stand.
Returns
- SpawnPosition?
The latest recorded position in range, then the first candidate in range, then the ground under a map marker in range, then the ground behind the player midway between the two distances, if that ground is in range. The result is null where none of them is found.
WaitForGroundAsync(TimeSpan, CancellationToken)
Waits up to timeout of unpaused time for GroundedPosition.
Task<NiPoint3?> WaitForGroundAsync(TimeSpan timeout, CancellationToken cancellationToken = default)
Parameters
timeoutTimeSpancancellationTokenCancellationToken