Script bindings: Cameras¶
Verified against: SLUS_212.15 (NTSC-U, SHA1 e9cb2cc49aa046b9e494313dce2f5038ed17b2f4).
Bindings for creating, switching and moving cameras: 41 in all. Conventions, the other categories and how to read an entry are on the masterlist.
| Binding | Returns | Scripts | Boot | Mission 1 | Evidence |
|---|---|---|---|---|---|
CamAddPoizoPoint |
boolean | 6 | no | no | confirmed (code) |
CamAddPoizoPointCam |
boolean | 1 | no | no | confirmed (code) |
CamAddRailPoint |
boolean | 27 | no | no | confirmed (code) |
CamAssignRevCamButton |
- | 1 | no | no | confirmed (code) |
CamCanSee |
boolean | 19 | no | no | confirmed (code) |
CamDelete |
- | 57 | no | no | confirmed (code) |
CamEnable |
- | 85 | no | yes | confirmed (code) |
CameraCreateFixed |
number | 9 | no | no | confirmed (code) |
CameraCreateLocked |
number | 86 | yes | yes | confirmed (code) |
CameraCreateThird |
number | 2 | no | no | confirmed (code) |
CameraCreateWin |
number | 33 | no | no | confirmed (code) |
CameraGetActive |
number | 5 | no | no | confirmed (code) |
CameraMakeActive |
- | 193 | yes | yes | confirmed (code) |
CameraReset |
- | 167 | yes | yes | confirmed (code) |
CameraSetClipping |
- | 19 | no | no | confirmed (code) |
CameraTransform |
- | 0 | no | no | confirmed (code) |
CameraTransformPoint |
- | 0 | no | no | confirmed (code) |
CamGetLastTarget |
number | 0 | no | no | inferred |
CamGetPos |
usertype | 2 | no | no | confirmed (code) |
CamGhostDoor |
- | 2 | no | no | confirmed (code) |
CamLeadRail |
- | 9 | no | no | confirmed (code) |
CamLockLocked |
- | 1 | no | no | confirmed (code) |
CamLockRail |
- | 15 | no | no | confirmed (code) |
CamModifyRail |
- | 26 | no | no | confirmed (code) |
CamRegisterObject |
- | 0 | no | no | inferred |
CamReversePoizo |
boolean | 2 | no | no | confirmed (code) |
CamSetFollowAngle |
- | 76 | no | yes | confirmed (code) |
CamSetFollowHeading |
- | 68 | no | no | confirmed (code) |
CamSetFollowPos |
- | 12 | no | no | confirmed (code) |
CamSetFollowZoom |
- | 13 | no | yes | confirmed (code) |
CamSetGameAspect |
- | 0 | no | no | inferred |
CamSetHUDAspect |
- | 0 | no | no | inferred |
CamSetHUDScale |
- | 0 | no | no | confirmed (code) |
CamSetSecondary |
- | 7 | no | yes | confirmed (code) |
CamSetSplitMode |
- | 3 | no | no | confirmed (code) |
CamSetupFollow |
number | 1 | yes | yes | confirmed (code) |
CamSetupHood |
number | 2 | no | no | confirmed (code) |
CamSetupPoizo |
number | 7 | no | no | confirmed (code) |
CamSetupRail |
number | 27 | no | no | confirmed (code) |
CamTarget |
boolean | 42 | no | yes | confirmed (code) |
CamUseDeathCamera |
- | 33 | no | no | confirmed (code) |
CamAddPoizoPoint¶
| # | Argument | Read as | Meaning |
|---|---|---|---|
| 1 | pos |
table of 3 numbers (t[1]..t[3]) | World position {x, y, z} of the point in metres. Written back unchanged. |
| 2 | heading |
number (single precision) | Heading (turn about the vertical) in degrees. |
| 3 | pitch |
number (single precision) | Pitch in degrees. |
| 4 | roll |
number (single precision) | Roll in degrees. |
| 5 | seconds |
number (single precision) | Time in seconds to travel from this point to the next one (unused on the last point); 0 or less is stored as 0. |
| 6 | onReach |
string | Optional name of a Lua function called (with no arguments, once) when the camera reaches this point. |
Returns boolean (1 for true, nil for false): true (1) when there is a path camera (always, once one exists), nil otherwise.
Appends a point to the scripted camera path started by CamSetupPoizo: a position and an orientation built from heading,
pitch and roll. The camera passes through it on the curve and calls onReach there.
Notes. The path holds 8 points including the start view; when full, each new point overwrites the last. Adding points while the path plays changes it from the next update.
- Evidence: confirmed (code) at
0x0011cbb0,0x00142ac8,0x00142a58; detail: traced - Wrapper
0x00366e18(registered byRegisterBindings); calls0x0011cbb0Camera_AddPoizoPoint,0x00142ac8CamSpline_AddPointAngles,0x00142a58PoizoCam_AddPoint - Used by 6 of 467 script chunks (10 references); boot to menu: no; mission 1: no; result used: no
- Later in the story: 6 of 28 levels, first
level87(mission 3) - Coney: implemented
CamAddPoizoPointCam¶
| # | Argument | Read as | Meaning |
|---|---|---|---|
| 1 | camera |
number, truncated to an unsigned integer | A camera whose current position and orientation become the point. |
| 2 | seconds |
number (single precision) | Time in seconds to travel from this point to the next one (unused on the last point). |
| 3 | onReach |
string | Optional name of a Lua function called (once, no arguments) when the camera reaches this point. |
Returns boolean (1 for true, nil for false): true (1) when the point was added; nil when there is no path camera or the handle is not a camera.
Appends a point to the scripted camera path taken from another camera's view (often a fixed camera placed for the shot), so the path ends on or passes through that camera's framing.
Notes. The view is copied when the call is made; later moves of that camera do not change the point. Lens values are not taken from it.
- Evidence: confirmed (code) at
0x0011cc68,0x00142d28; detail: traced - Wrapper
0x00366f90(registered byRegisterBindings); calls0x0011cc68Camera_AddPoizoPointCam,0x00142d28CamSpline_AddPointFromCamera - Used by 1 of 467 script chunks (1 reference); boot to menu: no; mission 1: no; result used: no
- Later in the story: 1 of 28 levels, first
level87(mission 3) - Coney: implemented
CamAddRailPoint¶
| # | Argument | Read as | Meaning |
|---|---|---|---|
| 1 | pos |
table of 3 numbers (t[1]..t[3]) | World position {x, y, z} in metres of the next rail point; written back unchanged. |
| 2 | player |
number, truncated to an integer; default -1 | Player index, or -1 (default) for every player's rail camera. |
Returns boolean (1 for true, nil for false): true (1) when the point was added, nil when the player has no rail camera yet.
Appends a point to a rail camera's path (points at +0x1e0, 16 bytes each; count +0x350). The rail is the line
through the points in the order added; the camera moves along it after its target.
Notes. At most 16 points: further calls overwrite the 16th. With -1, a player without a rail camera is skipped.
- Evidence: confirmed (code) at
0x0011d098,0x0013b780; detail: traced - Wrapper
0x003667a0(registered byRegisterBindings); calls0x0011d098Camera_AddRailPoint,0x0013b780CamRail_AppendPoint - Used by 27 of 467 script chunks (132 references); boot to menu: no; mission 1: no; result used: no
- Later in the story: 19 of 28 levels, first
level2(mission 5) - Coney: implemented
CamAssignRevCamButton¶
| # | Argument | Read as | Meaning |
|---|---|---|---|
| 1 | button |
number, truncated to an unsigned integer | Button id used for the reverse (look-behind) camera. |
Returns nothing.
Sets which button shows the reverse camera (0x0050b230).
- Evidence: confirmed (code) at
0x0011e198; detail: brief - Wrapper
0x003672a8(registered byRegisterBindings); calls0x0011e198Camera_AssignReverseButton - Used by 1 of 467 script chunks (1 reference); boot to menu: no; mission 1: no; result used: no
- Coney: implemented
CamCanSee¶
| # | Argument | Read as | Meaning |
|---|---|---|---|
| 1 | object |
number, truncated to an unsigned integer | Handle of a human or object. |
| 2 | range |
number (single precision) | Greatest distance from the camera in metres at which the object counts as seen; capped at the camera's far distance, and 0 or less means the far distance. |
Returns boolean (1 for true, nil for false): true when any player's camera can see a point just above the object, false otherwise (also when the handle does not resolve or there is no player camera).
Tests whether a point 0.3 m above the object's position (1 m for an object whose class flags have 0x40) is seen by any
player's camera: within range, inside the camera's view, and with no collision-mesh hit on the ray from the camera to
the point. Scripts use it to spawn enemies out of sight.
Notes. Cameras are per player (table 0x005d9150, count 0x0011eae0); view test is camera vtable +0x16c (2 =
outside); other humans and objects do not block the ray, only the world collision mesh. Class flag 0x40 is inferred to
mark humans. The result was described as nil when false before; it is pushed as a boolean.
- Evidence: confirmed (code) at
0x0011dd78,0x001202e8,0x00122548; detail: traced - Wrapper
0x00367160(registered byRegisterBindings); calls0x0011dd78Camera_CanSeeObject,0x001202e8Camera_AnyPlayerCanSeePoint,0x00122548Camera_CanSeePoint - Used by 19 of 467 script chunks (179 references); boot to menu: no; mission 1: no; result used: yes
- Later in the story: 10 of 28 levels, first
level93(mission 10) - Coney: implemented
CamDelete¶
| # | Argument | Read as | Meaning |
|---|---|---|---|
| 1 | camera |
number, truncated to an unsigned integer | Handle of a fixed (type 0, CameraCreateFixed) or locked (type 1, CameraCreateLocked) camera; any other camera or handle is ignored. |
Returns nothing.
Deletes a camera made by CameraCreateFixed or CameraCreateLocked; the shared kinds (follow, path, blend, rail and the others) are kept. If it is a player's current camera, that player is left with no current camera until a script makes another active; if a blend refers to it, the reference is cleared.
Notes. Camera_Release (with 0) refuses a camera that is a player's previous camera (0x005d9148[i]), so deleting
the camera just switched away from does nothing; type 16 (CameraCreateThird) is not deletable this way.
- Evidence: confirmed (code) at
0x0011b888,0x0011e440; detail: traced - Wrapper
0x00365818(registered byRegisterBindings); calls0x0011b888Camera_DeleteScripted,0x0011e440Camera_Release - Used by 57 of 467 script chunks (90 references); boot to menu: no; mission 1: no; result used: yes
- Later in the story: 13 of 28 levels, first
level87(mission 3) - Coney: implemented
CamEnable¶
| # | Argument | Read as | Meaning |
|---|---|---|---|
| 1 | feature |
number, truncated to an unsigned integer | Which camera switch, 0-13 (Camera switches). 0 the right stick and zoom buttons, 5 the follow camera's sprint zoom (turning it off cancels a zoom in progress), 9 the power-move camera, 11 the look-behind button; 3 and 4 gate the second player's view and target (3 also re-lays out the views). |
| 2 | on |
boolean (nil or 0 is false) | true turns the switch on. |
| 3 | player |
number, truncated to an integer; default -1 | Player index for the per-player switches (0, 2, 5), or -1 (default) for every player. |
Returns nothing.
Turns one of the camera system's switches on or off. The scripts use 0, 3, 4, 7 and 13 most.
Notes. Flags: 0 → 0x0050b1b8[player], 1 → 0x0050b1cc, 3 → 0x0050b1c0, 4 → 0x0050b1c8, 6 → 0x0050b1d0, 7 → 0x0050b2ac, 8 → 0x0050b2b0, 9 → 0x0050b1d4, 10 → 0x0050b248, 11 → 0x0050b23c, 12 → 0x0050b2b4, 13 → 0x0050b1e0.
- Evidence: confirmed (code) at
0x0011de58; detail: traced - Wrapper
0x003671e0(registered byRegisterBindings); calls0x0011de58Camera_EnableFeature - Used by 85 of 467 script chunks (405 references); boot to menu: no; mission 1: yes; result used: no
- Later in the story: 23 of 28 levels, first
level80(mission 2) - Coney: implemented
CameraCreateFixed¶
| # | Argument | Read as | Meaning |
|---|---|---|---|
| 1 | name |
string | Camera name (passed to the camera factory). |
| 2 | target |
number, truncated to an unsigned integer | Handle of a human added to the shared camera target list (as CamTarget mode 0) if it is not there and the list has room (4); a bad handle makes nothing. |
| 3 | pos |
table of 3 numbers (t[1]..t[3]) | Camera position {x, y, z} in metres (placed through slot +0x1bc); written back unchanged. |
| 4 | fov |
number (single precision) | Field of view in degrees (slot +0x194). |
| 5 | offset |
table of 3 numbers (t[1]..t[3]) | Offset {x, y, z} in metres added to the look-at point (+0x1e0); written back unchanged. |
| 6 | near |
number (single precision) | Near clip distance in metres (slot +0x1a4). |
| 7 | far |
number (single precision) | Far clip distance in metres, capped at 150 (slot +0x1ac). |
Returns number: The new camera's handle, or NilHandle when the target is bad or no camera could be made.
Creates a fixed camera (type 0, Cam_Fixed) at pos that turns each update to look at the shared camera target list:
the average position of the listed humans that still count, plus offset. The target is put on that list rather than
stored in the camera, so the camera also frames every other listed human (normally the players). It is not made current
here.
Notes. With an empty list the camera keeps its last view; when two list counters are equal (0x0050b198 == 0x0050b19c) it looks at one chosen entry instead of the average. The target stays on the list after the camera is gone.
- Evidence: confirmed (code) at
0x0011c6b8,0x001222b0,0x00124690,0x00124000; detail: traced - Wrapper
0x00366140(registered byRegisterBindings); calls0x0011c6b8Camera_CreateFixed,0x001222b0CameraTargets_Add,0x00124690CamFixed_Update,0x00124000CamFixed_ComputeLookAt - Used by 9 of 467 script chunks (12 references); boot to menu: no; mission 1: no; result used: yes
- Later in the story: 7 of 28 levels, first
level3(mission 6) - Coney: implemented
CameraCreateLocked¶
| # | Argument | Read as | Meaning |
|---|---|---|---|
| 1 | name |
string | Camera name. |
| 2 | pos |
table of 3 numbers (t[1]..t[3]) | World position {x, y, z} in metres. |
| 3 | fov |
number (single precision) | Field of view in degrees. |
| 4 | heading |
number (single precision) | Heading in degrees. |
| 5 | pitch |
number (single precision) | Pitch in degrees. |
| 6 | roll |
number (single precision) | Roll in degrees. |
| 7 | near |
number (single precision) | Near clip distance in metres. |
| 8 | far |
number (single precision) | Far clip distance in metres, at most 150. |
Returns number: The new camera's handle, or NilHandle when it could not be made.
Creates a locked camera: one at a fixed position looking in a fixed direction. The front end's black camera is one; level99's tutorial cut-aways are nine more (Camera).
Notes. Argument order checked against the callee's slots: fov through slot +0x194, the three angles stored at +0x200, near slot +0x1a4, far slot +0x1ac.
- Evidence: confirmed (code) at
0x0011bc48; detail: traced - Wrapper
0x00365d38(registered byRegisterBindings); calls0x0011bc48Camera_CreateLocked - Used by 86 of 467 script chunks (360 references); boot to menu: yes; mission 1: yes; result used: yes
- Later in the story: 27 of 28 levels, first
level80(mission 2) - Coney: implemented
CameraCreateThird¶
| # | Argument | Read as | Meaning |
|---|---|---|---|
| 1 | name |
string | Camera name (passed to the camera factory). |
| 2 | target |
number, truncated to an unsigned integer | Handle of the human (or object) to follow, kept at camera +0x1e0; a bad handle makes nothing. |
| 3 | fov |
number (single precision) | Field of view in degrees (vtable slot +0x194). |
| 4 | distance |
number (single precision) | Metres behind the target's facing (+0x210; default 5.1). |
| 5 | height |
number (single precision) | Metres above the look-at point (+0x214; default 1.8). |
| 6 | angle |
number (single precision) | Degrees the camera is swung about the vertical through the look-at point (a quaternion at +0x1f0); 0 is straight behind. |
| 7 | offset |
table of 3 numbers (t[1]..t[3]) | Look-at offset {x, y, z} in metres, in the target's frame (+0x220; default (0, 0, 1.5)); written back unchanged. |
| 8 | near |
number (single precision) | Near clip distance in metres (slot +0x1a4). |
| 9 | far |
number (single precision) | Far clip distance in metres, capped at 150 (slot +0x1ac). |
Returns number: The new camera's handle, or NilHandle when the target is bad or no camera could be made.
Creates a third-person camera (type 16, Cam_3rdPerson) on a target: each update its look-at point is the target's
position plus offset, its orientation eases 10% toward the target's, and it sits distance behind that orientation
and height above, swung by angle round the look-at point. Used for the chase and the Chatterbox shots; it is not
made current here.
Notes. The camera is not added to the shared target list, and CamDelete does not delete type 16. Created by the factory 0x0011e1b0 with player 0; shake is applied (0x00121298) with no position offset.
- Evidence: confirmed (code) at
0x0011be18,0x001207b0,0x001205e8; detail: traced - Wrapper
0x00365f28(registered byRegisterBindings); calls0x0011be18Camera_CreateThird,0x001207b0Cam3rdPerson_SetAngle,0x001205e8Cam3rdPerson_Update - Used by 2 of 467 script chunks (3 references); boot to menu: no; mission 1: no; result used: yes
- Later in the story: 2 of 28 levels, first
level3(mission 6) - Coney: implemented
CameraCreateWin¶
| # | Argument | Read as | Meaning |
|---|---|---|---|
| 1 | name |
string | Camera name. |
| 2 | target |
number, truncated to an unsigned integer | Handle of the human to frame. |
| 3 | fov |
number (single precision) | Field of view in degrees. |
| 4 | a |
number (single precision) | Distance from the target along its facing, in metres (the arenas pass 3). |
| 5 | b |
number (single precision) | Start angle about the vertical, in degrees (the arenas pass -19). |
| 6 | c |
number (single precision) | Orbit speed in degrees per second (the arenas pass 40). |
| 7 | d |
number (single precision) | Height of the look-at point above the target, in metres (the arenas pass 1.1). |
| 8 | far |
number (single precision) | Far clip distance, at most 150. |
| 9 | direction |
number, truncated to an integer; default 1 | 1 (default) or less: sets the orbit direction to +1 or -1 (inferred). |
Returns number: The camera's handle, or NilHandle.
Sets up the win camera that circles the winner at the end of a Rumble match.
Notes. One shared camera object, Cam_Win (0x00120188, constructor 0x00143918), set up by 0x0011c858; start
0x001439d8, orbit 0x00143c78. Behaviour: Rumble.
- Evidence: confirmed (code) at
0x0011c858; detail: brief - Wrapper
0x00366360(registered byRegisterBindings); calls0x0011c858Camera_CreateWin - Used by 33 of 467 script chunks (33 references); boot to menu: no; mission 1: no; result used: yes
- Coney: implemented
CameraGetActive¶
| # | Argument | Read as | Meaning |
|---|---|---|---|
| 1 | player |
number, truncated to an integer | Player index (0 or 1; the wrapper's default is 0). |
Returns number: Handle of that player's current camera (0x005d9150[player]), or NilHandle when it has none.
Returns the handle of the camera a player currently sees through, so a script can come back to it after a cut (with CameraMakeActive) or read its position.
Notes. The handle is pushed as an unsigned number (negative values get 2^32 added).
- Evidence: confirmed (code) at
0x0011b838; detail: traced - Wrapper
0x003657a0(registered byRegisterBindings); calls0x0011b838Camera_GetActiveHandle - Used by 5 of 467 script chunks (5 references); boot to menu: no; mission 1: no; result used: yes
- Later in the story: 3 of 28 levels, first
level87(mission 3) - Coney: implemented
CameraMakeActive¶
| # | Argument | Read as | Meaning |
|---|---|---|---|
| 1 | camera |
number, truncated to an unsigned integer | Handle of the camera to make current. |
| 2 | seconds |
number (single precision) | Blend time from the current camera in seconds; 0 switches at once. |
| 3 | name |
string | Optional string given to the camera (scripts pass nil); its use is not traced. |
| 4 | forHuman |
number, truncated to an unsigned integer; default 4294967295 | Optional human whose player gets the camera (default NilHandle: the camera's own player). |
| 5 | fromHuman |
number, truncated to an unsigned integer; default 4294967295 | Optional human whose player's previous camera is the blend source (default: the same player). |
Returns nothing.
Makes a camera the current camera of a player, blending from the previous one over the given time: a linear blend of position and look-at point and a slerp of the orientation from the previous view to the new camera's live view, which becomes current directly when the time is up. While a scene camera is current it replaces the camera the scene returns to instead. See Camera.
- Evidence: confirmed (code) at
0x0011b770; detail: traced - Wrapper
0x003656a0(registered byRegisterBindings); calls0x0011b770Camera_MakeActiveByHandle - Used by 193 of 467 script chunks (629 references); boot to menu: yes; mission 1: yes; result used: no
- Later in the story: 28 of 28 levels, first
level80(mission 2) - Coney: implemented
CameraReset¶
| # | Argument | Read as | Meaning |
|---|---|---|---|
| 1 | camera |
number, truncated to an unsigned integer | Camera handle. |
Returns nothing.
Resets a camera to its starting state (camera vtable slot +0x13c). A follow camera is placed behind its target at the
band's nearest preset distance, its target pitch and field of view set back to the configured ones; the band is not
moved; the other player's follow camera is reset too. level99 resets its follow camera before every return to it
(Camera).
- Evidence: confirmed (code) at
0x0011bad8; detail: traced - Wrapper
0x00365a10(registered byRegisterBindings); calls0x0011bad8Camera_ResetByHandle - Used by 167 of 467 script chunks (310 references); boot to menu: yes; mission 1: yes; result used: no
- Later in the story: 28 of 28 levels, first
level80(mission 2) - Coney: implemented
CameraSetClipping¶
| # | Argument | Read as | Meaning |
|---|---|---|---|
| 1 | camera |
number, truncated to an unsigned integer | Camera handle (from CamSetupFollow, CameraCreate... or CameraGet...). |
| 2 | near |
number (single precision) | Near clip distance in metres; ignored for a follow camera (type 2), which keeps its 0.1. |
| 3 | far |
number (single precision) | The camera's own far clip in metres, capped at 150 (the player camera's default is 115). |
Returns nothing.
Sets a camera's near clip (+0x50) and its own far clip (+0x54). The far clip is the ceiling of the draw distance,
which the world renderer moves each frame between 60 - 10 × views and it as the scenery streams in, so levels use it
to set how far the player can see; fog starts at a fraction of the draw distance (SetFogDistance).
Notes. Setters are camera slots +0x1a4 (near) and +0x1ac (far). The camera's type (slot +0x1ec) is read before
the handle is checked, so an invalid handle crashes. Draw distance: The streamed
world.
- Evidence: confirmed (code) at
0x0011bb98; detail: traced - Wrapper
0x00365600(registered byRegisterBindings); calls0x0011bb98Camera_SetClipping - Used by 19 of 467 script chunks (23 references); boot to menu: no; mission 1: no; result used: no
- Later in the story: 11 of 28 levels, first
level80(mission 2) - Coney: implemented
CameraTransform¶
| # | Argument | Read as | Meaning |
|---|---|---|---|
| 1 | camera |
number, truncated to an unsigned integer | Camera handle. |
| 2 | object |
number, truncated to an unsigned integer | Handle of a world object. |
Returns nothing.
Sets an object's matrix to its matrix combined with the camera's (attaching it to the view). No script calls it.
- Evidence: confirmed (code) at
0x0011ba20; detail: brief - Wrapper
0x003658c0(registered byRegisterBindings); calls0x0011ba20Camera_AttachObjectToView - Used by no script on the disc
- Coney: not implemented
CameraTransformPoint¶
| # | Argument | Read as | Meaning |
|---|---|---|---|
| 1 | camera |
number, truncated to an unsigned integer | Camera handle. |
| 2 | pos |
table of 3 numbers (t[1]..t[3]) | Table {x, y, z} overwritten with the point transformed by the camera's matrix. |
Returns nothing.
Transforms a point by a camera's matrix and writes it back into the table. No script calls it.
- Evidence: confirmed (code) at
0x0011b970; detail: brief - Wrapper
0x00365938(registered byRegisterBindings); calls0x0011b970Camera_TransformPoint - Used by no script on the disc
- Coney: not implemented
CamGetLastTarget¶
No arguments.
Returns number: A handle kept by the camera system (0x005d91b8), inferred to be the last camera target.
Returns the camera system's last target. No script calls it.
- Evidence: inferred; detail: brief
- Wrapper
0x003673e8(registered byRegisterBindings); calls0x0011e188Camera_GetLastTarget - Used by no script on the disc
- Coney: not implemented
CamGetPos¶
| # | Argument | Read as | Meaning |
|---|---|---|---|
| 1 | camera |
number, truncated to an unsigned integer | Camera handle (from CameraGetActive or a create call). |
Returns const M_Vector4 object (nil for none): The camera's world position (x, y, z, w) in metres, from its vtable
position getter (+0x21c slot); a shared zero vector (0x005116c0) when the handle is not a camera.
Returns where a camera is in the world, for example to place a flag or an effect at the viewpoint.
Notes. The vector is the camera's own, not a copy: read it at once, it changes as the camera moves.
- Evidence: confirmed (code) at
0x0011b920; detail: traced - Wrapper
0x00365850(registered byRegisterBindings); calls0x0011b920Camera_GetPositionByHandle - Used by 2 of 467 script chunks (2 references); boot to menu: no; mission 1: no; result used: yes
- Later in the story: 2 of 28 levels, first
level87(mission 3) - Coney: implemented
CamGhostDoor¶
| # | Argument | Read as | Meaning |
|---|---|---|---|
| 1 | door |
number, truncated to an unsigned integer | Handle of a door object (object kinds 0x0f, 0x19, 0x1e or 0x21); anything else does nothing. |
Returns nothing.
Lets the camera pass through a door: sets type bit 9 (0x200) on the door's two collision triangles (door +0xd8 /
+0xdc, World objects) in the world collision mesh. The camera's rays use mask 0x200 and
skip such triangles (Collision: ray cast), so the camera no longer stops at the
door.
Notes. There is no way back: no binding clears the bit, and it lasts until the collision mesh is reloaded. Other queries whose mask has bit 9 skip the triangles too (not listed).
- Evidence: confirmed (code) at
0x003973a0,0x00395020,0x003a4a40; detail: traced - Wrapper
0x00379be8(registered byRegisterBindings); calls0x003973a0Door_SetCameraGhost,0x00395020,0x003a4a40CollisionMesh_OrTriangleTypeBits - Used by 2 of 467 script chunks (2 references); boot to menu: no; mission 1: no; result used: no
- Later in the story: 2 of 28 levels, first
level31(mission 11) - Coney: implemented
CamLeadRail¶
| # | Argument | Read as | Meaning |
|---|---|---|---|
| 1 | lead |
number (single precision) | Metres along the rail between the target's place on it and the camera (+0x370, eased into +0x35c). |
| 2 | seconds |
number (single precision) | Time in seconds to ease the lead to its new value (0 at once); forced to 0 while the current lead is negative. |
| 3 | ahead |
boolean (nil or 0 is false); default true | true (default): the camera runs ahead of the target along the rail (mode 1); false: it trails behind (mode 2). |
| 4 | player |
number, truncated to an integer; default -1 | Player index, or -1 (default) for every player's rail camera. |
Returns nothing.
Puts a player's existing rail camera into a leading mode. Each update the camera finds the rail segment the target is
level with, takes the target's projection onto it and stands lead metres from that point along the rail, forward in
mode 1 or backward in mode 2, clamped to the rail's ends, then looks at the target. With several targets the farthest
projection counts.
Notes. Placement: CamRail_PlaceLeading 0x0013e708; it raises the camera to target z + the height (CamModifyRail 1) when that is above 0 and pulls it back from world collision. Switch 7 (on by default and after every CamSetupRail) stands the camera off the rail, exactly the lead from the target in plan, and makes the look-at point the target point pushed out of the world; off, the camera stays on the rail (Camera: leading). Mode 0 (after CamSetupRail, 0x0013d6b0): Camera: rail cameras. No rail camera: nothing.
- Evidence: confirmed (code) at
0x0011cf70,0x0013e708; detail: traced - Wrapper
0x003666e8(registered byRegisterBindings); calls0x0011cf70Camera_SetRailLead,0x0013e708CamRail_PlaceLeading - Used by 9 of 467 script chunks (15 references); boot to menu: no; mission 1: no; result used: no
- Later in the story: 6 of 28 levels, first
level2(mission 5) - Coney: implemented
CamLockLocked¶
| # | Argument | Read as | Meaning |
|---|---|---|---|
| 1 | camera |
number, truncated to an unsigned integer | Handle of a locked camera (CameraCreateLocked). |
| 2 | human |
number, truncated to an unsigned integer | Handle of a human. |
| 3 | on |
boolean (nil or 0 is false) | true adds the human to the camera's list (camera +0x20c, once), false removes it. |
Returns nothing.
Adds a human to (or removes it from) the humans a locked camera keeps in shot. Each update of the locked camera
(LockedCam_KeepHumansInView 0x00135ca8) tests each listed human against the left and right edges of the view; one that
comes within 0.3 m of an edge is pushed back inside (its position is set, with a height probe), so the player cannot
walk out of a fixed shot.
Notes. Per listed human, each locked-camera update (0x00135ca8): p = the physics body's position (0x00714b00 table)
plus 1.4 m up, q = the human's placed position (object +0x10, last frame's) plus 1.4 m up, so the test is at about
head height. 0x00135960(0.3, camera, p, q) takes the camera's planes 0 and 1 (vtable +0x174, 0x004db0c8: camera
+0x70+i×16, normal xyz pointing into the view, offset w; that they are the left and right sides is inferred from the
push direction). Plane 0 first: if dot(p, n) − w < 0.3, p moves along n by (0.3 − that) + 0.00001, so it ends exactly
0.3 m inside; only if plane 0 did not fire is plane 1 tested the same way. The part of the step q→p along the plane is
then ray-cast from q against the world (mask 0x200, length |step| + 0.3) and shortened to stop 0.3 m short of a hit.
When pushed, p drops back 1.4 m and is snapped to the ground: a ray from 2.4 m above it straight down, 3.4 m long; on a
hit the feet go 0.01 m above it. A human in the airborne state (flag 0x1c00000000) is landed at once (0x0023e090, which
can apply fall damage) and its height moves only 30 % of the way to the snapped value. The position is set with vtable
+0x6c, keeping the body's orientation. The "pushed" flag is not reset between humans, so after one push every later
human in the list is re-placed (ground snap) that update even when inside. A forward plane 1 m ahead is computed at the
start but never used. Nothing happens if the camera handle is not a camera or the human handle is gone. All confirmed
(code) unless marked.
- Evidence: confirmed (code) at
0x0011bdc0,0x001358d0; detail: traced - Wrapper
0x00367030(registered byRegisterBindings); calls0x0011bdc0Camera_LockLocked,0x001358d0 - Used by 1 of 467 script chunks (4 references); boot to menu: no; mission 1: no; result used: no
- Later in the story: 1 of 28 levels, first
level87(mission 3) - Coney: implemented
CamLockRail¶
| # | Argument | Read as | Meaning |
|---|---|---|---|
| 1 | on |
boolean (nil or 0 is false) | true freezes the rail camera, false lets it follow its rail again. |
| 2 | player |
number, truncated to an integer; default -1 | Player index whose rail camera to set; -1 (the default) sets player 0's and every other player's (up to the player count, game state +0x224). |
Returns nothing.
Locks or releases a player's rail camera (camera type 9) by setting its byte +0x3e4. While locked, the rail update
(0x0013d6b0) no longer moves the camera along its rail after the target: it keeps its position and view from the
previous frame; targets that leave the frame are pushed back into it (the humans move, not the camera,
camera.md#rail-frame). It stays locked until CamLockRail(false): neither CamSetupRail nor CameraMakeActive clears
it. The rail camera also holds itself for one update at a time while its look-at point is past the rail's end. Armies of
the Night (levels 60-64) uses it to hold the side-scrolling view.
Notes. A player with no rail camera is skipped (Camera_GetPlayerRail returns none). Modes 1 and 2 ignore the lock; mode 3 sets it itself at the rail's ends. Every reader and writer: Camera: rail cameras.
- Evidence: confirmed (code) at
0x0011d180,0x0013d6b0; detail: traced - Wrapper
0x00366880(registered byRegisterBindings); calls0x0011d180Camera_LockRail,0x0013d6b0CamRail_UpdatePosition - Used by 15 of 467 script chunks (118 references); boot to menu: no; mission 1: no; result used: no
- Later in the story: 5 of 28 levels, first
level60(Armies of the Night 1) - Coney: not implemented
CamModifyRail¶
| # | Argument | Read as | Meaning |
|---|---|---|---|
| 1 | param |
number, truncated to an unsigned integer | Which setting: 0 the most the camera stays from its target point in plan (m, 0 off), 1 the most it stands above the target's feet (m, negative off), 2 field of view (degrees, negative ignored), 3 the target point's shift along the rail (m), 4 the look-at point's further shift along the rail (m), 5 an angle that switches the rail to mode 3, 8 a fixed look-at pitch (degrees; below -360 switches 5 and 8 off), 9 the look-at offset's height (m); 6 is eased but never read; 7 is mode 3's margin for keeping the targets inside the view's sides (m); others do nothing. Meanings for mode 0: Camera: rail cameras. |
| 2 | value |
number (single precision) | The new value, in the setting's unit. |
| 3 | seconds |
number (single precision) | Time in seconds to ease linearly from the current value to the new one; 0 for at once. |
| 4 | player |
number, truncated to an integer; default -1 | Player index, or -1 (default) for every player's rail camera. |
Returns nothing.
Changes one of a rail camera's settings, reached over seconds: the rail update eases each current value to its target
by the remaining time every frame (targets at +0x374-+0x398, times at +0x3a0-+0x3c4). Scripts mostly change the
field of view (2) and the height and distance to frame a chase.
Notes. Setting 1 is a ceiling in mode 0: it lowers the camera, never raises it. Setting 5 (0x0013fac8) switches the rail to mode 3 (placement 0x0013dcc8, camera.md#rail-mode3; the angle is its view pitch) and back to mode 0 when switched off; setting 8 (0x0013fb30) turns 0 into -0.05°. When an angle is switched on its current value starts from the camera's present angle (0x0013f9b0). Setting 0 starts from the present distance.
- Evidence: confirmed (code) at
0x0011d228,0x0013d010,0x0013f930; detail: traced - Wrapper
0x003668e8(registered byRegisterBindings); calls0x0011d228Camera_ModifyRail,0x0013d010CamRail_Update,0x0013f930CamRail_EaseValue - Used by 26 of 467 script chunks (132 references); boot to menu: no; mission 1: no; result used: no
- Later in the story: 17 of 28 levels, first
level2(mission 5) - Coney: implemented
CamRegisterObject¶
| # | Argument | Read as | Meaning |
|---|---|---|---|
| 1 | object |
number, truncated to an unsigned integer | Handle of a world object. |
| 2 | on |
boolean (nil or 0 is false) | true registers it with the camera system, false unregisters it. |
Returns nothing.
Registers or unregisters an object with the camera system (inferred: for camera collision or fading). No script calls it.
- Evidence: inferred; detail: brief
- Wrapper
0x00367388(registered byRegisterBindings); calls0x0011e130Camera_RegisterObject - Used by no script on the disc
- Coney: not implemented
CamReversePoizo¶
| # | Argument | Read as | Meaning |
|---|---|---|---|
| 1 | onEnd |
string | Name of the Lua function called when the reversed path ends (interned into the camera, +0x2e8), or nil. |
Returns boolean (1 for true, nil for false): true when the path camera exists (it is created on first use, so false only when that allocation fails).
Turns the path camera (Camera: path cameras) round: its points' positions and orientations are put in reverse order, the segment times shifted to match (a point's time is to the next point), the progress reset to the start, the camera placed at the new first point and the path started again with the new end callback. Scripts use it to fly a path back to where it began.
Notes. It does not make the path camera current; it moves only while it is player 0's camera. Calling it twice restores the original order.
- Evidence: confirmed (code) at
0x0011cb70,0x00120038,0x00142578; detail: traced - Wrapper
0x00366dd0(registered byRegisterBindings); calls0x0011cb70Camera_ReversePoizo,0x00120038Cam_GetPoizo,0x00142578PoizoCam_Reverse - Used by 2 of 467 script chunks (2 references); boot to menu: no; mission 1: no; result used: no
- Later in the story: 1 of 28 levels, first
level14(mission 12) - Coney: implemented
CamSetFollowAngle¶
| # | Argument | Read as | Meaning |
|---|---|---|---|
| 1 | degrees |
number (single precision) | Pitch in degrees (positive looks down on the player), clamped to the camera's pitch limits. |
Returns nothing.
Sets the target pitch of every player's follow camera, clamped to its pitch limits, and turns the view to it at once; it lasts until the next CameraReset or CfgFollowCamera. level99's -10 clamps to the lower limit, about -4.3 degrees (Camera).
- Evidence: confirmed (code) at
0x0011c3b8; detail: traced - Wrapper
0x00365bb8(registered byRegisterBindings); calls0x0011c3b8Camera_SetFollowPitch - Used by 76 of 467 script chunks (94 references); boot to menu: no; mission 1: yes; result used: no
- Later in the story: 16 of 28 levels, first
level80(mission 2) - Coney: implemented
CamSetFollowHeading¶
| # | Argument | Read as | Meaning |
|---|---|---|---|
| 1 | degrees |
number (single precision) | Heading of the camera in degrees about the followed character, measured from the character's facing (as CameraReset uses 180 to put the camera behind). |
Returns nothing.
Snaps every player's follow camera round its target to the given heading with no blend: player 1's camera is snapped
(its previous look-at points set to the current one) and each follow camera is then placed at that heading at a distance
chosen from the zoom band, the same placement as CameraReset (0x00124f38). Level scripts use it to set the opening
view.
Notes. Does nothing when player 1 has no follow camera yet (0x0011f9e0(0, 0)). Players 2 and up (count
W_GameState+0x224) are placed without the snap. With no target the heading is measured from the world's forward axis.
The "from the character's facing" reading is inferred from 0x001250a8; distance rule and pitch reset:
Camera.
- Evidence: confirmed (code) at
0x0011c2f0; detail: traced - Wrapper
0x00365b80(registered byRegisterBindings); calls0x0011c2f0Camera_SetFollowHeading - Used by 68 of 467 script chunks (85 references); boot to menu: no; mission 1: no; result used: no
- Later in the story: 13 of 28 levels, first
level80(mission 2) - Coney: implemented
CamSetFollowPos¶
| # | Argument | Read as | Meaning |
|---|---|---|---|
| 1 | pos |
table of 3 numbers (t[1]..t[3]) | World position {x, y, z} in metres for the camera. Written back unchanged. |
| 2 | player |
number, truncated to an integer | Player index (default 0). |
Returns nothing.
Puts a player's follow camera at a world position at once, with no blend: its look-at point is snapped onto the target
(no easing, 0x00127d88 with 1) and the camera is placed there (vtable +0x1bc), with its wanted position (+0x250)
and lag copies set to the same point. Scripts use it at checkpoints and after cut-aways so play resumes with the camera
in a chosen spot.
Notes. Does nothing if the player has no follow camera yet (it is not created here); it does not make the follow camera current. The leash rules then keep the camera where it was put until the player drags it.
- Evidence: confirmed (code) at
0x0011c638,0x00125c50; detail: traced - Wrapper
0x00365c60(registered byRegisterBindings); calls0x0011c638Camera_SetFollowPosition,0x00125c50Cam_Follow_SetPosition - Used by 12 of 467 script chunks (17 references); boot to menu: no; mission 1: no; result used: no
- Later in the story: 7 of 28 levels, first
level87(mission 3) - Coney: implemented
CamSetFollowZoom¶
| # | Argument | Read as | Meaning |
|---|---|---|---|
| 1 | preset |
number, truncated to an unsigned integer | 0 close: the band's near edge at the minimum distance (where CfgFollowCamera leaves it); 1 the default distance; 2 far: the band's far edge at the maximum. With two player cameras 0 acts as 1. Other values do nothing. |
| 2 | player |
number, truncated to an integer; default -1 | Player index, or -1 (the default) for every player. |
Returns nothing.
Moves the follow camera's distance band (0.5 m deep) to one of its three zoom distances (set by CfgFollowCamera), snaps the look-at point and sets the zoom step and upper pitch limit (30, 40 or 50 degrees for presets 0, 1, 2). The camera is not moved: the leash drags it into the new band. See Camera.
Notes. Confirmed (runtime): level99 checkpoint 1 reads band 3.0-3.5, zoom step 4.8, limit 30; after CamSetFollowZoom(1) at checkpoint 2, 4.8-5.3, 6.6, 40.
- Evidence: confirmed (code) at
0x0011c470; detail: traced - Wrapper
0x00365bf0(registered byRegisterBindings); calls0x0011c470Camera_SetFollowZoom - Used by 13 of 467 script chunks (17 references); boot to menu: no; mission 1: yes; result used: no
- Later in the story: 9 of 28 levels, first
level80(mission 2) - Coney: implemented
CamSetGameAspect¶
| # | Argument | Read as | Meaning |
|---|---|---|---|
| 1 | aspect |
number (single precision) | Aspect ratio (inferred: width over height). |
Returns nothing.
Sets the game view's aspect ratio. No script calls it.
- Evidence: inferred; detail: brief
- Wrapper
0x003672e0(registered byRegisterBindings); calls0x0011e0e0Camera_SetGameAspect - Used by no script on the disc
- Coney: not implemented
CamSetHUDAspect¶
| # | Argument | Read as | Meaning |
|---|---|---|---|
| 1 | aspect |
number (single precision) | Aspect ratio (inferred). |
Returns nothing.
Sets the HUD's aspect ratio. No script calls it.
- Evidence: inferred; detail: brief
- Wrapper
0x00367318(registered byRegisterBindings); calls0x0011e100Camera_SetHudAspect - Used by no script on the disc
- Coney: not implemented
CamSetHUDScale¶
| # | Argument | Read as | Meaning |
|---|---|---|---|
| 1 | scale |
number (single precision) | HUD scale factor (stored at 0x0050b20c). |
Returns nothing.
Sets the HUD scale. No script calls it.
- Evidence: confirmed (code) at
0x0011e120; detail: brief - Wrapper
0x00367350(registered byRegisterBindings); calls0x0011e120Camera_SetHudScale - Used by no script on the disc
- Coney: not implemented
CamSetSecondary¶
| # | Argument | Read as | Meaning |
|---|---|---|---|
| 1 | object |
number, truncated to an unsigned integer | Handle of the secondary target; NilHandle clears it. |
| 2 | range |
number (single precision) | A range value stored with it (scripts pass 0). |
| 3 | player |
number, truncated to an integer | Player index (default 0). |
Returns nothing.
Gives a player's follow camera a secondary target to keep in view alongside the player, in place of auto-follow: the camera yaws 35% of the excess per update (at most 270 degrees/s) whenever the target is more than a quarter of the field of view off centre (the tutorial points it at Vermin). A range above 0 limits it to targets within the range and in sight (Camera).
Notes. Stores the target at follow camera +0x320 and the range at +0x3fc (0 for NilHandle), and the target in the player's mugging camera (type 7) too.
- Evidence: confirmed (code) at
0x0011dcf0; detail: traced - Wrapper
0x003670c0(registered byRegisterBindings); calls0x0011dcf0Camera_SetFollowSecondary - Used by 7 of 467 script chunks (26 references); boot to menu: no; mission 1: yes; result used: no
- Later in the story: 4 of 28 levels, first
level2(mission 5) - Coney: implemented
CamSetSplitMode¶
| # | Argument | Read as | Meaning |
|---|---|---|---|
| 1 | mode |
number, truncated to an unsigned integer | 0 or 1: the two-player split-screen layout; other values are ignored. |
Returns nothing.
Sets the split-screen layout and re-lays out the views.
- Evidence: confirmed (code) at
0x0011e0a8; detail: brief - Wrapper
0x00367270(registered byRegisterBindings); calls0x0011e0a8Camera_SetSplitMode - Used by 3 of 467 script chunks (3 references); boot to menu: no; mission 1: no; result used: no
- Coney: implemented
CamSetupFollow¶
| # | Argument | Read as | Meaning |
|---|---|---|---|
| 1 | name |
string | Camera name. |
| 2 | target |
number, truncated to an unsigned integer | Handle of the human to follow (the player). |
Returns number: The follow camera's handle, or NilHandle when the target or camera is missing.
Puts the player's follow camera on a target, places it behind the target and returns its handle; used through global.lua's CameraCreateFollow. See Camera.
- Evidence: confirmed (code) at
0x0011bfa8; detail: traced - Wrapper
0x00365a48(registered byRegisterBindings); calls0x0011bfa8Camera_SetupFollow - Used by 1 of 467 script chunks (1 reference); boot to menu: yes; mission 1: yes; result used: yes
- Later in the story: 28 of 28 levels, first
level80(mission 2) - Coney: implemented
CamSetupHood¶
| # | Argument | Read as | Meaning |
|---|---|---|---|
| 1 | human |
number, truncated to an unsigned integer | Handle of the player human riding the vehicle; added to the camera targets (CameraTargets_Add). |
| 2 | vehicle |
number, truncated to an unsigned integer | Handle of the object the camera is mounted on (hood camera +0x1e0). |
| 3 | fov |
number (single precision) | Field of view in degrees (default 60). |
| 4 | lookOffset |
table of 3 numbers (t[1]..t[3]) | Offset {x, y, z} of the look-at point (+0x1f0); only z is used, as a height added to the players' average position. Default {0, 0, 1.53}; scripts pass zeros. |
| 5 | mountOffset |
table of 3 numbers (t[1]..t[3]) | Camera position {x, y, z} relative to the mount (+0x200), in metres: x along the mount's right, y along its forward, z up. Default {0, 0.3, 1.7}. |
| 6 | near |
number (single precision) | Near clip distance in metres (default 0.1). |
| 7 | far |
number (single precision) | Far clip distance in metres, capped at 150 (default 115). |
Returns number: Handle of player 0's hood camera, or NilHandle when either handle does not resolve.
Sets up the hood camera (type 11) for every player: each player's camera (made on first use by HoodCam_GetForPlayer, 0x0011ff50) is mounted on the vehicle at the mount offset and gets the lens values. Each update (HoodCam_Update, 0x00135138) places it on the mount (0x00134d78) and aims it at the average position of the live players raised by the look offset's z (0x00134f08). The camera is not made active; scripts follow with CameraMakeActive.
Notes. Both tables are read and written back unchanged. lookOffset x and y are stored but no reader was found. Each
update moves the field of view toward +0x214 (60, set only by the constructor 0x00134b90) by at most the frame step,
so a script's fov appears to drift back to 60° at about 1° a second (inferred from the step being in seconds).
- Evidence: confirmed (code) at
0x0011d808; detail: traced - Wrapper
0x003669b0(registered byRegisterBindings); calls0x0011d808HoodCam_Setup - Used by 2 of 467 script chunks (4 references); boot to menu: no; mission 1: no; result used: yes
- Later in the story: 2 of 28 levels, first
level51(mission 14) - Coney: not implemented
CamSetupPoizo¶
| # | Argument | Read as | Meaning |
|---|---|---|---|
| 1 | camera |
number, truncated to an unsigned integer | The camera the path starts from: its position and orientation become point 0, and its lens is the default. |
| 2 | seconds |
number (single precision) | Time in seconds to travel from that start view to the first point added with CamAddPoizoPoint. |
| 3 | onEnd |
string | Name of the Lua function called (with no arguments) when the path reaches its last point, or nil. |
| 4 | fov |
number (single precision) | Field of view in degrees for the path; 0 takes the start camera's. |
| 5 | far |
number (single precision) | Far clip distance in metres, capped at 150; 0 takes the start camera's. |
| 6 | human |
number, truncated to an unsigned integer; default 4294967295 | Optional player human: if camera is a follow, rail or hood camera of the other player, that kind of camera of this human's player is used as the start instead. |
Returns number: Handle of the path camera (type 3, one shared instance), or NilHandle if it could not be made.
Starts a scripted camera path (the Poizo camera, type 3) from an existing camera's view, clearing any earlier points.
Add up to seven more points with CamAddPoizoPoint / CamAddPoizoPointCam, then make the returned camera active
(CameraMakeActive): the camera flies through the points along a Catmull-Rom curve, turning by slerp between their
orientations, and calls onEnd at the last one.
Notes. Update PoizoCam_Update (0x001426c0) runs only while the camera is player 0's current camera and was
activated (+0x33c); it does not return to another camera by itself (only a reversed path, CamReversePoizo, blends back
to the start camera). At most 8 points (PoizoCam_AddPoint 0x00142a58); further points overwrite the last.
- Evidence: confirmed (code) at
0x0011c9e0,0x00142368; detail: traced - Wrapper
0x00366c80(registered byRegisterBindings); calls0x0011c9e0Camera_SetupPoizo,0x00142368CamSpline_Start - Used by 7 of 467 script chunks (7 references); boot to menu: no; mission 1: no; result used: yes
- Later in the story: 6 of 28 levels, first
level87(mission 3) - Coney: implemented
CamSetupRail¶
| # | Argument | Read as | Meaning |
|---|---|---|---|
| 1 | name |
string | Camera name. |
| 2 | target |
number, truncated to an unsigned integer | Handle of the human to follow; a bad handle makes nothing and returns NilHandle. |
| 3 | fov |
number (single precision) | Field of view in degrees. |
| 4 | offset |
table of 3 numbers (t[1]..t[3]) | Look-at offset {x, y, z} in metres from the target (+0x320); its z is also the starting value of CamModifyRail setting 9. Written back unchanged. |
| 5 | near |
number (single precision) | Near clip distance in metres. |
| 6 | far |
number (single precision) | Far clip distance in metres, at most 150. |
| 7 | player |
number, truncated to an integer; default -1 | Player index (0 or 1); -1 (default) sets up player 0's rail camera with the name and target and copies the other settings to every other player's. |
Returns number: The handle of the player's rail camera (player 0's for -1), or NilHandle.
Gets (making it on first use) a player's rail camera (type 9, one per player) and sets it up: name, target, field of view, offset, near and far planes. It also resets the rail: no points, mode 0, the distance, height and angle settings off and the field-of-view target to the new value. Add the rail's points with CamAddRailPoint, then make it current with CameraMakeActive.
Notes. The reset (0x0013b2b8) also sets the globals 0x0050b2ac and 0x0050b2b0 to 1 (0x0050b2ac lets the leading rail modes push the camera off the rail by the lead; 0x0050b2b0 not traced). The lead (CamLeadRail) is not reset. Cameras: the list.
- Evidence: confirmed (code) at
0x0011cce8,0x0011fbb0,0x0013b2b8; detail: traced - Wrapper
0x00366518(registered byRegisterBindings); calls0x0011cce8Camera_SetupRail,0x0011fbb0Camera_GetPlayerRail,0x0013b2b8CamRail_Reset - Used by 27 of 467 script chunks (48 references); boot to menu: no; mission 1: no; result used: yes
- Later in the story: 19 of 28 levels, first
level2(mission 5) - Coney: implemented
CamTarget¶
| # | Argument | Read as | Meaning |
|---|---|---|---|
| 1 | mode |
number, truncated to an unsigned integer | 0 add the human to the camera target list, 1 remove it, 2 clear the list. |
| 2 | camera |
number, truncated to an unsigned integer | Camera handle; read but not used. |
| 3 | human |
number, truncated to an unsigned integer | Handle of the human to add or remove (ignored for mode 2). |
Returns boolean (1 for true, nil for false): true (1) when the list changed (always for modes 1 and 2), nil when the human was missing or the list (at most 4) was full.
Edits the shared list of humans the cameras follow (at 0x005d91a8): the players. A follow camera takes its targets from the first two entries and keeps its last target when the list is empty, so with one player removing and re-adding him (level99_lesson1) changes nothing (Camera).
- Evidence: confirmed (code) at
0x0011c270; detail: traced - Wrapper
0x00365ad8(registered byRegisterBindings); calls0x0011c270Camera_TargetList - Used by 42 of 467 script chunks (214 references); boot to menu: no; mission 1: yes; result used: no
- Later in the story: 6 of 28 levels, first
level5(mission 7) - Coney: implemented
CamUseDeathCamera¶
| # | Argument | Read as | Meaning |
|---|---|---|---|
| 1 | human |
number, truncated to an unsigned integer | Handle of the human who died. |
| 2 | ms |
number, truncated to an unsigned integer; default 6500 | Milliseconds: the screen tint blends to dark red (0xd0000014) over this time, and the blur, once it starts, rises over it. |
| 3 | ms2 |
number, truncated to an unsigned integer; default 1500 | Milliseconds before the blur pulse starts rising (Rumble Survival's 100000 means no blur in practice). |
Returns nothing.
Cuts player 1 to the death camera (Cam_Failed, type 12) looking straight down on human, the same shot the game over
uses with (6500, 1500): saves the current camera, tint and HUD state, blends player 1's screen tint to dark red over
ms, arms a blur that starts after ms2, hides the HUD and removes every player's and the human's overhead icon. It
stops no one. Nothing returns to the old camera: the script makes another camera active, and the HUD and tint are
restored only by the mission-failed menu's checkpoint retry.
Notes. 0x0011daa8. The activation picks a target (last target or nearer player) but CamFailed_SetTarget(human) then overrides it. It also sets 0x0050b1e8 = 1 and 0x0050b1ec = 0 (player 1's view on, player 2's off) until Cameras_DecideViews next sets them. camera.md#death-camera.
- Evidence: confirmed (code) at
0x0011daa8; detail: traced - Wrapper
0x00366bd8(registered byRegisterBindings); calls0x0011daa8Camera_UseDeathCamera - Used by 33 of 467 script chunks (33 references); boot to menu: no; mission 1: no; result used: no
- Coney: not implemented