 |



|
|
Basic Coding Part 3
Now we have all of our scripts done, and we are ready to compile and test it out. There are several ways to do this, the one I will use in this tutorial is the umake method.
Code Compiling Using UMake
Before we get to UMake, we have to tell the engine that we want our package compiled. Find the UT2003(4).ini file in your UT2003(4)/system folder. Find the [Editor.EditorEngine] section, and add our package at the end of the EditPackages part.
Save it and leave it open. I've found that the editor will sometimes forget things you add to the ini, so you might have to resave if it does that to you.
Now to get to UMake. We have to go through DOS to get to the commands, so hit the Windows Start button and click on Run. In the window that comes up, type command and hit Ok.
Our DOS prompt will appear. Now we have to navigate to our UT2003(4)\system folder. If you have it installed in the default directory (C:\Program Files\UT2003(4)), then all you need to do is type out what I have highlighted in pink here:
If you've installed it on a different hard drive, use this command to switch:
When you type "ucc make" into the DOS prompt, you will see the program go through and Release all of the Epic packages, it only compiles code where the .u file is missing. Since we added ours to the .ini, the program will see that the .u file is missing and compile the code in the folder with that name. If you have typed everything correctly and not missed any semi-colons or brackets, it should compile correctly and you will see the following:
If an error message shows up, look at the file name and error it gives, and go back and fix the error, then type ucc make into the DOS prompt again to recompile. You might have to resave the .ini file if the editor forgot your new package.
Ok, we have our .u file, but now what do we do with it? Open up the editor and create a small test level with a playerstart and an xWeaponBase. In the Actor Browser, hit File >> Open and find our UberLinkGun.u file. Open it, then go back to our xWeaponBase. It will now show up in the weapon list, so choose it.
Save our level as DM-UberLinkGunTest, then go in and check it out!
It appears on the base ok...
Our pickup message works!
Fires great...
If we type behindview 1 in the console, we can see that it looks right in the third person view too!
Ok, we got our custom weapon working great! There are a few things that we could change, like the muzzle flash and the firing sound, but I'll leave that to you to experiment with and figure out, along with any other changes you want to make. Have fun with it!
That's it for this tutorial. This is meant only as a starting point, coding is a very difficult thing to get into if you do not know similar languages such as Java or any other object-oriented programming language. I will not be able to help you much if you email me asking how to do a specific thing, but I can point you to some general programming tutorials and information. If you have any questions about what I have covered in the tutorial however, feel free to email me. Have fun and good luck!
Download the Example Map, Source Scripts and Compiled .u File (12kb)
Back To Tutorials
|
|
|