I search for solutions in this order: Past Code, Unreal Source, Wiki, BUF, groups.yahoo, google, screaming at monitor. – RegularX
Legacy:Using UCC Under Linux
Note: currently UCC is not fully implemented in the linux version of UT2004; however, linux is not without hope, we can use the tool Wikipedia:WINE to compile our Unrealscript. This tutorial shows how to do this as well as some other cool things we can do (so this will be usefull if/when UCC is fully implemented under linux).
- WIN_HOME = The directory that contains UT2004 for windows
- NIX_HOME = The directory that conatins UT2004 for linux
- Your favorite flavor of Linux (I'm using Gentoo)
- Some version of wine (winex, cedega, wine_cvs, etc)
- A Text Editor (vim, emacs, nano, pico, etc)
- A retail copy of UT2004 (yep, we actually have to purchase software)
- Latest UT patch (3323 as of this writing, but check the page UT2004)
- UT Source (again 3323)
- ut2k4_linux_sdk (Optional: 42MB)
There are several ways of setting up UT under linux so I'll describe the ways below.
The most generic type of setup that requires the most hard disk space.
- Install UT2004 Linux version
- Install UT2004 Windows version using wine
- Patch both to the latest version of UT
- Unpack the unreal source into the WIN_HOME directory
Now you are ready to start writing Unreal Script.
Your source code will be written in the WIN_HOME directory. Once you have compiled (shown later) your source then you will need to move a minimum of 3 files to your NIX_HOME directory.
The 3 files are yourpkg.u, yourpkg.ucl, and yourpkg.int. These files should be found in your WIN_HOME/System directory and copied to the NIX_HOME/System directory.
Requires the minimum space but compilation files and binary files get mixed together.
- Install UT2004 Linux version
- Install UT2004 WIndows version using wine
- Patch both
- Now Copy all files from the WIN_HOME/System to NIX_HOME/System
- Delete WIN_HOME and all of its contents
- Unpack UT source into NIX_HOME
Now you are ready to start compiling and writing your Unreal Script
Linux SDK setup 1
Requires ut2004_linux_sdk (This is an "environment" that I have created for making unreal scripting easier on the linux user – the latest version has handles variables repeatedly used in the old scripts implemented by Chris Guirl and David Redick from CLUG).
- Install UT2004 Linux Version
- Unpack the latest version of ut2004_linux_sdk anywhere ( preferably somewhere other then NIX_HOME)
- Run the setup script found in ut2004_linux_sdk directory
- setup symbolically links files needed to compile UT as well as creates a file in your home directory to store values used in the scripts.
- Usage: setup utenv where ut_env is a directory provided in the sdk.
You are now ready to compile your Unreal script code. Note, that we only have 1 full vesion of UT installed. The sdk provides all necessary files for compilation. setup symbolically links directories found in NIX_HOME that the compiler needs such as Textures, Sounds, etc. Here you will put your packages inside utenv.
Linux SDK setup 2
Basically the same as "Linux SDK setup 1" except your source files can be stored in a directory other then utenv. Here's what you need to do.
- Follow Linux SDK setup 1
- Create a directory somewhere for your project. (example mkdir /home/user/UTMod)
- Create a System directory inside your project dir (example mkdir /home/user/UTMod/System)
- Use utlinkpkg to symbolically link your new project
- Command Line
- Usage: utlinkpkg pkg_dir
- where pkg_dir is the full path to your new project directory
- Usage: utlinkpkg pkg_dir
You can now compile your package like you would if the package was actually in ut_env.
Compiling using Wine
As noted at the top of the page, we cannot use the UCC provided in the linux version.
Hence, we need to use UT's windows version. By now you should have the necessary tools to compile so lets push on.
I am currently using cedega so the examples listed below will be using "cedega" but you can replace cedega with your version of wine (ie. winex, wine, wine_cvs, etc).
To compile the UT source (without any of your modifications) then you can do this command
- cedega UCC.exe make
UCC is the unreal script compiler. Make tells the compiler to compile your source.
UCC make doesn't work exactly like gnu make
With gnu make, if you modify a source file then make knows about this and recompiles the needed files.
However, UCC does not do this. It looks in your System directory for the .u files corresponding to the packages listed in the Game .ini file (Think of this as your make file). If the .u is present, then it doesn't attempt to compile it; however, when the .u file is not present then it looks for your source and tries to compile it. I have written scripts to make this automatic for you,but if you do it on your own, then you need to remember to delete the .u files that you want to recompile.
To use a different "make file" you can copy and paste the default make file called UT2004.ini located in your System directory to a new file (like UT2004_make.ini). Here we can edit this file to only compile packages that we need. Inside this file there will be several lines that have EditPackages= in it. EditPackages tells the compiler which packages to compile. In your new file you can remove those packages that are not needed by your package that you want to compile (btw, you need to add your package name like this EditPackages=UTMod)
Now we are ready to compile with the new .ini file.
- cedega UCC.exe make -ini=UT2004_make.ini
Thats it, UCC now uses UT2004_make.ini for its make file.
These are provided in the SDK to make your Unreal Scripting easier. Feel free to use, modify, or ignore them, its up to you :)
This removes and compiles a package as well as moves the package to the NIX_HOME.
- Usage: utmake [class] [makefile]
Where class is the name of the package to compile and makefile (optional) is the game .ini to use.
Useful for searching for the location of class files in the source directory.
- Usage: utfind [class]
Where class is the source file you are looking for.
Example: I am looking for class xPawn because Monster.uc extends it but xPawn isn't in the same directory as Monster.uc. so do
- utfind xPawn
Useful for looking at the ut files that you found with utfind.
- Usage: utedit [class] [ext]
Where class is the name of the file (without the extension) to be looked in and ext is the extension (ie .uc, .ucl, .ini, etc). If ext is not given, .uc is assumed.
Used to symbolically link project directories so that you do not have to move src code into the utenv directory structure.
- Usage: utlinkpkg [package]
Where package is the path to the directory with the src code that you want linked.
Ever get tired of clicking through the menus just to play a mod you are working on and you don't remember what the command line parameters are for starting ut with your mod?
Well, utrun does it for you.
- Usage: utrun [map] [gametype]
Where map is the map to start wit and gametype is the gametype to use.
You avoid going through the menus by using this script.
Foxpaw: Should this page possibly be renamed? "The Linux Way" would be a catchy title for a magazine article, but as this is a more reference oriented medium, I think that the title should give some indication to what the page contains, other than just the fact that it has something to do with Linux. "Using UCC under Linux," or "Coding under Linux" or something like that seems better to me. "The Linux Way" is also not very amiable to being linked to.
Conzar: Agreed. My title is catchy :) but not the best at describing this page. So how do I change the title???
Foxpaw: Err, actually you can't. You can make a new page and copy everything there, or we can probrably just leave these comments here and tarquin will probrably see it and change the name.
Conzar: Ok. Well, I'm going to continue to work on this then.
Tarquin: done :) Remember to make use of other pages in the wiki by linking to them :) (I've done a few for you)
Conzar: Thanks for the edits and renaming the page.
Conzar: Note, I updated script definitions to the lastest version.
thelusiv: With the setup script there, are the first two methods (the bloated and jumbled setups) really necessary? They're not really the ideal way to set it up and only seem to make this page more confusing...
Conzar: Well, they are necessary if the user does not want to use the sdk provided. I think it also helps those understand why the sdk is cool. But what does everyone else think? Should we re-order those subtopics, remove them, or leave it be?
thelusiv: Maybe there should be a page dedicated to doing it by hand using Linux, as well as a separate page about the SDK. That would significantly reduce clutter and keep all the information.
strider: I'm tring to compile a mod (Unreal Annihilation) using linux (I'd really rather not have to boot into windows anymore purely because of compiling!) I try wine ucc.exe make -mod=Annihilation2k4 but I get the following error: fixme:process:GetProcessWorkingSetSize (0xffffffff,0x40dce6d8,0x40dce6d4): stub. After this, the CPU goes to 100% until I press ctrl-c, where it exits with the error code 1.
MythOpus: I'm definately not the hugest Linux person (I don't use it at all, although my dad put it on here) but isn't it unnecesary to type in ucc.exe make -mode=Annihilation2k4? Doesn't it still look in it's directory for the ut2004.ini and compile all packages neccesary?
strider: It's a seperate mod, a total conversion. So yeah it's necessary. Typing ucc make -mod=annihilation2k4 works on windows, but not linux using this setup.
OlgaB: Is there any way to get UCC support in UT1?
Wormbo: Use WINE to run ucc.exe from the Windows version.