How to have music change according to the mood
Torque 3D allows us to change the sounds that are playing based on various states. One example is modifying the background music of a level depending on the current mood, or to reflect a change that has occurred in the game.
In this recipe, we will learn how change the music currently being played, depending on if the player is being hurt through the use of mood states.
Getting ready
We will be making TorqueScript changes and working with the World Editor in a project based on the Torque 3D's FPS Tutorial
template, and try them out using the China Town Dusk
level.
If you haven't already, use the Torque Project Manager (Project Manager.exe
) to create a new project from the FPS Tutorial
template; it can be found under the My Projects
directory. After that, start your favorite script editor, such as Torsion, and let's get going!
How to do it…
In the following steps, we will set up some audio mood ambiences that will be switched between, when the player...