Animated Briefing – Arma 3

From Bohemia Interactive Community
Jump to navigation Jump to search
No edit summary
No edit summary
Line 102: Line 102:
A few things need to be prepared before calling the Animated Briefing function:
A few things need to be prepared before calling the Animated Briefing function:


* Timeline
* === Timeline ===
** A timeline is a multi-dimensional array in which each element consists of a time (represented by a number) and an event (a piece of code).
** A timeline is a multi-dimensional array in which each element consists of a time (represented by a number) and an event (a piece of code).
** The timeline starts counting from 0 when it is created.
** The timeline starts counting from 0 when it is created.
Line 142: Line 142:
];</syntaxhighlight>
];</syntaxhighlight>


* Markers to be hidden
* === Markers to be hidden ===
** Array of markers that will be hidden both at the start of the briefing and at the end.
** Array of markers that will be hidden both at the start of the briefing and at the end.
** You can use allMapMarkers to hide every marker.
** You can use allMapMarkers to hide every marker.


* Markers to be shown at the end of the Briefing
* === Markers to be shown at the end of the Briefing ===
** Array of markers that will be shown at the end of the briefing.
** Array of markers that will be shown at the end of the briefing.
** Markers that are manually shown during timeline events should also be included, as skipping the briefing before those events occur won't show them if they aren't.
** Markers that are manually shown during timeline events should also be included, as skipping the briefing before those events occur won't show them if they aren't.
** Markers can be organized into layers to facilitate the usage of the Animated Briefing function.
** Markers can be organized into layers to facilitate the usage of the Animated Briefing function.
*** To show the contents of the "showAtEnd" layers at the end of the Briefing, you can use the following code when calling the Animated Briefing function: <syntaxhighlight lang="cpp">[ _timeline, 0, nil, allMapMarkers, (getMissionLayerEntities "showAtEnd") select 1, "BIS_markerh_Zoom_final"] spawn BIS_fnc_TO_AnimatedBriefing;</syntaxhighlight>
To show a list of markers when the briefing starts, retrieve and show them in the first element of the timeline at 0 seconds as shown below:
<syntaxhighlight lang="cpp">private _timeline =
[
    [
        0,
        {
            [(getMissionLayerEntities "showAtStart") select 1, 0, true] spawn BIS_fnc_showMarkerArray;
        }
    ],
...</syntaxhighlight>


* Camera size and position at the end of the Briefing
* === Camera size and position at the end of the Briefing ===
** Position and size the camera will jump to at the end of the briefing
** Position and size the camera will jump to at the end of the briefing
** This helps ensure that the camera will be in the same position when the briefing ends both if the player watches through or skips the Briefing.
** This helps ensure that the camera will be in the same position when the briefing ends both if the player watches through or skips the Briefing.
** Rectangle markers can be used to make it easier to find the right position and size.
** Rectangle markers can be used to make it easier to find the right position and size.

Revision as of 15:04, 28 November 2017

Overview

The Animated Briefing framework allows you to create a briefing using the in-game map which features timeline-based, animated events such as moving markers, blinking markers, zooming, and other marker-related features.

Features

  • Easy to setup
  • Timeline based
  • Can be easily synced to music or dialogs
  • Skippable

Framework

Reasons

Since Tac-Ops missions are focused on proper military approaches, the animated briefing should support this general idea. It should simulate a real briefing before an operation. The map is almost empty on the start and markers and drawings are placed on the map step by step supported by dialogs describing the situation.

Functionality

The standard map is used as the platform. Standard markers are placed on the map using some kind of animations. Showing, hiding, canceling, moving and stretching markers is done by set of functions which are part of the briefing's framework. The briefing can be easily synced to dialogs, such as a leader explaining a plan, or to music.

Systems

BIS_fnc_TO_AnimatedBriefing

  • Enhanced version of the BIS_fnc_eventTimeline function
  • Does the work with the event timeline simpler and get the start of the briefings consistent
  • It does the initial setup
    • speaker setup
    • black-out / black-in
    • opens map
    • starts the event timeline by calling BIS_fnc_eventTimeline function
    • holdKey setup (for skipping the briefing)


Parameters

Parameter Description
timeline 2D ARRAY: see BIS_fnc_eventTimeline
pointer NUMBER: see BIS_fnc_eventTimeline
music (OPTIONAL) - STRING: music to be played at the start of the briefings. Timeline events will be synced to music
hideMarkers (OPTIONAL) - ARRAY: if passed, markers are hidden before starting the briefing and at the end of the briefing
showMarkers (OPTIONAL) - ARRAY: array of markers which will be shown after the briefing has ended
endPosition (OPTIONAL) - STRING: marker used for determining position and size of camera at the end of the briefing
canCloseMap (OPTIONAL) - BOOL: value that determines whether or not the player will be able to close the map after the briefing is over
endUserCode (OPTIONAL) - CODE: code to be executed at the end of the briefing

BIS_fnc_eventTimeline

  • Essential system of the Animated Briefings, but the function can be used for different purposes
  • It executes the code fragments at given time (keyframes)
  • It can play the events from start or from a defined position (index)
  • It can be interrupted from outside
  • user defined code can be executed onInterrupt or onFinished


Parameters

Parameter Description
timeline 2D ARRAY: array with keyframes and code to be activated at a certain time
pointer NUMBER: where to start playing (index)
music (OPTIONAL) - STRING: music to be played which will provide the sync time for the timeline
codeInterrupt (OPTIONAL) - CODE: code to be executed if the timeline is interrupted (missionNamespace setVariable ["BIS_fnc_eventTimeline_play", FALSE])
codeStop (OPTIONAL) - CODE or ARRAY: code or array of codes to be executed once the timeline is finshed. The codes are CALLed one after the other.

Setup and Usage

A few things need to be prepared before calling the Animated Briefing function:

  • === Timeline ===
    • A timeline is a multi-dimensional array in which each element consists of a time (represented by a number) and an event (a piece of code).
    • The timeline starts counting from 0 when it is created.
    • When the time specified in a timeline's element has elapsed, its relative event is spawned.
    • The timeline stops once it reaches the last element. The last element's code can also be empty if you're just using the element as an ending point.
    • The timeline can be kept in a separate file and included using #include "timelineFile.sqf"; within the file calling the briefing.
    • private _timeline =
      [
          [ 
              0,  
              {
                  [markerSize "BIS_SF_zoom0", markerpos "BIS_SF_zoom0", 0, nil, true] spawn BIS_fnc_zoomOnArea;
                  [(getMissionLayerEntities "g_showAtEnd") select 1, 0, true] spawn BIS_fnc_showMarkerArray;  
      
      
                  sleep 0.5;
      
                  [markerSize "BIS_SF_zoom1", markerpos "BIS_SF_zoom1", 3, nil, true] spawn BIS_fnc_zoomOnArea;
              } 
          ],
          [ 
              1.5,    
              {
                  ["to_c02_m01_003_br_sf_briefing_c_GUARDIAN_0", "GUARDIAN", BIS_fnc_AnimatedBriefing_speaker1] spawn BIS_fnc_TO_playSoundAndSubtitles;
      
                  ["BIS_SF_specialArea", 2] spawn BIS_fnc_showMarker; 
              } 
          ],
          [ 
              8.2,    
              {
                  ["to_c02_m01_003_br_sf_briefing_c_GUARDIAN_1", "GUARDIAN", BIS_fnc_AnimatedBriefing_speaker1] spawn BIS_fnc_TO_playSoundAndSubtitles;
      
                  _arrayTemp = ["BIS_SF_question_"] call BIS_fnc_getMarkers;
                  [_arrayTemp, 8, false] spawn BIS_fnc_showMarkerArray;   
              } 
          ],
          [ 12,   {} ]
      ];
      
  • === Markers to be hidden ===
    • Array of markers that will be hidden both at the start of the briefing and at the end.
    • You can use allMapMarkers to hide every marker.
  • === Markers to be shown at the end of the Briefing ===
    • Array of markers that will be shown at the end of the briefing.
    • Markers that are manually shown during timeline events should also be included, as skipping the briefing before those events occur won't show them if they aren't.
    • Markers can be organized into layers to facilitate the usage of the Animated Briefing function.
      • To show the contents of the "showAtEnd" layers at the end of the Briefing, you can use the following code when calling the Animated Briefing function:
        [ _timeline, 0, nil, allMapMarkers, (getMissionLayerEntities "showAtEnd") select 1, "BIS_markerh_Zoom_final"] spawn BIS_fnc_TO_AnimatedBriefing;
        

To show a list of markers when the briefing starts, retrieve and show them in the first element of the timeline at 0 seconds as shown below:

private _timeline =
[
    [ 
        0,
        {
            [(getMissionLayerEntities "showAtStart") select 1, 0, true] spawn BIS_fnc_showMarkerArray;
        } 
    ],
...


  • === Camera size and position at the end of the Briefing ===
    • Position and size the camera will jump to at the end of the briefing
    • This helps ensure that the camera will be in the same position when the briefing ends both if the player watches through or skips the Briefing.
    • Rectangle markers can be used to make it easier to find the right position and size.