O'Reilly logo

Torque 3D Game Development Cookbook by David Wyand

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using the message producer/consumer system

Most games generate events that require some form of action. For example, a player has entered an area and an alarm should sound, or a pig has run out of food and the farmer needs to refill the trough. Rather than hardcode these actions to each event, it is preferred that objects listen for the event messages they are interested in and then act accordingly. This decouples the whole process and makes it much easier to add and remove event message responders. In this recipe, we will learn how to generate an event message and have objects listen for that message.

Getting ready

We will be making TorqueScript changes and working with the World Editor in a project based on the Torque 3D FPS Tutorial template, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required