- Unrealscript is a language developed solely for developing game content for Unreal. It is based on Java and C++, so if you have any experience in either of those languages, or just C, the learning curve for Unrealscript will be relatively small, but if you do not have any previous experience I strongly suggest that you first learn one of those languages and then return to Unrealscript. Unrealscript adheres to a syntax style common to both Java and C++/C, sharing many keywords found in Java.

- Unrealscript is an Object-Oriented-Programming language (OOP for short), which means that it is based on the concept of classes and inheritance.It is important to note that Unrealscript doesn't have all the features of a more complete OOP language such as Java, mainly it doesn't support things like multiple-inheritance, but luckily none of these missing features are necessary to make a fully functioning modification. There are several tutorials that will quickly get you acquainted with the concept of OOP if you are unfamiliar with it, Brandon Reinhart's being one that can be found here.

- A unique feature to Unrealscript that is not found in either Java or C++ is states. States are a feature that allows you to define different implementations of functions within the same class (very similiar to function overloading in OOP), and generally they are used for time-based programming. For example, say you had a Player class that contained 3 states, Walking, Running, and Idle. Say that you wanted the Player to do a flip in the air if he jumps while running, and that you didn't want to have him jump at all while standing still (or Idling). One way to do this using states is to define your jump function in both the Running and Idle states, then in the Running state code a simple flip in that version of the Jump function, and then code a standstill in the Idle state's version of the Jump function. So now when your player is running (and thus in the Running state) it will do a flip if it jumps, and will do nothing if its not running. Sorry if this isn't a very good example, but it should help make it a bit clearer how states can be very useful.

- Unreal stores Unrealscript code into packages (optionally along with textures, sounds, and models) in your Unreal\System directory. To keep all your new classes in a single package for easy distribution, just specify the same package name in the package field when you create your new subclasses. - Unrealed has a builtin class browser, editor, and compiler for Unrealscript which is easily accessible. Start up Unrealed normally and on your right there should be a collapsable tree starting with "+Actor" and having several other classes underneath it such as "-Brush" and "-Info". By clicking on the "-" or "+" next to a classname you can collapse/expand the class tree to show its child classes, and by double-clicking on the class name itself it will bring up an editable window with the class code (if there is any) inside it. By right-clicking on the class name you can bring up a small menu that allows you to create a subclass of the current class or edit the default properties. NOTE: For most modifications you will want to subclass pre-existing classes and save them to your own packages, because if you modify the original Unreal code you will not be able to play with other versions of Unreal due to mismatches (mainly as a cheat preventing measure I believe).

- To compile and save newly edited code just press F7 to compile all changed scripts, and then at the bottom of the tree select save, find you package, and click on save. Unrealed will then save you code (compiled or not) into a file in your Unreal\System directory by the name of your packagenamge and a ".u" extension (i.e. "blah.u" for the blah package). - Everything that is coded Unrealscript is derived from a very abstract and basic Object class, and from that we get many internal classes that deal with the engine itself (mainly sound, graphics, etc) and more importantly the Actor class which pretty much encompasses all of what you will want to modify for partial modifications. The Actor class defines the majority of standard variables and functions that are necessary for all classes, and all game-content related material is contained in classes derived from Actor.

- Players, weapons, artificial-intelligence, and even the game itself is derived from the base class of Actor. Important functions to note in Actor are BeginPlay(), Spawn(), Touch(), Tick(), and Destroy(). The BeginPlay() function is called whenever an instance of this class is put into play, into the game. It is very useful to initialize important variables and do other actions at the point of creation. The Spawn() function is used to create an instance of a class and put it into play. Touch() is called whenever this actor is touched by another actor, and is useful for causing damage or altering variables in the other actor.

- The Tick() function is called every game tick, generally as much as possible, so use it to perform actions continously or check for certain conditions. NOTE: Be careful not to put too much code into a Tick() function because it is very easy to overload the game and cause noticeable lag if too much is going on. Use the Destroy() function to destroy this instance of the class when you no longer want it to be in play. - The Pawn class contains the ScriptedPawn (AI), FlockPawn (Insect/Flock AI), PlayerPawn (Players), and more recently the Bot classes, essentially all of the "living entities" in a level. The Pawn class defines basic variables, movement and other miscellanous functions common to all Pawns. Health, Groundspeed/Airspeed, and JumpZ are just some of the useful variables found in all Pawns.

- PlayerPawn encompasses all players, a.k.a. clients, that are available in the game. It has several child classes, mainly UnrealIPlayer, then Human/Skaarj, and then the various male/female players. PlayerPawn contains all of the functionality of the players (movement, input handling) while the rest of the children classes handle all of the animations and sounds specific to the various players. The PlayerInput() and PlayerCalcView() are two functions that can be altered in your own classes to create some very cool modifications. PlayerInput() handles all input from the player, calls pertinent functions, and modifies appropriate data. PlayerCalcView() handles the calculations of the view of the player, and can easily modified to create a third person view, etc.

- The ScriptedPawn is where you will find all AI-related game content (the exception being FlockPawns). This class defines the framework which Unreal's Skaarj, Nali's, Queen, and every other creature you wil find in the game. The AI uses states heavily, and is based upon the common pathnode-using technique for navigation. Thankfully Steven Polge is a very good programmer, and has designed a very robust AI that can be used to make new creatures very easily with very little to no new code, using editable variables to define all aspects of the AI. - I strongly suggest you read Steven Polge's "Unreal Creature Care and Feeding Guide" (included in the reference section - eko)if you plan to do any major AI programming, or if you just want to get a more in-depth understanding of how things work.

- FlockPawns are special case AI that powers those wonderful schools of fish and swarms of flies that don't really do much other than look cool. You can modify these to make them a bit more intelligent if you wanted to I suppose, but they are pretty good at being insects already. NOTE: FlockMasterPawns actually handle the creation of FlockPawns, and you should spawn these instead of individual FlockPawns, as they are coded to self destruct if they don't have a FlockMasterPawn.

- The Bot class used to be found beneath the ScriptedPawn class, but has since been moved to just a child of Pawn as its AI is noticeably different than average ScriptedPawns in its function and purpose. This is the class to study if you think you've got ideas on how to make more realistic/deadly/unique Bots in Unreal. NOTE: Bots still share the same initial structure as ScriptedPawns, so Steven Polge's AI guide will also be useful for understanding Bots.
Copyright © 1996 Epic Games