All languages

UnrealScript languagehistorical

Epic's native Unreal Engine scripting language: a single-inheritance, compile-time-checked object system with states, latent functions and replication built in. Removed in Unreal Engine 4 in favour of C++ and Blueprints.

Overview

UnrealScript is Epic's built-in scripting language for Unreal Engine 1 through 3, a Java-style object-oriented language designed by Tim Sweeney for gameplay code. It puts time, actor state, and network replication into the language itself, so gameplay logic reads as linear sequences rather than frame bookkeeping.

Code

class Counter extends Object;
var int Count;
var float Rate;
function string Describe()
{
  Count = 42;                    // int
  Rate = 1.5;                    // float
  return "count " $ string(Count); // $ joins, the cast renders the number
}
A class is the abstraction and Super reaches its inherited version; foreach walks the dynamic array; Sleep is latent — only state code may call it, entering at Begin, and the defaultproperties tail plays the constructor's part.

Distinctive traits

  • States are language-level: each actor is in exactly one, their functions shadow global ones, and PushState/PopState stack them.
  • Latent functions inside state code make timed sequences linear; the engine simulates a per-actor thread instead of running OS threads.
  • Replication is declared, not coded: server, client, reliable and simulated specifiers place each function, and repnotify marks variables to notify on.
  • defaultproperties replaces constructors and feeds UnrealEd's editable properties marked with var(); classes have no constructors or destructors.
  • Single inheritance from Object with compile-time type checking, garbage collection, and case-insensitive identifiers throughout.
  • Speed was traded for safety deliberately: the 1998 reference measures scripts at roughly 20× slower than C++, so heavy work stayed in native code.

Status

Historical: it shipped with Unreal in 1998 and served Engine 1 through 3, including Unreal Tournament. Epic dropped it for Unreal Engine 4, moving gameplay code to C++ and Blueprints; the UDK documentation remains its reference.

Sources & references