camPreload: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "<code>([^<]*)\[\[([a-zA-Z][a-zA-Z0-9_]+)\]\]([^<]*) *<\/code>" to "<code>$1$2$3</code>")
m (Text replacement - "\{\{Feature *\| *Informative *\| ([^↵]+) *\}\}" to "{{Feature|informative|$1}}")
 
(12 intermediate revisions by the same user not shown)
Line 18: Line 18:
|gr1= Camera Control
|gr1= Camera Control


|descr= Preloads the scene for the prepared camera with given timeout after which preloading is aborted. Max timeout is 30 seconds. Timeout of 0 means max timeout of 30 seconds as well. {{Feature | Informative | This command will read prepared params set with [[camPrepareFOV]], [[camPreparePos]] and [[camPrepareTarget]], so no [[camCommitPrepared]] is necessary. If [[camPrepareFOV]] is not set, the default value is 1. If [[camPrepareTarget]] (for direction) and [[camPreparePos]] (for position) are not set, current [[direction]] and [[position]] of the camera are used. The prepared camera preload will preload main camera as well. [[cameraEffect]] is not necessary}}
|descr= Preloads the scene for the prepared camera with given timeout after which preloading is aborted. Max timeout is 30 seconds. Timeout of 0 means max timeout of 30 seconds as well. {{Feature|informative|This command will read prepared params set with [[camPrepareFOV]], [[camPreparePos]] and [[camPrepareTarget]], so no [[camCommitPrepared]] is necessary. If [[camPrepareFOV]] is not set, the default value is 1. If [[camPrepareTarget]] (for direction) and [[camPreparePos]] (for position) are not set, current [[direction]] and [[position]] of the camera are used. The prepared camera preload will preload main camera as well. [[cameraEffect]] is not necessary}}


|s1= camera [[camPreload]] timeout
|s1= camera [[camPreload]] timeout
Line 28: Line 28:
|r1= [[Nothing]]
|r1= [[Nothing]]


|x1= <code>_camera '''camPreload''' 5</code>
|x1= <sqf>_camera camPreload 5;</sqf>
|x2= Preload camera around player to avoid stuttering on optics zooming:
|x2= Preload camera around player to avoid stuttering on optics zooming:
<code>[] spawn  
<sqf>[] spawn  
{
{
_cam = "camera" camCreate (player selectionPosition "camera");
_cam = "camera" camCreate (player selectionPosition "camera");
[[for]] "_i" [[from]] 0 [[to]] 359 [[do]]
for "_i" from 0 to 359 do
{
{
_cam [[setDir]] _i;
_cam setDir _i;
_cam [[camPrepareFov]] 0.25;
_cam camPrepareFov 0.25;
_cam [[camPreload]] 0;
_cam camPreload 0;
[[waitUntil]] { [[camPreloaded]] _cam };
waitUntil { camPreloaded _cam };
};
};
[[camDestroy]] _cam;
camDestroy _cam;
};</code>
};</sqf>


|seealso= [[camPreloaded]] [[preloadCamera]]
|seealso= [[camPreloaded]] [[preloadCamera]]
}}
}}

Latest revision as of 19:11, 15 March 2024

Hover & click on the images for description

Description

Description:
Preloads the scene for the prepared camera with given timeout after which preloading is aborted. Max timeout is 30 seconds. Timeout of 0 means max timeout of 30 seconds as well.
This command will read prepared params set with camPrepareFOV, camPreparePos and camPrepareTarget, so no camCommitPrepared is necessary. If camPrepareFOV is not set, the default value is 1. If camPrepareTarget (for direction) and camPreparePos (for position) are not set, current direction and position of the camera are used. The prepared camera preload will preload main camera as well. cameraEffect is not necessary
Groups:
Camera Control

Syntax

Syntax:
camera camPreload timeout
Parameters:
camera: Object
timeout: Number
Return Value:
Nothing

Examples

Example 1:
_camera camPreload 5;
Example 2:
Preload camera around player to avoid stuttering on optics zooming:
[] spawn { _cam = "camera" camCreate (player selectionPosition "camera"); for "_i" from 0 to 359 do { _cam setDir _i; _cam camPrepareFov 0.25; _cam camPreload 0; waitUntil { camPreloaded _cam }; }; camDestroy _cam; };

Additional Information

See also:
camPreloaded preloadCamera

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