Okay, so hopefully you were able to install UDK without any problems. There have been some issues in the past, but those should be resolved by going through epic’s support. I won’t be able to work magic on your computer to make things magically do the right thing. In anycase, here’s a short minimum check list of things you will need to get started from scratch.
1) A text editor. And I dont mean something like MS Word, or Google Docs. For the following examples i’ll simply use notepad.exe
I’m using windows7, if you’re using vista you’ll be able to follow along just as easily, if you’re still on XP, Things will look a bit different, but things are basically the exact same.
Notepad.exe is about as simple as a text editor can be. For work I use Microsoft’s Visual Studio orIDM’s UltraEditStudio. A few other great tools are WOTGreal which is a Unrealscript specific text editor, or UDE which is the editor that Epic supports. For the following tutorial I’ll be using Notepad.
2) You’ll need find a few directories so you know where you’ll be saving your scripts.
The first directory you’ll want to locate is the Classes directory. By default it might look a bit like this
C:\UDK\UDK-2009-11\Development\Src\UTGame\Classes
This directory is where you’ll be saving your .uc files. Be careful you don’t change or delete any of the other files in there or you might break UTGame. We’ll simply be adding to what’s in this directory. This is NOT how you will want to start your own game, this is strictly for the least amount of work to get started learning how to code in Unrealscript. To really start your own project you’ll want to create your very own directory and you’ll have a path that looks like
C:\UDK\UDK-2009-11\Development\Src\MySpiffyNewGame\Classes
But for now we’ll skip what is required for you to be able to do that. Moving on. Open up notepad and enter the followin
class MyPawn extends Pawn;
This basically creates a pawn that’s called “MyPawn” rather than just Pawn. Of course it’s not doing anything interesting that a regular Pawn can’t but we didn’t tell it to. Everything you see in Unreal is an Actor, Pawns are actors that can be told to do things. There are a lot of technical programmy things that are going on here, but you can catch up on that in some of the other tutorials on this site.
Now save that file as MyPawn.uc remember to make sure your file name matches the word that follows class. These two words have to match or Unreal’s compiler will tell you to fix them so they do match. This file will go \Development\Src\MySpiffyNewGame. But we’ll need to tell the editor we added a new directory. To do this we’ll open DefaultEngine.ini and add a new line. The file is located in UTGame\Config.
Look for the section thats labeled [UnrealEd.EditorEngine]
in there you’ll want to add “+EditPackages=MySpiffyNewGame” just under the line that says “UTGameContent”. you should have something that looks like this:
[UnrealEd.EditorEngine] EditPackagesOutPath=..\..\UTGame\Script FRScriptOutputPath=..\..\UTGame\ScriptFinalRelease +EditPackages=OnlineSubsystemLive +EditPackages=OnlineSubsystemPC +EditPackages=UTGame +EditPackages=UTEditor +EditPackages=UTGameContent +EditPackages=MySpiffyNewGame ;ModEditPackages=MyMod AutoSaveDir=..\..\UTGame\Autosaves InEditorGameURLOptions=?quickstart=1?numplay=1
Now run the editor, A dialog will pop up asking if you would like to rebuild your scripts. Click on Yes.
This will open another window that will scan through all of the UDK content and rebuild scripts that need building and check that they are pointing at inventory that exists in the UDK contents directories.
If you’re on a fast machine this should take less time than what I’ve recorded here. I’m on a really basic laptop. If all goes well, then you should get some green text after some white text goes scrolling by. This might take a little bit to open up, but shouldn’t take long to actually build your scripts. At work my machine takes just over 2 seconds to build, but my budget laptop takes almost 20 seconds. If your editor doesn’t tell you that the scripts need rebuilding it may be because it’s not allowed to write over the scripts. Go into the UTGame\Script directory select all of the files and right click and select properties
Make sure that the .u files are not Read-Only, otherwise the engine cant turn the .uc files into a few .u files. If the engine found your SpiffyNewGame then you should see a new MySpiffyNewGame.u file in there. Run the editor again and this time it should boot up normally. Only this time it will be extended by a new Pawn called MyPawn.
If you select the “Actor Classes” tab in the generic browser window, scroll down to see the Pawn classes. Expand that and you’ll see in it a new selection called MyPawn. That’s your code in action right there! You just wrote a mod, amazing! To move forward you’ll repeat a couple of things.
First you’ll start new class files with new names. Try not to repeat anything that’s already been written before. Then you’ll be saving all your new class files in a Classes directory in that development folder. And then as you work you’ll constantly be rebuilding scripts over and over again. If for some reason you can’t rebuild the scripts check for two things. First, make sure that you’re not already running an instance of UDK. You can’t rebuild scripts when they’re in use by the editor. Second, make sure that the files in the C:\UDK\UDK-2009-11\UTGame\Script directory are not wright protected.
If you look in this directory C:\UDK\UDK-2009-11\UTGame\Logs you’ll find a record of everything that UDK has been up to. I’ve had that directory filled with several hundred files taking up a few GBs worth of data. You might want to clean that directory out once in a while. We’ll get into how log files are used, but for now just remember that UDK will make a lot of these, and you’ll learn how to use them.
Hope this makes things a bit more clear!
Continue to : Setting up your new project.
Happy modding!
Dont work for me :’(
i have my “MyPawn.uc”
(with “class MyPawn extends Pawn;”)
into :
C:\UDK\UDK-2009-11\Development\Src\MySpiffyNewGame\Classes
but when i launch the udk editor, he dont say ” script outdated..” and there is’nt “mypawn” on the actor class :s
screenshot here : http://img204.imageshack.us/img204/5241/sanstitre1is.jpg
what must i do ? :s
Thanks for the input, I’ve updated the page to reflect a couple of things I missed the first time through. My blog is quite a work in progress so any input helps everyone out! thanks for letting me know!
It workt fine now :p
Thanks. This is great work. Id love to see more BASIC scripting tutorials. Keep it up.
Thanks for sharing knowledge