CSpeakModifiers

From Valve Developer Community
Revision as of 02:06, 10 July 2010 by GeorgiaPeanuts (talk | contribs) (Created page with '== Problem == If you have had to use the Response Rules system with modifiers passed in at a response request time you will be aware that you must spend your time concatenating …')

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Problem

If you have had to use the Response Rules system with modifiers passed in at a response request time you will be aware that you must spend your time concatenating strings to build these modifiers to pass into the Speak calls. It is time consuming to always write and just annoying to write.

Solution

In light of this problem I decided to write a simple utility class which would handle the dirty work for me. It is very small class and allows you to just pop in your modifiers whatever order you wish and it will build the output string for the response rules for you. It also takes in parameters as floating point numbers or integer numbers and converts them to strings for you.

Here is the code for the class.