back <-up -> next

UnrealScript Syntax

by: Robert J. Martin


This is intended as a quick reference for someone who is very familiar with Java/C++ style OO languages and is at least somewat familiar with UnrealScript in general. In particular, it is directed at those using UScript for academic purposes. I don't go in to a great amount of detail for many things, especially for things found in the UScript reference. Please Contact me if you see any mistakes, need for extra clarification on anything, or have any contributions to make.

Language Overview

For the most part, UnrealScript is very close to Java in syntax and behavior. Objects and inheritence are treated in a very similar way, and source code is compiled into something resembling byte code. There is an environment analgous to the JRE, in which Objects are instantiated and data is bound dynamically and function calls operate by making references to the underlying native code where appropriate. The parser uses a two-pass strategy.

  1. Like java, you will not have to use pointers directly or destroy objects. There is a service comparable to garbage collection that will do it for you.
  2. There are NOT separate header/source files. Declarations and Definitions are done in xxx.uc source file.
  3. Source files are compiled into a byte-code object file, xxx.u.
  4. You can only reference classes defined in the same package or in one that was compiled before the class that is referencing it. Package compilation order is determined by its order in in the EditPackages section of the xxx.ini file that UCC.exe uses (UnrealTournament.ini by default).
Conventions (this document)-

  • italics - used to represent keywords in UnrealScript
  • code - used when I give examples in compilable, UScript

Basic Syntax

Advanced Syntax-