Getting Started In UnrealScript
This page is superseded by Setting Up UnrealScript.
It will be deleted as soon as we're all satisfied the new page has all the material from here & all the links are changed
Some rough notes of things to mention:
- basic syntax features: functions, variables, conditional execution of code & loops, special keywords like None, Self, etc.
- lack of an "entry point". Simple classes like Mutator maybe?
- inheritance, link to Object Oriented Programming Overview
Scripting Environment
First of all, although you can, you don't want to use UnrealEd for coding. It's great for making levels, but really inferior for coding. Instead, by far the easiest way is to use an editor such as [WOTgreal] or [Visual UC++] (comes with UT2003 as "UDE"), they have great Graphical User Interfaces for editing and compiling. Also, if there are any errors, they will open the source file and move the cursor to that line. Really handy.
A simple stand-alone way to compile UnrealScript projects is UMake. It provides similar features as those integrated development environments mentioned above, but assumes that you use your own (favorite) text editor to create and edit your sources.
The original way was to open up a command prompt/DOS window, cd into your UnrealTournament\System or UT2003\System directory, delete the .u file for your project and any project that depends on it, and type "ucc make". (see Compiling With UCC).
However, if all of the above has already scared you then you could look at the UnrealScript Hello World and see if that is less scary. It's going to do everything by hand and the long way without using any of the tools mentioned above, but, will be enough to get you going.
Extract Source Code
Downloading then Official Sources
Go to Class Tree and download the UnrealScript sources of the predefined classes available in UT2003; that's the base you'll be creating your projects on.
Extracting the Sources Yourself
Otherwise, you do need to do one thing in UnrealEd however: Extract the source code that comes with the Unreal games yourself. That's right, all Unreal games come with full source to the UnrealScript parts. To get it out, start up UnrealEd, click on the little chess pawn (the Actor Classes browser), and select "Export All" from the menu. Then close UnrealEd and never open it again for coding.
Note that for UT2003 you should install the latest patch first. UnrealEd 3 in the unpatched retail version has problems with extracting classes from certain packages and the patch at least fixes the crash, but the exporter still has problems exporting the complete code for some classes. Especially the exported GUI classes are almost worthless because important information is missing.
The first tutorial you should read is Mod Authoring by Brandon Reinhart. (Keep in mind that it is written for pre-UT2003 builds of the Unreal Engine, so some things have to be "translated" manually to UT2003 syntax and classes. See also New UnrealScript In UT200X.)
Some other good tutorials are RegularX' UTutes?. He talks about basic OOP, compiling code for UT2003 and how to code simple mutators.
In UnrealScript, like most Object Oriented programming (and unlike Quake or Half-Life coding), you never change something that exists. You really don't want to change the code that comes with the game, since that will change all versions of the game and all mods, and most people don't want that. (Not to mention that this will break network compatibility.) Instead, when you want to change something in a class, you create your own version of the class, then get the game to use your version instead of the built in version. How you get it to use the new version depends pretty heavily on which class it is.
Related Topics
This page and UTute1 need merging - maybe call it Setting Up UnrealScript