Book Image

UnrealScript Game Programming Cookbook

By : Dave Voyles
Book Image

UnrealScript Game Programming Cookbook

By: Dave Voyles

Overview of this book

<p>Designed for high-level game programming, UnrealScript is used in tandem with the Unreal Engine to provide a scripting language that is ideal for creating your very own unique gameplay experience. By learning how to replicate some of the advanced techniques used in today's modern games, you too can take your game to the next level and stand out from the crowd.<br /><br />By providing a series of engaging and practical recipes, this "UnrealScript Game Programming Cookbook" will show you how to leverage the advanced functionality within UDK. You'll be shown how to implement a wide variety of practical features using the high-level scripting language ranging from designing your own HUD, creating your very own custom tailored weapons, to generating pathfinding solutions, and even meticulously crafting your own AI.<br /><br />Learn how you can fully augment your projects with UnrealScript, with the additional inclusion of specific techniques that cover disciplines as diverse as AI scripting and HUD design. Initially starting with recipes that cover tinkering with your IDE, developing archetypes, and scripting cameras, you'll soon move on to creating advanced artificial intelligence, weapons, and vehicles alongside unique HUD and inventory systems.</p> <p>&nbsp;</p>
Table of Contents (15 chapters)
UnrealScript Game Programming Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Altering what our pickup does


Now that we have a pickup which offers ammo to the player, and know how to alter a variety of the pickup variables and aesthetics, let's take a moment to create a pickup that now offers health.

Getting ready

Open up IDE and create a new class called Tut_HealthPickup. Have it extend from UTHealthPickupFactory.

class Tut_HealthPickup extends UTHealthPickupFactory

How to do it...

This is a bit more complicated than our previous recipes. We'll have to create a new pickup class in our IDE, as well as an archetype in the editor, so that we're able to access the class and its variables within the editor. This is essential when working with level designers who are not familiar with code.

  1. Firstly, we want to have a sleek interface when we play with our pickup in the editor, so add the following code, beneath your class declaration:

    class Tut_HealthPickup extends UTHealthPickupFactory
    /** Hides categories that we won't be needing from the archetype */
    HideCategories(Object,...