Using console variables (CVars) in the Track View

Now that we have learned to create a variety of different sequences, we will explore some of the bridges that the Track View has designed within to communicate to different systems within the CryENGINE.

Getting ready

For this recipe, we will add some console commands to the Track View sequence created in the first and the second recipes of this chapter. These two recipes must be already created to go forward.

You should have the cut-scene my_first_cutscene open in the Track View and your view set to that of the camera.

How to do it...

Let's learn how to use a console variable key frame in the Track View:

  1. Right-click the parent node of your first cut-scene and add a console variable:
    How to do it...
  2. You will then be asked to name this console variable.

    It is very important that you name the console variable with the exact name of the variable you would type into console to achieve the same effect.

  3. For this example, set the name to e_TimeofDaySpeed.

    You will see that it adds a track to the parent node of the sequence.

  4. Next, create a key frame on the e_TimeofDaySpeed track.
  5. Set the value of this key frame to 0.5.

    What this will now do is force a command to the console, in this case, increasing the time of play back speed to 0.5.

    How to do it...
  6. It should be noted that you cannot preview the CVar events if the sequence is not triggered from within the game.

    In this case, you can use the previous setup performed earlier by creating a flow graph and adding a input:key node to quickly trigger the sequence.

  7. Trigger the flythrough sequence and notice that the Time of Day now plays according to the value set in the Track View.

How it works...

Setting the console variables can sometimes be an easy way of achieving some tasks. In this case, you can make a connection between events happening within a track sequence and the engine's console.

There's more...

You may want to know more about animating the CVar values or how to use a powerful CVar for the time scale.

Animating the CVar values

Console variables that are added to the sequence can have many different key frames, which allows for the animation of these values. For example, you may want to change the play speed of the Time of Day gradually from fast to slow or vice versa.

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.

See also

  • Go to the Creating a new Track View sequence recipe earlier in this chapter to learn how to create a sequence to add console variables to
  • Go to the Using track events recipe to learn how to create a special events trigger from the Track View to the Flow Graph
..................Content has been hidden....................

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