ABSTRACT

In Chapter 10, we discussed the Con::printf(), Con::warnf(), and Con:: errorf() functions. As you can see (by the prefi x), each of these functions is provided by the Con namespace. Each of these functions prints a colorized message to the console window. These colors will match the current color scheme used by the corresponding TorqueScript functions echo(), warn(), and error(). For example, this C++ statement

will produce the same result as this TorqueScript statement

The Con namespace provides the capability to register (expose) C++ global variables with the console. Subsequently, changes made to these exposed variables will be visible from both C++ and TorqueScript. In other words, if an exposed variable is changed in C++, that change will be refl ected in the TorqueScript version of this global and vice versa.