Unrealscript

The two things I have done in Unrealscript are set up a mod environment in ut2k4 for some coworkers and I’ve written a couple custom objects for my ut2k4 map: Snowed In. The objects I have made are listed below with links to the actual code.

Snowed In Unique Scripts

The two objects that I created for Snowed In are very shallow modifications of existing objects that apply some team checks used to manage default functionality. If you know some UnrealScript you’ll notice that the default properties section is missing from each class. This is because these scripts were embedded in my map which when done prevents you from having a default properties block. Instead you set these in the editor after you add your class.

TeamUTJumpPad

The title says it all. It’s just a jump pad that only works if you are of a specific team. In Snowed In the jump pads at each base only work for that base’s team. This was implemented to foster the tug of war aspect of CTF that could be otherwise limited by the map’s smaller size. If a person from the opposite team tries to use a jump pad, that person is gently pushed off and an error sound is played instead of the usual jump sound. Click on the image to the left to see the full class.

TeamKillPlayerVolume

This class was originally inherited from LavaVolume but in the end that brought on more pain then it helped. I ran into all sorts of bugs with bots not being able to path in the volume, to weapons being deleted by the volume. In the end, this much simpler approach worked best. The goal of this custom object is to kill a person, upon entry, if they are of the opposite team. These volumes are placed in the spawn rooms of my Snowed In map just above the forcefields. The goal of these was to make sure no one could get up inside the spawn rooms and spawn camp. You’ll also notice some code in there for handling flag carriers. During play-testing I quickly noticed that with the initial implementation flag carriers could hide safely in their spawn room if they used the air cannon. Now the class checks for a flag on each person that enters and if it finds one, sends that flag home.