Sniper's Paradise-Unreal compiling tips


Assumptions

Its assumed that you know how to open a DOS-box and navigate through directories. Also you should have UnrealEd up & running before continuing to read this tutorial.

The tutorial

There are two ways of coding & compiling your UScripts. One is using UnrealEd, the other is with a text-editor (the coding part) and ucc (for compiling). Both compiling process will be covered.

Using UnrealEd

This is the easiest way to code if you're new to the world of UScript. Use the "Browser" window on the right of the screen, and set the top listbox to "Classes". Now you will see all the child classes of the Actor class. Those are the ones you'll use most of the time.

You can click the minus to expand the tree and see even more classes. To view the code of a class, double-click on its name. To create a new child of a class, click on its name, and then click the 'New' button at the bottom of the screen. This will show a box where you can type the name of the new class, and the package it will be stored in.

To compile your newly created code, hit F7. If there is any error, UnrealEd will tell you, and jump to the appropriate line of code. Remember you have to save your packages (the 'Save' button at the bottom of the 'Browser' window) before you can use it! You have to compile and save each time you've changed a class and want to test it out.

UnrealEd has a nice syntax highlighting. Unfortunately, the right colors will show up after you've compiled your code, and not while typing it. Another plus for UnrealEd is the ability to easily browse the classes tree.

UnrealEd also has some negative things. It is really slow, and often interprets a single-click as being a double-click. When working on two classes simultaniously, you often have to scroll the browser window a lot, which will become quite annoying after a while. It is impossible to add meshes to your package from UnrealEd. Of course, you can use separate mesh packages, but your class is much easier to distribute and install if everything is in one file.

Using UCC

A more prefered method is to use UCC. You can use any text editor you want, which is usually MUCH faster than UnrealEd..

To prepare your computer for coding and compiling without UnrealEd, you have to export all the .u files to their textual representations. To do this, fire up UnrealEd, and click the "Export All" button in the classes browser. This will create a subdirectory for every package in your Unreal directory, with all the classes in the 'Classes' subdirectory. An example:

The package MasterSniper contains the following class:

Exporting this package will create the following files and directories:

Unreal
    +--- MasterSniper
            +---- Classes
            +----- MasterSniper.uc

The files can then be edited by any text editor you want.

To compile your code, you have to follow these steps:

  1. Add your package to the EditPackages list in Unreal.ini. Open Unreal.ini and locate the lines starting with "EditPackages=". Add "EditPackages=MyPackage" to the end of the list.
  2. If the file already exists, remove MyPackage.u file from Unreal\System\MyPackage.u. UCC will only compile packages which are in the "EditPackages" list, and which don't exist yet.
  3. Open a dos prompt, CD to the System directory of Unreal, and type: ucc make. This will start the compiler. If there are any error messages, edit your code and go back to step 2. If everything is clean, fire up Unreal to test your newly created class!

Replace every instance of "MyPackage" above with the name of the package you want to compile.

Those steps might seem like a waste of your time and your brains. But believe me, once you get used to it, it's a much nicer way to code.

Sometimes you are forced to use the UCC method. For instance, if you've created a new mesh for a weapon, you HAVE to create the package with UCC, otherwise the mesh won't be included in it!

Unfortunately, this method doesn't allow you to quickly see which classes are decendants of.



Spam Killer

Back To Top
2005 Sniper's Paradise
All logos and trademarks are properties of their respective owners.
Unreal™ is a registered trademark of Epic Games Inc.
Privacy Policy
Website by Softly
Powered by RUSH