Skip to content

First person, the engine's own way ​

Group fpx · 11 exports · from forks/gamexueren/scripthook.h (framework 1.0-beta7-wildm1, SH_API_VERSION 2)

The eye is the engine's own head position. The argument the engine hands its head function is captured once, then that same function is asked again every frame and the answer is written where the camera position goes. Nothing here is derived from the camera basis: no forward, no up, no easing

  • which is why it does not fight the engine on slopes, in vehicles or through a respawn.

A menu, the drone and iron sights each carry a byte the engine already maintains, and while any of them is up the camera is left alone.

ShCameraFirstPerson takes this path whenever it is available. Where these sites cannot be found - a build we have not seen - the older placement still answers, so the game behaves exactly as it did before.

ExportSummary
ShFp2InstallInstall every site.
ShFp2ReadySee ShFp2Install.
ShFp2InstallExtrasThe body and shoulder patches: always allow a shoulder swap, keep the body when it is pushed against a wall, and the two hooks that feed them.
ShFp2MissingWhich sites did not take, as a mask.
ShFp2Enable1 to take the camera, 0 to hand it back.
ShFp2SetOffsetThe eye offset in metres, in the eye's own axes: right along the camera's right, forward along its forward flattened to the horizon, up in world Z.
ShFp2GateThe live gate bytes.
ShFp2HeadOk1 while the head is reachable through the engine's own visibility call, so a caller knows whether it has to hide the head by some other means.
ShFp2HeadShowForce the head visible (non zero) or hidden (0), now and for every frame until said otherwise.
ShFp2BowWhy the last frame placed no eye: 0 it placed, 1 not asked, 2 a menu, 3 the drone, 4 an aim, 5 stale, 6 no argument, 7 the answer was not a position.
ShFp2AgeMilliseconds since the last frame an eye was placed.

ShFp2Install ​

c
SH_API int  ShFp2Install(void);

Install every site. Returns 1 when the capture site, the one the rest depends on, was found and patched. A partial install still works: the gates that could not be found simply never close.

scripthook.h, line 2198

ShFp2Ready ​

c
SH_API int  ShFp2Ready(void);

Documented together with ShFp2Install just above.

scripthook.h, line 2199

ShFp2InstallExtras ​

c
SH_API int  ShFp2InstallExtras(uint32_t mask);

The body and shoulder patches: always allow a shoulder swap, keep the body when it is pushed against a wall, and the two hooks that feed them. None of these is needed for the eye, and all of them change how the engine draws the body whether first person is on or not, so they are installed separately.

mask is one bit per site - 1 the body position hook, 2 body visibility, 4 the shoulder swap, 8 the wall push - so they can be taken one at a time. Returns 1 when every site that was asked for took.

scripthook.h, line 2212

ShFp2Missing ​

c
SH_API uint32_t ShFp2Missing(void);

Which sites did not take, as a mask. 0 means all of them. Bit 0 the capture site, 1/2/3 the three menu sites, 4 the drone, 5 aim down sight, 6 the body reading, 7 body visibility, 8 the shoulder swap, 9 the wall push.

scripthook.h, line 2219

ShFp2Enable ​

c
SH_API void ShFp2Enable(int on);

1 to take the camera, 0 to hand it back.

scripthook.h, line 2222

ShFp2SetOffset ​

c
SH_API void ShFp2SetOffset(float right, float forward, float up);

The eye offset in metres, in the eye's own axes: right along the camera's right, forward along its forward flattened to the horizon, up in world Z.

scripthook.h, line 2228

ShFp2Gate ​

c
SH_API void ShFp2Gate(int *menu, int *drone, int *ads, int *fresh);

The live gate bytes. Any argument may be NULL.

scripthook.h, line 2231

ShFp2HeadOk ​

c
SH_API int  ShFp2HeadOk(void);

1 while the head is reachable through the engine's own visibility call, so a caller knows whether it has to hide the head by some other means.

scripthook.h, line 2237

ShFp2HeadShow ​

c
SH_API void ShFp2HeadShow(int show);

Force the head visible (non zero) or hidden (0), now and for every frame until said otherwise. While first person holds the camera the hidden state is restated once a frame, because the engine keeps reasserting its own.

scripthook.h, line 2244

ShFp2Bow ​

c
SH_API int  ShFp2Bow(void);

Why the last frame placed no eye: 0 it placed, 1 not asked, 2 a menu, 3 the drone, 4 an aim, 5 stale, 6 no argument, 7 the answer was not a position.

scripthook.h, line 2252

ShFp2Age ​

c
SH_API uint32_t ShFp2Age(void);

Milliseconds since the last frame an eye was placed.

scripthook.h, line 2255

WildM is an independent community project. It is not affiliated with or endorsed by Ubisoft. Ghost Recon Wildlands is a trademark of Ubisoft Entertainment.