The three virtues of a programmer: Laziness, Impatience, and Hubris. – Larry Wall
UC File
UnrealScript source code is stored in plain text files with the extension ".uc" and a file name matching the name of the UnrealScript class declared in the file. You can edit this with any text editor, though we recommend you use something that supports syntax highlighting.
Source files can use either Latin1 (ISO-8859-1) or UTF-16 with a byte-order mark as character encoding. The compiler only looks for the UTF-16 byte-order mark to decide between these three encodings: If the first two bytes in the file have the values FE FF
, UTF-16 with big endian byte-order is assumed, while the values FF FE
stand for UTF-16 with little endian byte-order. In any other case plain 8-bit encoding as Latin1 is assumed.
Particularly UTF-8 is not recognized and may cause an "unrecognized character 'ï'" parse error because the UTF-8 marker (byte values EF BB BF) is interpreted as the three characters "" in the Latin1 encoding. If you run into this error, reconfigure your text editor to save either in an 8-bit encoding ("ANSI", "ASCII", "Latin", "ISO-8859-1" or "Windows-1252") or in UTF-16 (or its predecessor UCS-2) with byte-order mark. Don't select UTF-16LE, UTF-16BE, UCS-2LE or UCS-2BE as encoding, those won't include a byte-order mark and the compiler won't detect the proper encoding of your file!
Note that you probably won't get any compiler errors if you save source files in UTF-8 without the UTF-8 marker sequence. However, you may run into problems with string literals if they contain any characters outside the ASCII character set. This includes currency symbols other than the dollar sign, German "umlauts", French characters with accents, Cyrillic or Greek characters and special punctuation characters like the Spanish inverse exclamation and question marks or typographic quotation marks. If you want to use such characters, save the file in UTF-16 format.
Please help improve this article or section by expanding it. |
Shell Integration[edit]
You can add UnrealScript files to the Windows Explorer context menu's New list. This conveniently makes a file with the correct extension, and you can also use the template below to set up the basics of the class.
//============================================================================= // //============================================================================= class extends ; defaultproperties { }
With TweakUI[edit]
If you have TweakUI installed, save the above script and a UC file anywhere, and drag the file onto TweakUI's New tab.
Via the registry[edit]
Otherwise, save the script in C:\WINDOWS\ShellNew\UnrealClass.uc
Then in the Windows Registry, create a key:
HKEY_CLASSES_ROOT\.uc\ShellNew
Add the value:
FileName UnrealClass.uc
Declarations | Preprocessor • Classes • Interfaces • Cpptext • Constants • Enums • Structs • Variables (Metadata) • Replication block • Operators • Delegates • Functions • States • Defaultproperties (Subobjects) |
---|---|
Types | bool • byte • float • int • name • string • Object • Class • Enums • Structs (Vector ⋅ Rotator ⋅ Quat ⋅ Color) • Static arrays • Dynamic arrays • Delegates • Typecasting |
Literals | Boolean • Float • Integer • Names • Objects (None ⋅ Self) • Vectors • Rotators • Strings |
Flow | GoTo • If • Assert • Return • Stop • Switch • While • Do...Until • For • ForEach • Break • Continue |
Specifiers | Super • Global • Static • Default • Const |
UnrealScript | Syntax • .UC • .UCI • .UPKG • Comments • #directives • Native |