camPreload: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
mNo edit summary
m (Text replacement - "<sqf>([^↵][^\/]*↵[^\/]*)<\/sqf>" to "<sqf> $1 </sqf>")
 
(60 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Command|Comments=
{{RV|type=command
____________________________________________________________________________________________


| arma |Game name=
|game1= arma1
|version1= 1.00


|1.00|Game version=
|game2= arma2
____________________________________________________________________________________________
|version2= 1.00


| 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. <br><br>{{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}} |DESCRIPTION=
|game3= arma2oa
____________________________________________________________________________________________
|version3= 1.50


| camera '''camPreload''' timeout |SYNTAX=
|game4= tkoh
|version4= 1.00


|p1= camera: [[Object]] |PARAMETER1=
|game5= arma3
|version5= 0.50


|p2= timeout: [[Number]] |PARAMETER2=
|gr1= Camera Control


| [[Nothing]] |RETURNVALUE=
|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}}
____________________________________________________________________________________________
 
|x1= <code> _camera '''camPreload''' 5 </code> |EXAMPLE1=
|x2= Preload camera around player to avoid stuttering on optics zooming: <code>[] [[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;
};</code>|EXAMPLE2=
____________________________________________________________________________________________


| [[camPreloaded]], [[preloadCamera]] |SEEALSO=
|s1= camera [[camPreload]] timeout


}}
|p1= camera: [[Object]]


<h3 style="display:none">Notes</h3>
|p2= timeout: [[Number]]
<dl class="command_description">


<!-- Note Section BEGIN -->
|r1= [[Nothing]]


<!-- Note Section END -->
|x1= <sqf>_camera camPreload 5;</sqf>
</dl>
|x2= Preload camera around player to avoid stuttering on optics zooming:
<sqf>
0 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;
};
</sqf>


<h3 style="display:none">Bottom Section</h3>
|seealso= [[camPreloaded]] [[preloadCamera]]
 
}}
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands ArmA|{{uc:{{PAGENAME}}}}]]
[[Category:Command_Group:_Camera_Control|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands ArmA2|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting_Commands_Take_On_Helicopters|{{uc:{{PAGENAME}}}}]]

Latest revision as of 11:28, 3 September 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:
0 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