Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(docs/natives/RENDER_SCRIPT_CAMS): Renamed and explained the 4th … #1146

Merged
merged 6 commits into from
Aug 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 34 additions & 13 deletions CAM/RenderScriptCams.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,46 @@ ns: CAM

```c
// 0x07E5B515DB0636FC 0x74337969
void RENDER_SCRIPT_CAMS(BOOL render, BOOL ease, int easeTime, BOOL p3, BOOL p4);
void RENDER_SCRIPT_CAMS(BOOL render, BOOL ease, int easeTime, BOOL easeCoordsAnim, BOOL p4);
```

```
ease - smooth transition between the camera's positions
easeTime - Time in milliseconds for the transition to happen
If you have created a script (rendering) camera, and want to go back to the
character (gameplay) camera, call this native with render set to 0.
Setting ease to 1 will smooth the transition.
```
Renders the camera previously created with [CREATE_CAM](#_0xC3981DCE61D9E13F) or [CREATE_CAMERA](#_0x5E3CF89C6BCCA67D)

```
NativeDB Added Parameter 6: Any p5
```

## Parameters
* **render**:
* **ease**:
* **easeTime**:
* **p3**:
* **p4**:
* **render**: Whether to render the cams or not.
* **ease**: If true it will make a smooth transition between the current camera and the new rendered camera.
* **easeTime**: The in milliseconds for the transition to happen.
* **easeCoordsAnim**: If false it will only do the smooth transition to the rotation and the coords will be set instantly.
* **p4**: Doesn't seem to change anything.

## Examples
```lua
local casino = vector3(881.31, 74.71, 94.43)

-- Create the camera that will be used for RenderScriptCams
local cam = CreateCam("DEFAULT_SCRIPTED_CAMERA", true)
-- Set the camera coordinates to be in front of the Casino
SetCamCoord(cam, casino.x, casino.y, casino.z)
-- Rotate the camera towards the casino
SetCamRot(cam, -25.0, 0.0, -124.22)

-- Render the camera and so a smooth transition for 2000ms
RenderScriptCams(true, true, 2000, false, true)

-- tell the game to load maps, collisions, objects, etc around the casino.
SetFocusPosAndVel(casino.x, casino.y, casino.z, 0.0, 0.0, 0.0)

-- We wait 5 seconds + 2 extra for the transition
Wait(7000)
-- Remove the cam, we no longer need it
DestroyCam(cam)

-- reset streaming focus to be at the local player ped
ClearFocus()
-- Stop rendering the script camera and interpolate back to their player ped
RenderScriptCams(false, true, 2000, false, false)
```
Loading