Book Image

Unreal Development Kit Game Programming with UnrealScript: Beginner's Guide

By : Rachel Cordone
Book Image

Unreal Development Kit Game Programming with UnrealScript: Beginner's Guide

By: Rachel Cordone

Overview of this book

Unreal Development Kit is the free edition of Unreal Engine—the largest game engine in existence with hundreds of shipped commercial titles. The Unreal Engine is a very powerful tool for game development but with something so complex it's hard to know where to start.This book will teach you how to use the UnrealScript language to create your own games with the Unreal Development Kit by using an example game that you can create and play for yourself. It breaks down the UnrealScript language into easy to follow chapters that will quickly bring you up to speed with UnrealScript game programming.Unreal Development Kit Game Programming with UnrealScript takes you through the UnrealScript language for the Unreal Development Kit. It starts by walking through a project setup and setting up programs to write and browse code. It then takes you through using variables, functions, and custom classes to alter the game's behavior and create our own functionality. The use and creation of Kismet is also covered. Later, using replication to create and test multiplayer games is discussed. The book closes with code optimization and error handling as well as a few of the less common but useful features of UnrealScript.
Table of Contents (18 chapters)
Unreal Development Kit Game Programming with UnrealScript
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

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.