Lesson 6

Table of Contents

Creating a Custom State Group

To generate the additional information needed by the Music Playlist Container, you’ll create a custom State Group, specifically for the music system that will be used to identify the major modes of gameplay. Once created, you’ll associate these States with the appropriate Music Playlist Container as you did in the last exercise.

  1. In the Project Explorer, click the Game Syncs tab and select the States folder.

    As you’ve done in other parts of the project, you want to create a Music Work Unit for any State Groups uniquely related to the music system.

  2. Within the States Folder, create a new Work Unit called Music.

  3. Right-click the Music Work Unit and choose New Child > State Group.

    The State Group you’ve created can be named anything you like, because there is nothing coded in Cube that will directly link to this State Group. Since this will be used to identify States specifically for the music system, Music_State is a sensible choice.

    [Note]

    You’ll learn in the next exercise how you’ll use events coming from the game to tie-in with the Music_State State Group you’re creating now.

  4. Name the new State Group Music_State.

    You now need to create the various States within the Music_State State Group. The first one will be used to represent when the players are in the general mode of gameplay, as opposed to something else, like being in a menu or playing in a specialized aspect of the game like the boss fight.

  5. Right-click the Music_State object and choose New Child > State.

  6. Name the new State Gameplay.

    Now you’ll add additional States for other modes of gameplay.

  7. Add additional States for Boss, Victory, and Story.

    Just by looking at the names, it’s easy to predict which States will be associated with which Music Playlist Containers. You may be wondering about the absence of game states for Explore and Combat. This is because the need to transition between the Combat and Explore music will occur frequently, based on enemy contact during the game. A special approach to handling this Transition will be needed. For this lesson you’ll be associating Gameplay with the Combat music. In Lesson 7, you’ll learn an advanced approach to integrating the Explore and Combat music so that they both work with the Gameplay State.


Was this page helpful?