GRW ScriptHook 0.11.0
Plugin API for Ghost Recon Wildlands
Loading...
Searching...
No Matches
Player

The local player, via the engine's own component. More...

Data Structures

struct  ShPlayer
 root is the top of the parent chain, and the only position that survives a direct write. More...

Typedefs

typedef int(*) ShLastError_t(void)
typedef const char *(*) ShErrorString_t(int err)
typedef int(*) ShGetVersion_t(void)
typedef int(*) ShGetPlayer_t(ShPlayer *out)
typedef int(*) ShTeleportPlayer_t(const ShVec3 *pos, const ShVec3 *orient)
typedef int(*) ShWalkToRoot_t(uint64_t entity, uint64_t *outRoot)
typedef int(*) ShGetPlayerPosition_t(ShVec3 *out)
typedef void(*) ShInvalidate_t(void)

Functions

SH_API int ShGetPlayer (ShPlayer *out)
 The local player.
SH_API int ShGetPlayerPosition (ShVec3 *out)
 The soldier's own position, from its matrix.
SH_API int ShGetCameraEyePosition (ShVec3 *out)
 Where the player global says the view sits, about 1.9m behind and 1.6m above the body in third person.
SH_API int ShTeleportPlayer (const ShVec3 *pos, const ShVec3 *orient)
 Teleport the player, at any range.
SH_API int ShTeleportPlayerHops (const ShVec3 *pos, const ShVec3 *orient, float hopMetres, int delayMs)
 Teleport in hops rather than one jump, for when a single long move misbehaves.
SH_API int ShIsInVehicle (void)
 True while riding a vehicle, read from the entity link in the parent chain.
SH_API int ShWalkToRoot (uint64_t entity, uint64_t *outRoot)
 Walk an entity's parent chain to its root.
SH_API void ShInvalidate (void)
 Drop the cached player, so the next call re-resolves.

Detailed Description

The local player, via the engine's own component.

Typedef Documentation

◆ ShLastError_t

typedef int(*) ShLastError_t(void)

◆ ShErrorString_t

typedef const char *(*) ShErrorString_t(int err)

◆ ShGetVersion_t

typedef int(*) ShGetVersion_t(void)

◆ ShGetPlayer_t

typedef int(*) ShGetPlayer_t(ShPlayer *out)

◆ ShTeleportPlayer_t

typedef int(*) ShTeleportPlayer_t(const ShVec3 *pos, const ShVec3 *orient)

◆ ShWalkToRoot_t

typedef int(*) ShWalkToRoot_t(uint64_t entity, uint64_t *outRoot)

◆ ShGetPlayerPosition_t

typedef int(*) ShGetPlayerPosition_t(ShVec3 *out)

◆ ShInvalidate_t

typedef void(*) ShInvalidate_t(void)

Function Documentation

◆ ShGetPlayer()

SH_API int ShGetPlayer ( ShPlayer * out)

The local player.

In a vehicle the root re-parents to the vehicle; the entity stays the soldier.

◆ ShGetPlayerPosition()

SH_API int ShGetPlayerPosition ( ShVec3 * out)

The soldier's own position, from its matrix.

Use this for anything placed in the world.

◆ ShGetCameraEyePosition()

SH_API int ShGetCameraEyePosition ( ShVec3 * out)

Where the player global says the view sits, about 1.9m behind and 1.6m above the body in third person.

◆ ShTeleportPlayer()

SH_API int ShTeleportPlayer ( const ShVec3 * pos,
const ShVec3 * orient )

Teleport the player, at any range.

Verified 9.9km cross map, landing within 3m of the target. In a vehicle it carries the car and the camera, and that is verified cross map too.

◆ ShTeleportPlayerHops()

SH_API int ShTeleportPlayerHops ( const ShVec3 * pos,
const ShVec3 * orient,
float hopMetres,
int delayMs )

Teleport in hops rather than one jump, for when a single long move misbehaves.

0 hopMetres gives 300m. delayMs is a real pause per hop. 300 is the value proven over long routes, 0 has crashed the game.

◆ ShIsInVehicle()

SH_API int ShIsInVehicle ( void )

True while riding a vehicle, read from the entity link in the parent chain.

Verified both ways.

◆ ShWalkToRoot()

SH_API int ShWalkToRoot ( uint64_t entity,
uint64_t * outRoot )

Walk an entity's parent chain to its root.

◆ ShInvalidate()

SH_API void ShInvalidate ( void )

Drop the cached player, so the next call re-resolves.