Chapter 6. Using States to Control Behavior
When Functions aren't enough
Functions can get a lot of what we want done, but what if our classes need more complex behavior? We could use a lot of Booleans and flow control statements to get the functionality we need, but for something as complex as say, Artificial Intelligence (AI), it would start to get messy in a hurry. To really take advantage of UnrealScript, we'll need to learn how to use states.
In this chapter, we will:
Learn what a state is and how to create them
Learn how functions behave inside and outside of states
Switch between states to change the way our classes operate
Use a few functions and statements that are unique to states
So with that, let's take a look at what we can do with state code.