camCommit: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "\[\[([a-zA-Z][a-zA-Z0-9_]+)\]\]([^ ]*)<\/code>" to "$1$2</code>")
m (Some wiki formatting)
Line 38: Line 38:
|r1= [[Nothing]]
|r1= [[Nothing]]


|x1= '''[[SQS Syntax|SQS]]'''<code>; create a camera object
|x1= '''[[SQS Syntax|SQS]]''':
<code>{{codecomment|; create a camera object}}
_cam = "camera" [[camCreate]] [5600,4800,10]
_cam = "camera" [[camCreate]] [5600,4800,10]
_cam [[camSetTarget]] [[player]]
_cam [[camSetTarget]] [[player]]
Line 44: Line 45:
_cam [[camCommit]] 0
_cam [[camCommit]] 0


<nowiki>;</nowiki> smoothly move the camera to its new position in 6 seconds
{{codecomment|; smoothly move the camera to its new position in 6 seconds}}
_cam [[camSetPos]] [5680,4720,20]
_cam [[camSetPos]] [5680,4720,20]
_cam [[camCommit]] 6
_cam [[camCommit]] 6
@[[camCommitted]] _cam
@[[camCommitted]] _cam


<nowiki>;</nowiki> proceed</code>
{{codecomment|; proceed}}</code>


|x2= '''[[SQF Syntax|SQF]]'''<code>[[private]] "_cam";
|x2= '''[[SQF Syntax|SQF]]''':
<sqf>
private "_cam";


[[comment]] "create a camera object";
comment "create a camera object";
_cam = "camera" [[camCreate]] [<nowiki/>[[position]] [[player]] [[select]] 0, [[position]] [[player]] [[select]] 1, 2];
_cam = "camera" camCreate [position player select 0, position player select 1, 2];
_cam [[camSetTarget]] [[player]];
_cam camSetTarget player;
_cam [[cameraEffect]] ["internal", "BACK"];
_cam cameraEffect ["internal", "BACK"];
_cam [[camCommit]] 0;
_cam camCommit 0;


[[comment]] "smoothly move the camera to its new position in 6 seconds";
comment "smoothly move the camera to its new position in 6 seconds";
_cam [[camSetPos]] [<nowiki/>[[position]] [[player]] [[select]] 0, ([[position]] [[player]] [[select]] 1) + 10, 20];
_cam camSetPos [position player select 0, (position player select 1) + 10, 20];
_cam [[camCommit]] 6;
_cam camCommit 6;
waitUntil { camCommitted _cam; };</code>
waitUntil { camCommitted _cam; };
</sqf>


|seealso= [[camCommitted]] [[camCommitPrepared]]
|seealso= [[camCommitted]] [[camCommitPrepared]]
}}
}}

Revision as of 15:08, 13 May 2022

Hover & click on the images for description

Description

Description:
Smoothly conduct the changes that were assigned to a camera within the given time. If the time is set to zero, the changes are done immediately. For camPrepareXXX commands use camCommitPrepared.
Groups:
Camera Control

Syntax

Syntax:
camera camCommit time
Parameters:
camera: Object - object of type "camera"
time: Number - time in seconds during which the changes shall be done
Return Value:
Nothing

Examples

Example 1:
SQS: ; create a camera object _cam = "camera" camCreate [5600,4800,10] _cam camSetTarget player _cam cameraEffect ["internal", "BACK"] _cam camCommit 0 ; smoothly move the camera to its new position in 6 seconds _cam camSetPos [5680,4720,20] _cam camCommit 6 @camCommitted _cam ; proceed
Example 2:
SQF:
private "_cam"; comment "create a camera object"; _cam = "camera" camCreate [position player select 0, position player select 1, 2]; _cam camSetTarget player; _cam cameraEffect ["internal", "BACK"]; _cam camCommit 0; comment "smoothly move the camera to its new position in 6 seconds"; _cam camSetPos [position player select 0, (position player select 1) + 10, 20]; _cam camCommit 6; waitUntil { camCommitted _cam; };

Additional Information

See also:
camCommitted camCommitPrepared

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note