TheHealer
This tutorial is written under UT2003 build number 2225.
A New Weapon: The Healer
Actually, the name is a bit misleading. The first firemode will heal a friendly unit, while the second will damage an enemy unit. Our main objective in this tutorial is to set up a working weapon with custom properties, which will be outlined below. Although this weapon is based off of the Link Gun, it does not extend the Link Gun – it extends Weapon. Don't worry, it'll all make sense in the end.
- In UT2004, the secondary (beam) of the Link Gun is used to heal vehicles and Onslaught control points.
Prerequisites
You must be familiar with the following pages/concepts to use this tutorial successfully.
- Setting Up UnrealScript
- Set Up Package Folders
- Reading and comprehending UnrealScript Hello World wouldn't hurt either.
Preferences
This tutorial will not require any particular IDE, but an IDE is definitely recommended. See Setting Up UnrealScript for a list of good ones, IDE for an explanation of 'em, and WOTgreal for this author's personal favorite.
Each page of the tutorial will feature the complete code for each class, but getting them to work right together in your compliler is up to you, since this isn't written with any particular IDE in mind.
Let's Get It On!
Our Healer will have the following properties.
- Primary Fire – A solid green beam that will heal a friendly unit.
- Secondary Fire – A solid red beam that will damage an unfriendly unit.
Your Package: The tutorial will assume the following about your directory structure:
- TheHealer will refer to your package directory.
- {Base Directory} will refer to your UT2003 folder and it's location, be it C:, D:, or whatever – {Base Directory}/TheHealer.
- Under /TheHealer resides the classes folder – {Base Directory}/TheHealer/classes. This is where each of the 8 .uc files we're going to create are going to live.
This is the complete list of all the pages in the tutorial. Each page will have this list along with the next step at the bottom. Each page (except for the last) represents a class, and each page name is also the name of the class.
Parts 1-6 are now live. I know I was going to have the rest done on Saturday, but I've been nursing a cold. Bear with me .
- /TUTHealer – Our main weapon class.
- Filename: {Base Directory}/TheHealer/classes/TUTHealer.uc
- /TUTHealerPickup – Our weapon's pickup class, what you see on the ground.
- Filename: {Base Directory}/TheHealer/classes/TUTHealerPickup.uc
- /TUTHealerAmmo – Our weapon's ammo class.
- Filename: {Base Directory}/TheHealer/classes/TUTHealerAmmo.uc
- /TUTHealerAmmoPickup – The ammo's pickup class, what you see on the ground.
- Filename: {Base Directory}/TheHealer/classes/TUTHealerAmmoPickup.uc
- /TUTHealerFire – Our weapon's primary fire class.
- Filename: {Base Directory}/TheHealer/classes/TUTHealerFire.uc
- /TUTHealerAltFire – Our weapon's alternate (secondary) fire class.
- Filename: {Base Directory}/TheHealer/classes/TUTHealerAltFire.uc
- /TUTHealerBeamEffect? – The Healer's Beam Effect
- Filename: {Base Directory}/TheHealer/classes/TUTHealerBeamEffect.uc
- /TUTHealerAttachment? – Our weapon's attachment class.
- Filename: {Base Directory}/TheHealer/classes/TUTHealerAttachment.uc
- [/TUT The End]? – Putting it all together.
Important: If you decide to change the package directory name, the script filenames, the class names, or anything else that I've outlined here, make sure you pay close attention to each change throughout the process. Sometimes these things can sneak up on you
Discussion
RegularX: There is a weapon (Aura Rifle) in the xxxpak that also does this, albeit it's a bit crude and high on my rewrite list.
GRAF1K: Ah, but there's no AuraRifle? tutorial, is there?
RegularX: No, because the author of the xxxpak is a lazy SOB . This tute is looking quite nice DanC, good work on organizing a really complete weapon tute.
Tarquin: Could you use Base Directory instead of your BaseDir/UT2003 thing please? See that page for details.
HSDanClark: I didn't know that page existed or I would have I'll go through and make the changes on the other pages in a little while.
Tarquin: Cool. See, we think of many things on the Unreal Wiki