Skip to content

Commit

Permalink
tweak(natives/camera): Update RENDER_SCRIPT_CAMS and rename 4th argum…
Browse files Browse the repository at this point in the history
…ent (#1146)

* feat(docs/natives/RENDER_SCRIPT_CAMS): Renamed and explained the 4th parameter.

* fix(docs/natives/RENDER_SCRIPT_CAMS): Fixed the position of the added parameter

* fix(docs/natives/RENDER_SCRIPT_CAMS):

* tweak(docs/naitve/RENDER_SCRIPT_CAMS): added suggestion

Co-authored-by: Dillon Skaggs <[email protected]>

* Update CAM/RenderScriptCams.md

Co-authored-by: Dillon Skaggs <[email protected]>

* Update CAM/RenderScriptCams.md

Co-authored-by: Dillon Skaggs <[email protected]>

---------

Co-authored-by: Dillon Skaggs <[email protected]>
  • Loading branch information
koketoo and AvarianKnight authored Aug 6, 2024
1 parent aa85a00 commit d5e868e
Showing 1 changed file with 34 additions and 13 deletions.
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)
```

0 comments on commit d5e868e

Please sign in to comment.