Time for action – adding a Console Variable to a sequence

For this example, we will add some console commands to the Track View sequence created in the Creating a new Track View sequence and Animating a camera in Track View sections of this chapter. These two sections must be completed before going forward with the following example:

  1. You should have the my_first_cutscene cutscene open in Track View and your view set to that of the camera.
  2. Right-click on the parent node of my_first_cutscene and select Add Console Variable as shown in the following screenshot:
    Time for action – adding a Console Variable to a sequence

    You will then be asked to name this Console Variable (CVAR).

    Note

    It is very important that you name the CVAR the exact name of the variable you would type into the console.

  3. For this example, set the name to e_TimeofDaySpeed. You will see it added as a track to the parent node of the sequence.
  4. Next, create a key frame on the e_TimeofDaySpeed track. Set the value of this key frame to 0.5, as shown in the following screenshot:

    What this will now do is force a command to the console, in this case setting the time of the playback speed to 0.50.

    Time for action – adding a Console Variable to a sequence

    Note

    It should be noted that you cannot preview the CVAR events if the sequence is not triggered from within the game.

  5. In this case you can use the setup performed earlier by creating a Flow Graph and adding an Input:Key node to trigger the sequence quickly.
  6. Trigger the flythrough sequence and notice that the time of day in the level now plays according to the value set in Track View.

What just happened?

Setting CVARs can sometimes be an easy way of achieving some quick effects and changes. Some examples of this are disabling all LODs for marketing videos, or changing rendering effects. In any case, it's valuable to leverage the connection between events happening within a track sequence and the engines console.

Have a go hero – animating CVAR values

CVARs that are added to the sequence can have many different key frames, which allow for the animation of these values. For example, you may want to change the play speed of the time of day within the level to change gradually from fast to slow or vice versa.

The t_scale CVAR in Track View

Sometimes to slow down an entire sequence at once, the t_scale CVAR is used. This can be used quite safely as long as it's understood that the default value is 1. A good setting for a slow motion, bullet-time feel is about 0.2.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.142.133.180