Getting StartedIf your like I was you will probably want to get started coding as soon as possible, so I will get started quickly and might go sorta fast so you can start having some good fun. Notepad++The very first thing you need to do is download notepad++, this is not absoultely necessary but you should never use something like notepad to program in ut04. When you start getting errors it will generally tell you a line number, and you would be lost without notepad++. (I'm not saying you should just ignore me and use notepad anyway, I'm saying stop reading right now and go download notepad++...) Ok, so now that you have notepad++ installed, you can start doing some cool stuff. Setting up UCCOpen up the command line (start menu, run, type "cmd", then hit enter). You are doing this because the program used to compile (ucc.exe) is command line based, and the UT3 one is too. Now you need to "cd", or change directory, to your ut2004 system folder. I installed ut04 to C:\Program Files\UT2004 so to get to the System folder in there I can simply type in
and hit enter. I believe the default install location is just C:\UT2004, so the command for that would be
Now that you are in the right directory you can simply type Looking at others codeWhen you are decompiling stuff you need to be aware of what you do with it. Whenever you use someone elses code you should always ask them first, ALWAYS. Most people are ok with you just looking at their code, but before you ever put anything up to the public always check with the original writer of the code (if their is one) to make sure that it is ok with them too. They will probably say yes, and will also probably ask you to include them in credits. Be sure to do this. (Even if they don't ask you to credit them, do it anyway). Compiled code is put into a .u file. Make sure the .u file you want to decompile is uncached. (I am assuming you have already done this). To be able to uncompile you need to use the ucc.exe program. First, cd to your system directory, as detailed in the Setting up UCC section. Then, you need to know the name of the .u that you want to decompile. Since the UT2004 RPG is extremely popular, I will use it as an example. The command is as follows:
Copy and paste that in and hit enter. It will scroll through a bunch of stuff telling you whats going on. When its done, it should give you some kinda success note. Good job. Look in your ut04 dir and you should see a folder called UT2004RPG. In there will be a folder called Classes. Open that and you see a bunch of .uc files, thats all the code for the ut2004 rpg. Good stuff. Adding extra abilitiesOk, first open up the folder with all the source code for the ut2004rpg. Take a quick look though some of the files and see if you can kindof get an idea of whats going on. If you have no idea, thats ok too. The way that I recommend adding abilities to the RPG is to make another package, and have it depend on the original UT2004RPG.u package. If you recompile the UR2004RPG.u then whenever you join a server with it you will get a mismatch, whoever you give it to that joins a server with the rpg will get a mismatch, and its just a really really bad idea anyway. So, in your UT2004 directory, create a new folder. Call it something related to the ability you want to add, say, for an example lets use "BetterRegenAbility". You don't have to call it this but all your code will be called you whatever you have this folder named, then a .u after it once you compile it. So, choose a relative name. If you plan on adding more than one ability then its common to name it something like "druidsRPG" or "vortexsRPG". So, heck, just go ahead a call the folder something like that so you can have all your new abilities in one package. Inside this folder make another one called Classes. Your code goes in the Classes folder. Now, pick the .uc of the rpg ability you want to modify and copy/paste it over to your new classes folder. You should now have something that looks like this. Now rename your .uc file to something like "AbilitySuperRegen" or something like that. At the top where it says "class AbilityRegen extends RPGAbility" change that to your new name, for me it is AbilitySuperRegen. This is creating a new class file that you can modify freely without worrying about messing any of the other rpg stuff up. Look at the code now, (its somewhat self explainatory in some parts) and see if you can figure out what some stuff means. Mine looks like zis:
Ok, so the part most people want to mess when they start coding is the default properties. Theres always some fun stuff to be changed in there. Everything there is obvious what it is, so go ahead and have some fun and change it around just as a test.
So now that you've got some code that you want to see ingame, you need to compile. Compiling is kinda like translating the code to something the computer can run in the game. It is necessary to do if you want your stuff to work. So, make sure you've set up ucc (as described in the section above) and prepare to compile. CompilingOpen up a window to your ut2004/system folder. Open up the file called UT2004.ini. Scroll down to about line 500. You should see a bunch of lines that start with "EditPackages=", this is what the compiler checks each time (or "edits") to make sure that the packages are compiled. If they are not then it compilies it (or tries to). So, since you want your code to compile you just add another line in that says something like "Editpackages=SickNasyRPG". BUT, since your package is dependent on the UT2004RPG, you need the editor to see that first, so it knows what the heck is going on with your new code, otherwise, it should pop up an error saying something along the lines of "class RPGAbility not found". So, after your ini editing your edit package lines should have these extra lines: (with your package name)
Save the ini and open back up the command line. You should already be in your system folder, (if not refer to "setting up ucc") and type in the following command:
Press enter. You should see some stuff move across screen and in the end hopefully it will look something like this. Yay! Success! If you look in your system folder now you will see a SickNastyRPG.u file. This is your compiled code. The next step is actually getting your new ability to show in game. Getting the Ability in gameThis requires a little more ini editing. Actually, you can do this in game but I prefer just editing the ini cause its easier. In your ut2004/system folder open up the file called UT2004RPG.ini. If you don't have this file just play the UT2004RPG once and it will make one. Scroll down to about line 50 and you should see some lines that start with "Abilities=". To get your ability in, all you have to do is add another one of these lines. In my case, my line would look like this:
You can see that I replaced UT2004RPG with SickNastyRPG because that is the package name that my ability is in, and AbilitySuperRegen is the class name of my ability. Now, open up unreal and play a game with UT2004RPG as a mutator. You should see your ability on the list. Mine worked great. |