Using SFXEmitter to create networked sound effects
While Torque 3D makes it easy to play single, short sound effects at any time (see the previous recipe), there are times when we need to play longer sound effects that all clients need to hear when they connect to the game server, or when they are in range (for 3D effects).
In this recipe, we will learn how to set up a sound source that will be in scope for all clients, new or old, and will automatically handle clients that come in range.
Getting ready
We will be making TorqueScript changes and working with World Editor in a project based on the Torque 3D's FPS Tutorial
template. We will then try them out using the China Town Day
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. Then start your favorite script editor, such as Torsion, and let's get going!
How to do it...
In the following steps, we will play...