BIS fnc playVideo: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "|= Effects in MP " to "|MPEffects=")
Line 1: Line 1:
{{Function|=
{{Function|Comments=
____________________________________________________________________________________________
____________________________________________________________________________________________


| arma2oa |Game name=
| arma2oa |Game name=


|1.56|=
|1.56|Game version=


|arg= |MPARGUMENTS=  
|arg= |MPARGUMENTS=  


|eff= local |MPEffects=____________________________________________________________________________________________
|eff= local |MPEffects=
____________________________________________________________________________________________


| Plays in-game video with a range of options. The function can be [[call]]ed or [[spawn]]ed. If [[spawn]]ed, [[scriptDone]] command can be used to see if video is stopped or finished. If [[call]]ed in scheduled environment, the next line of code will not process until the video is stopped or finished. <br><br>
| Plays in-game video with a range of options. The function can be [[call]]ed or [[spawn]]ed. If [[spawn]]ed, [[scriptDone]] command can be used to see if video is stopped or finished. If [[call]]ed in scheduled environment, the next line of code will not process until the video is stopped or finished.<br><br>
The function also calls "BIS_fnc_playVideo_started" and "BIS_fnc_playVideo_stopped" Scripted Event Handlers in [[missionNamespace]] (see [[BIS_fnc_addScriptedEventHandler]])<br><br>
The function also calls "BIS_fnc_playVideo_started" and "BIS_fnc_playVideo_stopped" Scripted Event Handlers in [[missionNamespace]] (see [[BIS_fnc_addScriptedEventHandler]])<br><br>
The video can be stopped in variety of ways:
The video can be stopped in variety of ways:
Line 17: Line 18:
* Default variable "BIS_fnc_playVideo_skipVideo" is set to [[true]]: <code>[[missionNamespace]] [[setVariable]] ["BIS_fnc_playVideo_skipVideo", [[true]]];</code>
* Default variable "BIS_fnc_playVideo_skipVideo" is set to [[true]]: <code>[[missionNamespace]] [[setVariable]] ["BIS_fnc_playVideo_skipVideo", [[true]]];</code>
* Custom (skipVarName if defined) variable is set to [[true]]: <code>[[missionNamespace]] [[setVariable]] ["MyCustomSkipVar", [[true]]];</code>
* Custom (skipVarName if defined) variable is set to [[true]]: <code>[[missionNamespace]] [[setVariable]] ["MyCustomSkipVar", [[true]]];</code>
When using skip variable do not forget to reset it to [[nil]] or set it to [[false]] after use. To play video in object, like monitor screen, set it as texture on the object, move UI screen away and start playback (see Example 3) |=
When using skip variable do not forget to reset it to [[nil]] or set it to [[false]] after use. To play video in object, like monitor screen, set it as texture on the object, move UI screen away and start playback (see Example 3) |Description=
____________________________________________________________________________________________
____________________________________________________________________________________________


| [content, size, color, skipVarName, bgColor, keepAspect] spawn '''BIS_fnc_playVideo'''  |=
| [content, size, color, skipVarName, bgColor, keepAspect] spawn [[BIS_fnc_playVideo]] |Syntax=


|p1= content: [[String]] - Full path to .ogv file |Parameter1=
|p1= content: [[String]] - Full path to .ogv file |Parameter1=
|p2= size (Optional): [[Array]] - Screen size in format [x, y, w, h]. Default: <nowiki>[</nowiki>[[safeZoneX]], [[safeZoneY]], [[safeZoneW]], [[safeZoneH]]]|Parameter2=


|p3= color (Optional): [[Array]] - Foreground color in format [r, g, b, a]. Default: [1,1,1,1] |=  
|p2= size (Optional): [[Array]] - Screen size in format [x, y, w, h]. Default: <nowiki>[</nowiki>[[safeZoneX]], [[safeZoneY]], [[safeZoneW]], [[safeZoneH]]] |Parameter2=
|p4= skipVarName (Optional): [[String]] - [[missionNamespace]] variable to skip the video when variable is [[true]]. Default: "BIS_fnc_playVideo_skipVideo" |=  
 
|p5= bgColor (Optional): [[Array]] - Background color in format [r, g, b, a]. Default: [0,0,0,1] |=
|p3= color (Optional): [[Array]] - Foreground color in format [r, g, b, a]. Default: [1,1,1,1] |Parameter3=  
|p6= keepAspect (Optional): [[Boolean]] - [[true]] to keep original video aspect ratio (background color will fill the void), [[false]] to stretch. Default: [[true]] |=  
 
|p4= skipVarName (Optional): [[String]] - [[missionNamespace]] variable to skip the video when variable is [[true]]. Default: "BIS_fnc_playVideo_skipVideo" |Parameter4=
 
|p5= bgColor (Optional): [[Array]] - Background color in format [r, g, b, a]. Default: [0,0,0,1] |Parameter5=
 
|p6= keepAspect (Optional): [[Boolean]] - [[true]] to keep original video aspect ratio (background color will fill the void), [[false]] to stretch. Default: [[true]] |Parameter6=


| [[Boolean]] - [[true]] |RETURNVALUE=
| [[Boolean]] - [[true]] |RETURNVALUE=


|x1= <code>_video = ["A3\Missions_F_EPA\video\A_in_intro.ogv"] [[spawn]] [[BIS_fnc_playVideo]];</code>|EXAMPLE1=
|x1= <code>_video = ["A3\Missions_F_EPA\video\A_in_intro.ogv"] [[spawn]] [[BIS_fnc_playVideo]];</code>|EXAMPLE1=
|x2= <code>_video = ["\a3\missions_f_exp\video\exp_m04_v01.ogv"] [[call]] [[BIS_fnc_playVideo]];</code>|EXAMPLE1=
 
|x2= <code>_video = ["\a3\missions_f_exp\video\exp_m04_v01.ogv"] [[call]] [[BIS_fnc_playVideo]];</code>|EXAMPLE2=
 
|x3= <code>_video = "a3\missions_f_exp\video\exp_m07_vout.ogv";
|x3= <code>_video = "a3\missions_f_exp\video\exp_m07_vout.ogv";
_screen = "Land_TripodScreen_01_large_F" [[createVehicle]] ([[player]] [[modelToWorld]] [0,10,0]);
_screen = "Land_TripodScreen_01_large_F" [[createVehicle]] ([[player]] [[modelToWorld]] [0,10,0]);
_screen [[setObjectTexture]] [0, _video];
_screen [[setObjectTexture]] [0, _video];
[_video, [10, 10]] [[call]] [[BIS_fnc_playVideo]];</code>|=
[_video, [10, 10]] [[call]] [[BIS_fnc_playVideo]];</code>|Example3=
____________________________________________________________________________________________
____________________________________________________________________________________________


| [[Functions Library]] |SEEALSO=  
| [[Functions Library]] |SEEALSO=


|  |MPBEHAVIOUR=  
|  |MPBEHAVIOUR=
____________________________________________________________________________________________
}}
}}



Revision as of 13:09, 3 September 2019

Hover & click on the images for description

Description

Description:
Plays in-game video with a range of options. The function can be called or spawned. If spawned, scriptDone command can be used to see if video is stopped or finished. If called in scheduled environment, the next line of code will not process until the video is stopped or finished.

The function also calls "BIS_fnc_playVideo_started" and "BIS_fnc_playVideo_stopped" Scripted Event Handlers in missionNamespace (see BIS_fnc_addScriptedEventHandler)

The video can be stopped in variety of ways: When using skip variable do not forget to reset it to nil or set it to false after use. To play video in object, like monitor screen, set it as texture on the object, move UI screen away and start playback (see Example 3)
Execution:
call
Groups:
Uncategorised

Syntax

Syntax:
[content, size, color, skipVarName, bgColor, keepAspect] spawn BIS_fnc_playVideo
Parameters:
content: String - Full path to .ogv file
size (Optional): Array - Screen size in format [x, y, w, h]. Default: [safeZoneX, safeZoneY, safeZoneW, safeZoneH]
color (Optional): Array - Foreground color in format [r, g, b, a]. Default: [1,1,1,1]
skipVarName (Optional): String - missionNamespace variable to skip the video when variable is true. Default: "BIS_fnc_playVideo_skipVideo"
bgColor (Optional): Array - Background color in format [r, g, b, a]. Default: [0,0,0,1]
keepAspect (Optional): Boolean - true to keep original video aspect ratio (background color will fill the void), false to stretch. Default: true
Return Value:
Boolean - true

Examples

Example 1:
_video = ["A3\Missions_F_EPA\video\A_in_intro.ogv"] spawn BIS_fnc_playVideo;
Example 2:
_video = ["\a3\missions_f_exp\video\exp_m04_v01.ogv"] call BIS_fnc_playVideo;
Example 3:
_video = "a3\missions_f_exp\video\exp_m07_vout.ogv"; _screen = "Land_TripodScreen_01_large_F" createVehicle (player modelToWorld [0,10,0]); _screen setObjectTexture [0, _video]; [_video, [10, 10]] call BIS_fnc_playVideo;

Additional Information

See also:
Functions Library

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

Notes

Bottom Section