I love the smell of UnrealEd crashing in the morning. – tarquin

Legacy:UnrealScript

From Unreal Wiki, The Unreal Engine Documentation Site
Jump to: navigation, search

Starting Points

  • UnrealScript is an object-orientated programming (OOP) language created by Epic Games for scripting in-game content for the UnrealEngine. In some ways it looks and acts like Sun's Java(tm) language. The core of the unreal engine does not run in UnrealScript, but parts of game events do.
  • For introductory tutorials, see UnrealScript Lessons. Features a set of simple tutorials to get you set up, and coding your first mutators.
  • Find language reference documents below (one within the Wiki), followed by more specific guides and examples.
  • Start playing with the GUI in the game with no coding required using the Interactive GUI design mode built into UT2003/4

Official Reference Docs

UDN Official Language Reference

Official documentation from udn2:UnrealScriptReference (udn.epicgames.com):

Fyfe: This is a work in progress, at the moment most of the above links to the UDN because it has better/more accurate description of the language functionality.

Side note: can we get an icon for udn interwiki links like the one we used to have for udntech and udncontent?

nogginBasher: The udn links don't work for me I get %23 instead of #. Anyway, I prefer the formatting on Tim Sweeny's UnrealScript_Language_Reference.  :)


UnrealWiki Core Language Reference

Syntax

We're also working on an Wikipedia:EBNF specification of the UnrealScript Grammar, but bear in mind it's fairly technical.

Geometry

Objects

Playing with the GUI

Extending Core Functions

See also Open Source.

Engine

Classes

  • Package – Very basic introduction to UT package files, and how they're assembled (.u, .utx, .umx, .uax, .unr)

How stuff works

Graphics

Other Things

Techniques

UnrealScript for Mappers

Pages that cover basics, aimed at mappers.

Scripting Utilities

Miscellaneous

External Links

Related Topics

Discussion

Wormbo: Something makes me feel this page needs to be refactored since it's the portal to all UnrealScript-related topics.

Tarquin: yes! Any ideas?

scumble: The page might be better split up a bit. The section named "Core" is really about basic functions in UnrealScript, a reference guide really (could be named more instructively) and "Engine" is essentially about exploring implementations in UnrealScript of more elaborate game functions. It would work nicely on a page of its own.

Recondite Maybe I'm missing something, but after trying to do some rather simple OO operations (initialize an array of complex class instances outside of a function/prior to the actor loading default props to the editor), and not finding any documentation saying this is possible...(is there an init method?)...and running into the struct by-value / lack of true inner class capability...and where is the map class... maybe it's a documentation issue, but i really don't agree with emphasizing that unrealscript is a java-style language. it is a scripting language with quite a few quirks, and doesnt seem to have a full feature set needed for OO work. but (sigh) perhaps i should write up a page to discuss the differences.

El Muerte: there's no init function that is called before the defaultproperties are set. In the defaultproperties however you can initialize arrays with complex things. But you can only use Object classes and not Actor classes. This is, for example, how the whole GUI system works. When a class instance is created the first thing done is loading the defaultproperties. After that some events are called, depending on if it's a Object or Actor (when an Object is created the Created() event will be called, for Actors the first event would be PreBeginPlay()), do your initializing there.

The map data type has no unrealscript implementation (yet), so you can't use it.

And UnrealScript is a java-style language, note the -style, nobody claims unrealscript is like Java, so don't expect the same features of java within unrealscript (for that matter, Java doesn't have support for enums (not yet anyway), structures, etc.). It's just that the way classes are handled in UnrealScript can only be compared to Java, there is, afaik, no other language looks more like UnrealScript than Java. UnrealScript has all the features for the basic OO principle, sure it doesn't implement all OO principles, but afaik know there's no language that does.


xX)(Xx: Didn't know where to put this, so sorry if its a little off-topic, but it seemed a sensible place to ask anyway, is there any kind of limit as to how many mutators you can have, coz recently, none of the mutators that I download or create, don't show up in the choose mutator list, as i have a LOT of mutators, i am guessing this is the case, i have reached the limit as to how many mutators it is possible to have :( can anyone clarify this, or point out a soloution/fix ? thanks :)

Tricadex: The limit seems to be 250, http://www.planetunreal.com/mutation has(had, they havn't updated in a while) a contest to see if anyone could get more :)

El Muerte: there is no real limit, never has been. However pre-UT2004 having a lot of mutators slows down the game during start-up. In UT2004 the mutator info is cached. Also this is not the right place to ask, the Help Desk is the right place.


Fyfe: A plan for refactoring. This page has turned into an overview page for coding not unrealscript, the plan in my head at the moment is to make this page an intro&/overview for unrealscript "The Programming Language". The rest should be moved out to a page covering the UnrealEngine and a page covering Coding and/or Moding.

note: most of these pages need refactored as well.

Fyfe: Just noticed the best solution for the refactoring of this is in the title of my plan, udn2:UnrealScriptReference. This describes the language better than any of the pages in the list above.