cameraEffect: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - "|= Game name" to "|Game name=") |
Lou Montana (talk | contribs) m (Text replacement - "\|s([0-9])\= ([^' ]+)'''([^' ]+)'''([^ ]*) " to "|s$1= $2$3$4 ") |
||
(36 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{ | {{RV|type=command | ||
| ofp | | |game1= ofp | ||
|version1= 1.00 | |||
|1.00 | |game2= ofpe | ||
|version2= 1.00 | |||
| | |game3= arma1 | ||
|version3= 1.00 | |||
| | |game4= arma2 | ||
|version4= 1.00 | |||
| Sets the given effect on the given camera. If you want to switch the screen directly to the first-person, aiming, third-person or group view of an object, use [[switchCamera]] instead. The effect type "Terminate" is used to exit the current camera view and switch back to the player's view. Does not need [[camCommit]]. | |game5= arma2oa | ||
|version5= 1.50 | |||
|game6= tkoh | |||
|version6= 1.00 | |||
|game7= arma3 | |||
|version7= 0.50 | |||
|gr1= Camera Control | |||
|arg= local | |||
|eff= local | |||
|descr= Sets the given effect on the given camera. If you want to switch the screen directly to the first-person, aiming, third-person or group view of an object, use [[switchCamera]] instead. The effect type "Terminate" is used to exit the current camera view and switch back to the player's view. Does not need [[camCommit]]. | |||
<br><br> | <br><br> | ||
Since Arma 3 v1. | Since Arma 3 v1.74, it is possible to terminate individual r2t source. For example: <code>cam [[cameraEffect]] ["terminate", "back", "rtt1"]; // would terminate "rtt1" r2t source | ||
cam [[cameraEffect]] ["terminate", "back"]; // would terminate all r2t sources</code><br> | cam [[cameraEffect]] ["terminate", "back"]; // would terminate all r2t sources</code><br> | ||
{{ | {{Feature | important | One cannot mix and match [[cameraEffect]] and can either have multiple [[r2t]] cameras or a single camera for the whole screen. If one needs a background stream overlayed with [[r2t]] streams, this could be achieved by creating an object and using [[switchCamera]] to switch to it for background image, while using [[cameraEffect]] for [[r2t]] overlay (see Example 4)}} | ||
|s1= camera [[cameraEffect]] [effectName, effectPosition, r2tName] | |||
| camera | |p1= camera: [[Object]] - object of type "camera" | ||
| | |p2= [effectName, effectPosition, r2tName]: [[Array]] | ||
| | |p3= effectName: [[String]] - the effect type (defined in main config or [[Description.ext#CfgCameraEffects|CfgCameraEffects]] >> Array). Defaults are: <tt>"Internal"</tt>, <tt>"External"</tt>, <tt>"Fixed"</tt>, <tt>"FixedWithZoom"</tt>, <tt>"Terminate"</tt> | ||
| | |p4= effectPosition: [[String]] - position of the effect. One of: <tt>"TOP"</tt>, <tt>"LEFT"</tt>, <tt>"RIGHT"</tt>, <tt>"FRONT"</tt>, <tt>"BACK"</tt>, <tt>"LEFT FRONT"</tt>, <tt>"RIGHT FRONT"</tt>, <tt>"LEFT BACK"</tt>, <tt>"RIGHT BACK"</tt>, <tt>"LEFT TOP"</tt>, <tt>"RIGHT TOP"</tt>, <tt>"FRONT TOP"</tt>, <tt>"BACK TOP"</tt>, <tt>"BOTTOM"</tt>. These are usually used with "Fixed" and "FixedWithZoom" effect types. If not sure which position to use, set it to "BACK"; | ||
| | |p5= r2tName (Optional): [[String]] - [[Procedural_Textures#Render_To_Texture|Render To Texture]] surface reference | ||
| | |r1=[[Nothing]] | ||
|x1= <code>_cam [[cameraEffect]] ["internal", "BACK"];</code> | |||
|x2= <code>_cam [[cameraEffect]] ["internal", "back", "rendersurface"];</code> | |||
|x1= <code>_cam [[cameraEffect]] ["internal", "BACK"];</code> | |||
|x2= <code>_cam [[cameraEffect]] ["internal", "back", "rendersurface"];</code> | |||
|x3= <code>cam = "seagull" [[camCreate]] ([[player]] [[modelToWorld]] [0,0,100]); | |x3= <code>cam = "seagull" [[camCreate]] ([[player]] [[modelToWorld]] [0,0,100]); | ||
cam [[cameraEffect]] ["FIXED", "LEFT TOP"]; | cam [[cameraEffect]] ["FIXED", "LEFT TOP"]; | ||
cam [[camCommand]] "MANUAL ON";</code> | cam [[camCommand]] "MANUAL ON";</code> | ||
|x4= <code>_ctrl = [[findDisplay]] 46 [[createDisplay]] "RscDisplayEmpty" [[ctrlCreate]] ["RscPicture", -1]; | |x4= <code>_ctrl = [[findDisplay]] 46 [[createDisplay]] "RscDisplayEmpty" [[ctrlCreate]] ["RscPicture", -1]; | ||
_ctrl [[ctrlSetPosition]] [0.5, 0, 0.5, 0.5]; | _ctrl [[ctrlSetPosition]] [0.5, 0, 0.5, 0.5]; | ||
Line 48: | Line 63: | ||
_cam2 [[setPos]] ([[ASLtoAGL]] [[eyePos]] [[player]] [[vectorAdd]] [0, 10, 0]); | _cam2 [[setPos]] ([[ASLtoAGL]] [[eyePos]] [[player]] [[vectorAdd]] [0, 10, 0]); | ||
_cam2 [[setDir]] (_cam2 [[getDir]] [[player]]); | _cam2 [[setDir]] (_cam2 [[getDir]] [[player]]); | ||
[[switchCamera]] _cam2;</code> | [[switchCamera]] _cam2;</code> | ||
| [[switchCamera]], [[cameraView]], [[cameraOn]], [[setPiPEffect]], [[camCreate]], [[cameraEffectEnableHUD]], [[camUseNVG]], [[setCamUseTI]] | |seealso= [[switchCamera]], [[cameraView]], [[cameraOn]], [[setPiPEffect]], [[camCreate]], [[cameraEffectEnableHUD]], [[camUseNVG]], [[setCamUseTI]] | ||
}} | |||
<dl class="command_description"> | <dl class="command_description"> | ||
< | <dt></dt> | ||
<dd class="notedate">Posted on October 30, 2016 - 16:40 (UTC)</dd> | <dd class="notedate">Posted on October 30, 2016 - 16:40 (UTC)</dd> | ||
<dt class="note">[[User:Killzone Kid|Killzone Kid]]</dt> | <dt class="note">[[User:Killzone Kid|Killzone Kid]]</dt> | ||
Line 87: | Line 83: | ||
* CamInternal <tt>type <nowiki>=</nowiki> 5;</tt> // internal view | * CamInternal <tt>type <nowiki>=</nowiki> 5;</tt> // internal view | ||
</dd> | </dd> | ||
</dl> | </dl> | ||
Revision as of 18:01, 20 June 2021
Description
- Description:
- Sets the given effect on the given camera. If you want to switch the screen directly to the first-person, aiming, third-person or group view of an object, use switchCamera instead. The effect type "Terminate" is used to exit the current camera view and switch back to the player's view. Does not need camCommit.
Since Arma 3 v1.74, it is possible to terminate individual r2t source. For example:cam cameraEffect ["terminate", "back", "rtt1"]; // would terminate "rtt1" r2t source cam cameraEffect ["terminate", "back"]; // would terminate all r2t sources
- Groups:
- Camera Control
Syntax
- Syntax:
- camera cameraEffect [effectName, effectPosition, r2tName]
- Parameters:
- camera: Object - object of type "camera"
- [effectName, effectPosition, r2tName]: Array
- effectName: String - the effect type (defined in main config or CfgCameraEffects >> Array). Defaults are: "Internal", "External", "Fixed", "FixedWithZoom", "Terminate"
- effectPosition: String - position of the effect. One of: "TOP", "LEFT", "RIGHT", "FRONT", "BACK", "LEFT FRONT", "RIGHT FRONT", "LEFT BACK", "RIGHT BACK", "LEFT TOP", "RIGHT TOP", "FRONT TOP", "BACK TOP", "BOTTOM". These are usually used with "Fixed" and "FixedWithZoom" effect types. If not sure which position to use, set it to "BACK";
- r2tName (Optional): String - Render To Texture surface reference
- Return Value:
- Nothing
Examples
- Example 1:
_cam cameraEffect ["internal", "BACK"];
- Example 2:
_cam cameraEffect ["internal", "back", "rendersurface"];
- Example 3:
cam = "seagull" camCreate (player modelToWorld [0,0,100]); cam cameraEffect ["FIXED", "LEFT TOP"]; cam camCommand "MANUAL ON";
- Example 4:
_ctrl = findDisplay 46 createDisplay "RscDisplayEmpty" ctrlCreate ["RscPicture", -1]; _ctrl ctrlSetPosition [0.5, 0, 0.5, 0.5]; _ctrl ctrlSetText "#(argb,512,512,1)r2t(rtt1,1.0)"; _ctrl ctrlCommit 0; _cam1 = "camera" camCreate (ASLtoAGL eyePos player vectorAdd [0, -10, 0]); _cam1 cameraEffect ["Internal", "Back", "rtt1"]; _cam2 = "Land_HandyCam_F" createVehicle [0,0,0]; _cam2 enableSimulation false; _cam2 setPos (ASLtoAGL eyePos player vectorAdd [0, 10, 0]); _cam2 setDir (_cam2 getDir player); switchCamera _cam2;
Additional Information
- See also:
- switchCameracameraViewcameraOnsetPiPEffectcamCreatecameraEffectEnableHUDcamUseNVGsetCamUseTI
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
- Posted on October 30, 2016 - 16:40 (UTC)
- Killzone Kid
-
Types of camera for CfgCameraEffects config:
- CamExternal (CamInterpolated) type = 0; // linked directly with object
- CamStatic type = 1; // fixed point in space
- CamStaticWithZoom type = 2; // fixed point in space
- CamChained type = 3; // chained
- CamTerminate type = 4; // terminate
- CamInternal type = 5; // internal view
Categories:
- Scripting Commands
- Introduced with Operation Flashpoint version 1.00
- Operation Flashpoint: New Scripting Commands
- Operation Flashpoint: Scripting Commands
- Operation Flashpoint: Elite: Scripting Commands
- ArmA: Armed Assault: Scripting Commands
- Arma 2: Scripting Commands
- Arma 2: Operation Arrowhead: Scripting Commands
- Take On Helicopters: Scripting Commands
- Arma 3: Scripting Commands
- Command Group: Camera Control
- Scripting Commands: Local Effect