39,59 €
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.
Das E-Book können Sie in Legimi-Apps oder einer beliebigen App lesen, die das folgende Format unterstützen:
Seitenzahl: 538
Veröffentlichungsjahr: 2011
Copyright © 2011 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: December 2011
Production Reference: 1081211
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B3 2PB, UK.
ISBN 978-1-84969-192-5
www.packtpub.com
Cover Image by Tom Mooney (<[email protected]>)
Author
Rachel Cordone
Reviewers
Edward Davies
Dave Voyles
Acquisition Editor
Wilson D'Souza
Development Editor
Meeta Rajani
Technical Editors
Pramila Balan
Kavita Iyer
Llewellyn Rozario
Project Coordinator
Kushal Bhardwaj
Proofreaders
Mario Cecere
Chris Smith
Indexer
Hemangini Bari
Graphics
Manu Joseph
Production Coordinator
Arvindkumar Gupta
Cover Work
Arvindkumar Gupta
Rachel Cordone is a designer and self-taught UnrealScript programmer, who has been working with the Unreal Engine since 1999. She has worked for various game and simulation companies since 2003, including Pipeworks Software and Parsons Brinkerhoff, and has started up her own game company, Stubborn Horse Studios, to make independent games with the Unreal Development Kit. Stubborn Horse's first project, Prometheus, won several awards in Epic Games' Make Something Unreal Contest.
I would like to thank my crazy goat for his love and support while writing this book!
Edward Davies is in the final year of his Game Art and Animation degree at the University of Glamorgan. He has a strong interest in game design, particularly the Unreal Development Kit, concept art, and 3D modeling and texturing. More of Edward's work may be seen at www.kungfoowiz.deviantart.com/gallery.
Dave Voyles is a Managing Editor and Podcast Producer for Armless Octopus. He covers Xbox LIVE Indie Game, Xbox Live Arcade, and Playstation Network news, reviews, and developer interviews. He holds a BS in Communication Studies from SUNY Oneonta, and is currently attending the New York Institute of Technology to work on his MBA in Management of Information Systems. His additional work within the gaming community includes working as the Coordinator of the Indie Games Summer Uprising, which looks to promote the most outstanding titles on the Xbox LIVE Indie Games platform. Dave is also an Unreal Script programmer for two titles that will be released on PC and iOS, at the end of 2011. Most notably, he is the founder of the New York City-based UDK meetup group, where he works with other developers to collaborate on endeavors in a physical environment, as well as provide tutorials. You can find more of his work by visiting his sites http://www.DaveVoyles.wordpress.com or http://www.ArmlessOctopus.com.
You might want to visit www.PacktPub.com for support files and downloads related to your book.
Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktPub.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at <[email protected]> for more details.
At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range of free newsletters and receive exclusive discounts and offers on Packt books and eBooks.
http://PacktLib.PacktPub.com
Do you need instant solutions to your IT questions? PacktLib is Packt's online digital book library. Here, you can access, read, and search across Packt's entire library of books.
If you have an account with Packt at www.PacktPub.com, you can use this to access PacktLib today and view nine entirely free books. Simply use your login credentials for immediate access.
Welcome to Unreal Development Kit Game Programming with UnrealScript! This book teaches you how to program using the UnrealScript language so you can create your own game projects using the UDK. Instead of using dry, hypothetical code you will use the topics learned in each chapter to build an actual working game. By the end of the book, you will be comfortable enough with the language to start working on projects of your own.
Chapter 1, Project Setup and Test Environments, guides you through the installation and setup of the Unreal Development Kit as well as ConTEXT and UnCodeX, two programs that we will use to write our code. We also examine the directory structure of the UDK and take a look at the configuration files.
Chapter 2, Storing and Manipulating Data, covers the different types of variables we can use in the UDK as well as the flow control statements we can use to react to our changing environment.
Chapter 3, Understanding the Class Tree, examines the class tree so we can understand the relationship between objects in the world. We learn about inheritance and function overriding to customize our object's behavior.
Chapter 4, Making Custom Classes, focuses on the creation of classes of our own. The core classes for any UDK project are discussed, and we create our own versions of them for our game. We change how the camera works, what the rules of the game are, and how the player is controlled.
Chapter 5, Using Functions, covers the use of functions to expand our game. Here we learn how to pass information from one object to another, and how to manipulate that data and return it to the original object. Custom functions are created for our objects to create functionality that didn't exist in the original UDK classes.
Chapter 6, Using States to Control Behavior, covers states and how they can be used to organize and control complicated behavior such as enemy classes for our game. Creating states, changing states, and working with functions within states are discussed.
Chapter 7, Working with Kismet, discusses the use of Kismet in UDK games as well as the creation of custom actions and events. These are used to demonstrate the power of Kismet to tailor the gameplay to each individual level's needs.
Chapter 8, Creating Multiplayer Games, covers running a server and a client on a single machine for multiplayer testing. We also cover the fundamentals of networking code and how to design your game with multiplayer in mind.
Chapter 9, Debugging and Optimization, discusses common errors encountered when compiling and running UnrealScript as well as solutions to these problems. Different ways of optimizing code to make your game run faster are also discussed.
Chapter 10, Odds and Ends, covers the use of Components to customize the visual look of objects in our game. The use of DLLBind to communicate with programs outside of the UDK is also discussed.
A computer capable of running the UDK is required for this book, see http://udn.epicgames.com/Three/DevelopmentKitFAQ.html for the minimum requirements. ConTEXT and UnCodeX are included in the files with the book. See http://www.packtpub.com/ for downloading code files.
This book is for people who are new to the Unreal Development Kit and who wish to create their own game projects using UnrealScript. The information here is also useful to programmers having experience in another language and who wish to expand their knowledge by learning UnrealScript.
In this book, you will find several headings appearing frequently.
To give clear instructions of how to complete a procedure or task, we use:
Instructions often need some extra explanation so that they make sense, so they are followed with:
This heading explains the working of tasks or instructions that you have just completed.
You will also find some other learning aids in the book, including:
These are short multiple choice questions intended to help you test your own understanding.
These set practical challenges and give you ideas for experimenting with what you have learned.
You will also find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning.
Code words in text are shown as follows: "We can play the example game that comes with it to get an idea of what the UDK can do by going into C:\UDK\UDK-AwesomeGame\Binaries\Win32 (or Win64 if we have a 64-bit operating system) and running UDK.exe"
A block of code is set as follows:
When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:
New terms and important words are shown in bold. Words that you see on the screen, in menus or dialog boxes for example, appear in the text like this: "Let's click on Return to Desktop for now."
Warnings or important notes appear in a box like this.
Tips and tricks appear like this.
Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.
To send us general feedback, simply send an e-mail to <[email protected]>, and mention the book title via the subject of your message.
If there is a book that you need and would like to see us publish, please send us a note in the SUGGEST A TITLE form on www.packtpub.com or e-mail <[email protected]>.
If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide on www.packtpub.com/authors.
Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.
You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the files e-mailed directly to you.
Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you would report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/support, selecting your book, clicking on the errata submission form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded on our website, or added to any list of existing errata, under the Errata section of that title. Any existing errata can be viewed by selecting your title from http://www.packtpub.com/support.
Piracy of copyright material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works, in any form, on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.
Please contact us at <[email protected]> with a link to the suspected pirated material.
We appreciate your help in protecting our authors, and our ability to bring you valuable content.
You can contact us at <[email protected]> if you are having a problem with any aspect of the book, and we will do our best to address it.
Introducing the Unreal Development Kit (UDK)
Epic Games' Unreal Development Kit is a powerful tool, but like any complicated piece of software it can be overwhelming at first. This book will guide you through the structure of the UDK and the basic principles of UnrealScript, and by the end you will have the skills you need to start making your own games. Let's get started!
It's a great time to get into the UDK and UnrealScript. With the release of the UDK, Epic Games has opened up a great way for indie developers to make high quality games without high quality budgets. With hard work and dedication even a small team of people can make a great game in their spare time, and with digital distribution platforms such as Steam, it's become much easier to self-publish and build a community of fans, and being able to sell your game doesn't hurt either.
With constant updates to the UDK, Epic provides the latest features of the Unreal Engine for free if you're just looking at game development as a hobby. If you're aiming to start up your own development studio, the licensing terms for the UDK fit even in the smallest of budgets. If you're looking for AAA quality, the UDK is where you'll find it.
Being an UnrealScript programmer is the most important job in a UDK project. Even without artists you can build prototypes and demonstrate your gameplay using UnrealScript and placeholder artwork using the assets included with the UDK. As they say, actions speak louder than words, and having a fun game which people can play will help attract the art talent to give your project the visual quality you need.
So with that, let's take a look at the Unreal Development Kit!
Before we start cooking let's set the table. There are a few things we need to do before we write our first line of code.
In this chapter we will:
Let's see what our computer needs to run the UDK.
It doesn't take a top of the line computer to work with the UDK, but like any software there are system requirements that we need to meet. According to the UDK website they are as follows:
Make sure the computer we're working on meets these requirements, and then we can install the UDK!
Epic's official UDK website is the best place to stay up to date with the latest UDK releases and features, so we'll be heading there for the download.
Now we have a working copy of the UDK installed on our computer. We can play the example game that comes with it to get an idea of what the UDK can do by going into C:\UDK\UDK-AwesomeGame\Binaries\Win32 (or Win64 if we have a 64 bit operating system) and running UDK.exe. Take a few minutes and look through the game's menus and play the Deathmatch map DM-Deck to get an idea of what the UDK is capable of.
Now we're ready to take a peek under the hood of the UDK. Where are the files that the UDK uses to make our game work?
Let's take a look at the folders in the UDK install to see how everything is organized.
The first folder, Binaries, holds the game executables and tools for artists and animators. We won't be working with the art tools in this book, but it's helpful to know what they do.
The next folder, Development, is where most of our work will take place. You may have heard people talk about a game's source code before. The Development\Src folder is where our game's source code will go. If we look in the Src folder we see that it isn't empty, there are a lot of folders already in there. Epic provides the source UnrealScript files for reference, to make it easier to learn how to make our own code. As Indiana Jones might say if he were a programmer, "Seventy percent of programming is reading the source code." One important thing to remember: NEVER ALTER EPIC'S SOURCE CODE! A lot of the files have C++ code behind the scenes, and altering these files could break them since we don't have access to the C++ code. All the work we do will be creating our own files to work with.
The Engine folder holds resources and configuration files for the game and editor, and will rarely need to be touched even by experienced UnrealScript programmers.
The next folder is where the heart of a UDK project resides. UDKGame is where all of the content for our game is found, where the configuration files are, even where the splash screen is. Let's take a look at each folder individually. The next two folders are:
Not too complicated! In this next section we'll be taking a closer look at the Development folder by installing and setting up a few programs we can use to making coding in UnrealScript easier. Let's get to it!
There are two things we need to look at when deciding what programs to use to help us write UnrealScript code. The first, obviously, would be something we can use to write the code itself. Script files can be opened and written in a plain text editor like Notepad if we prefer, but there are free programs out there we can use to make our lives easier.
ConTEXT is a freeware text editor designed to make working with various programming languages easier. It has text highlighting to make reading code quicker, and tools to make compiling code as easy as pressing a button. Let's install it so we can use it in our project.
Find the installer included with this book, or go to http://www.contexteditor.org and download the latest version.
With ConTEXT installed we have a simple, but powerful tool to make our coding lives easier. We can drag files from the Development\Src folder directly onto ConTEXT to open them, or use the File Explorer pane on the left to browse through the directories. However, before we're ready to use it for programming, we need to configure a few things.
Now we'll set up ConTEXT to make reading UnrealScript easier, and use it to compile scripts with a single button press.
ConTEXT is now set up to compile our UnrealScript files; all we have to do is press F9. The first time we do this it will also recompile Epic's UnrealScript files, this is normal. The compiler may also show up in a separate window instead of at the bottom of ConTEXT, this is also normal.
Starting to feel like a programmer yet? Now that we're able to compile code we just need an easy way to browse through Epic's UnrealScript source code, and to do that we're going to install another small program, UnCodeX.
We can write our own code with ConTEXT, but now we need something to make sense of the Development\Src folder. There are over 2,000 files in there! This is where UnCodeX comes in. UnCodeX organizes the files into a class tree so that we can easily browse through them and see their relationship to each other. It also allows us to quickly search through the source code, which is where the line numbers in ConTEXT come in handy when we're searching through our own code.
Find the installer included with this book, or head to http://sourceforge.net/projects/uncodex and download the latest version of UnCodeX.
With UnCodeX installed we have a great way to browse through and search Epic's source code, as well as our own when we start creating it. UnCodeX is also very useful for debugging broken code. Now that it's installed, we need to set it up to work with our UDK directory.
UnCodeX needs to know where our source code is before we can search through it. Let's set up UnCodeX now.
UnCodeX is now configured and ready for us to use. Let's take a look at what it's showing us.
nFringe is an IDE (Integrated Development Environment) that allows programmers to work with UnrealScript in Microsoft Visual Studio 2005 or 2008. It includes a debugger that allows us to stop the game while it is running to see what is happening in script. There is a free version available for non-commercial work, but if you'd like to use it for commercial projects there is a licensing fee. If you have Visual Studio and would like to try it out, head over to http://pixelminegames.com and get the latest version!
WOTgreal was originally created by Dean Harmon for the Unreal Engine based Wheel of Time game. The program works with all Unreal Engine games though, and is like ConTEXT and UnCodeX combined. There is a small licensing fee for the standard or professional version of the program. Head over to http://www.wotgreal.com to check it out!
For the most part the choice of program to use when working with UnrealScript comes down to personal taste. The Unreal Editor itself will detect changes in the source code and ask if you want to compile when it opens. Some programmers use Notepad to write and a DOS prompt to compile, using the same make command that ConTEXT uses. Try out the various programs to see what works best for you.
Now we have the programs, we need to start working on our own project, but where do we start? Looking back at the UDK directory structure, there are really only three folders we would need to create. The first would be our own folder in the UDKGame\Content directory to contain any assets our project needs. Any artists or animators on the project would put their files in that directory. The second would be a folder in UDKGame\Content\Maps for our project's levels. This keeps everything organized and separated from Epic's assets so we know what's ours. For programmers though, there is only one folder we really need to worry about.
The last folder we need for our own games is the one we'll be doing most of our work in as programmers. It's the place we'll be keeping all of our source code.
When code is compiled, the final .u file's name is the same as the folder, so in our case when we compile a file called AwesomeGame.u, it will show up in the UDKGame\Script folder. Empty folders are ignored, so let's create our first class so we have something to work with. We'll create a simple class we can place in a level to have the game run the code that we write.
Create a text file and name it AwesomeActor.uc (make sure file extensions are shown in your folders so you don't accidentally name it AwesomeActor.uc.txt).Open the file in ConTEXT and type the following code into it.
Downloading the example code
You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the files e-mailed directly to you.
Make sure all of the punctuation is correct, particularly the opening and closing brackets after defaultproperties. The compiler is very particular about those brackets; they have to be on their own lines for anything inside them to work correctly.
The first line of our class defines the name of our object and its relationship to other objects in the game. The name of the file has to be the same as the name we type here; otherwise the compiler will give us an error. In this case both are AwesomeActor. The extends Actor part makes our AwesomeActor a child of Actor. In a way the class tree can be seen as a family tree, with classes inside the tree being children of the ones further up the chain.
The second line makes it so our class can be placed in the editor. Things like lights, path nodes, vehicles, all of these have placeable in their .uc file so the editor will let us place them. Other things like projectiles or explosions wouldn't be set as placeable since they are created while the game is running.
The section in the default properties creates a sprite so that we can see the actor in the editor and in the game.
Now, before we compile we need to let the game know about our AwesomeGame folder.
Open UDKGame\Config\DefaultEngine.ini and add our package AwesomeGame to the end of the EditPackages list.Now we've created a folder for our code to go in called AwesomeGame, which is in the Development/Src folder. In it we've created our first code file, AwesomeActor.uc. We then edited DefaultEngine.ini so the game would recognize our new code package.
The folders in the Development\Src directory aren't automatically detected. The main reason for this is that in some cases we may not want or need the classes inside it. For instance, we may have different folders for a PC project and an iOS project. Both of them would be in the Development\Src folder, but the PC version of our game wouldn't need the iOS code and vice versa. Remember when we went over the directory structure and we talked about the Config folder? That folder contains all of the settings for our game. Let's take a look.
The file we added to, DefaultEngine, contains things like the game's resolution and texture detail. It also contains the EditPackages list we added to, which tells the game which packages to compile and in what order.
As you can see, the names in this list can also be found as folders in the Development\Src directory:
The list in DefaultEngine.ini seems kind of short though, doesn't it? Well, much like the class we created is a child of Actor, DefaultEngine.ini also has a parent. If we look at the top of DefaultEngine we can see this:
This .ini file is actually based on another one, its parent DefaultEngineUDK.ini. Let's close DefaultEngine.ini and take a look at DefaultEngineUDK.ini's EditPackages list.
That's a bit better. UDKBase and UTEditor are two more folders in our Development\Src directory. But there are a lot more folders there, so what's the deal? Let's see if we can go higher up the ini tree to find out. At the top of DefaultEngineUDK.ini we see that this file also has a parent:
Let's close DefaultEngineUDK.ini and take a look at BaseEngine.ini, which is in the Engine\Config directory.
That's better! It looks like all of the folders are accounted for now, except for MyMod which is an empty example folder. And if we look at the top of BaseEngine.ini we can see that this is the end of the chain, BaseEngine doesn't have a parent.
So how does the game use these files? If you haven't run the game or compiled the code when we installed ConTEXT, run the game real quick and exit out of it at the main menu. The first time the game is run, it uses all of the Default and Base ini files to generate the ones the game actually uses in the UDKGame\Config directory:
So the obvious question is why are there so many files? Well, let's take another look inside BaseEngine.ini to see why. About two-thirds of the way down the file we can see a list of system settings:
These settings control some of the visual effects in the game like motion blur and bloom. What would happen if we changed them? It would change the game's visual effects of course, but here's another question. While playing the game, in the Settings we're able to revert back to the defaults. If we changed the settings in these files, how would the game know what the default was? The game uses the Base and Default ini files to create the UDK ones, that way the player can change things like the resolution or keybinds, but the game will still have the known safe default settings available if it needs them. It may seem a bit complicated but it's pretty easy to work with. As the game's developer we would work in the Default and Base ini files to make the game work the way we want by default, and the player can change the settings if they want to.
Now that AwesomeGame has been added to the EditPackages list we'll be able to compile it. But why did we have to add AwesomeGame to the very end of the list? The way the compiler works is that it goes down the EditPackages list in order and looks for any changes to the files in the Development\Src directory. If any .uc files are changed it recompiles that package. It's also important to know that any package that our classes are dependent on has to be compiled before ours. As an example, let's take a look at DefaultEngine.ini again. One of the EditPackages listed is UTGameContent. In the UTGameContent folder we can see a class called UTJumpBoots. If we wanted to make our own jump boot class with UTJumpBoots as its parent, we have to make sure that UTGameContent is compiled before our package, otherwise the compiler won't know about that class yet and will give us an error saying our class' parent doesn't exist.
Among the settings in DefaultGame.ini are the default time limits for maps. See if you can find and change it from 20 minutes to 15 minutes.
That takes care of our initial project setup! Now that everything is in place, we can start compiling and testing some code. Let's get to it!
We'll be using ConTEXT to compile the code we wrote, and to test it we'll be using the Unreal Editor. Don't worry if you have no knowledge of the editor, we don't need to be experts to be able to use it to test our code.
If there are any warnings or errors, look over the code again to make sure everything is spelled correctly and the punctuation is correct. The error message itself should provide a clue as to where to look. It will also give you a line number where the error happened.
Now that our code is compiled, let's add our AwesomeActor to a level. If you don't have an editor shortcut or can't find it in your Start menu, it's easy to make one. Go into UDK-AwesomeGame\Binaries\Win32 and right-click on UDK.exe. Click on Send To and then Desktop (create shortcut). Right-click on the shortcut it created and click on Properties. In the Target field, add editor to the end without quotes:Now let's open the editor!Close the Welcome Screen and Content Browser, and let's take a look at the editor real quick. To try out our code we're going to need a test map, so go to File, and click on Open, and select ExampleMap.udk to open it.One thing we'll notice immediately is that there seems to be a lot of strange objects floating around the level. These are Actor classes that are normally invisible in game, but have sprites that can be seen in the editor. Remember the sprite we added to the default properties of our AwesomeActor? This is where it gets used.
Now let's add our AwesomeActor.
Click on the Content Browser button to open it up again.The Content Browser will show the tab with game assets like textures and meshes at first, but we need to take a look in the Actor Classes, so select that tab in the top.This looks a lot different than the class tree in UnCodeX though. Classes can be put into Categories so they're more organized in the editor, but right now we just need to see a normal class tree, so uncheck Show Categories.There's our AwesomeActor class!
Select AwesomeActor and close the Content Browser. In the 3D viewport, right-click on the floor and near the bottom click on Add AwesomeActor Here.There's the AwesomeActor, showing the sprite that we put in the default properties of our class! Normally these sprites won't show up in the game, but we didn't put any restrictions on the one in our default properties so we'll be able to see it for now.
Click on the Play button to run the game in a new window.After you're done checking out the AwesomeActor in the level, close the game window.Now let's save the map so we can keep using it to test. We don't want to save over ExampleMap so let's save it in our own folder. Create a new folder in the Content\Maps directory called AwesomeGame, and in the editor save the map as AwesomeMap.udk inside that folder.Close the editor.So we have our class set up, but is there anything more we can do with it? Usually the first task when learning a new programming language is to make a Hello World program, so let's do that now. Open up our AwesomeActor.uc file in ConTEXT. Let's add some more code.
The first thing we'll do while we're here is make it so our actor doesn't show up in the game but still shows in the editor. We can do this with a simple one line addition to our default properties.
Add a new line in the default properties and write the following:PostBeginPlay is a function that is run when an Actor is first created, so it's a good place for our Hello World. The log line we put inside that function will output to a text file so we can see that our class is running correctly. So now, our class should look like this:
Before we compile, make sure the editor is closed. The compiler can't delete the old .u file if it's still in use by the editor and we'll get an error.
With the editor closed, compile the code by hitting F9 in ConTEXT.Now open the editor, and open AwesomeMap.udk.We don't need to do anything to our AwesomeActor, changes we make to our compiled classes automatically affect any of the actors we've placed in our levels.
Run the game by clicking on the Play button in the top as before. We'll see that our AwesomeActor is invisible now, so the line we added to the default properties is working. But where's our Hello World?Close the game window and exit the editor. Go into the UDKGame\Logs folder and take a look at the files in there.There should be Launch.log, Launch2.log, and any number of backups depending on how many times the game, editor or compiler has run. When they run, they create a backup of the existing Launch.log
