| Home Page | Recent Changes | Preferences

TheHealer/TUTHealerAmmo

TUTHealerAmmo - The Healer Part 3 of 9

In this part of the Healer tutorial, we will set up our ammo class – what defines the ammunition for our Healer. Before we get into the code, make sure that your file is set up correctly.

Filename: {Base Directory}/TheHealer/classes/TUTHealerAmmo.uc

If you've changed the name of the package folder or the filename itself, make sure you make those changes throughout the code we'll be working with.

Quick Link: This is the complete source code for people who want to skip ahead. If you want to copy/paste into your file, this is the page to do it on.

Here's something that you should remember, as it may come up on the SAT's or something:

Weapon is to WeaponPickup as Ammo is to AmmoPickup.

This is to say, Ammo (like Weapon), is not what you see in the game.

Heading and Class Declaration

In order to keep our code reader-friendly (always a good thing if you need someone's help!), we will add a standard comment block to the top of the file. This will describe what's going on in the file.

After the comment block, we declare the class. Make sure you name the class with the same name as the filename, or bad things happen.

//------------------------------------------------------------------------------
// class name : TUTHealerAmmo
// class type : Ammunition
// description: The Healer's ammunition properties
// author     : HSDanClark
//------------------------------------------------------------------------------
// TODO       :
//
//------------------------------------------------------------------------------
class TUTHealerAmmo extends Ammunition;
  • Our pickup extends (or is a child of, so-to-speak) the Ammunition class.

Exec Directives and Variable Declarations

#EXEC OBJ LOAD FILE=InterfaceContent.utx

Here we load our texture package via an EXEC directive. This texture package contains the icon for the ammunition. We don't need any variables, since we have no functions.

Functions

None.

Default Properties

defaultproperties
{
    ItemName="Tutorial Healer Ammo"                     
    IconMaterial=Material'InterfaceContent.Hud.SkinA'
    IconCoords=(X1=545,Y1=150,X2=644,Y2=224)

    PickupClass=class'TUTHealerAmmoPickup'  // This links the ammo to the pickup
                                            // that you need to place in the game.

    MaxAmmo=120                             // The maximum Healer ammo you can carry

    InitialAmount=40                        // The amount of ammo you get when you 
                                            // first pick up the Healer
}

Check out the comments in the script for details. Notice that we don't define how much each ammo pack is worth when you pick it up! That amount is defined in the ammo's pickup class, which we will see next.

The Next Step

Continue to Part 4, TheHealer/TUTHealerAmmoPickup

The complete tutorial map:

  1. /TUTHealer – Our main weapon class.
    1. Filename: {Base Directory}/TheHealer/classes/TUTHealer.uc
  2. /TUTHealerPickup – Our weapon's pickup class, what you see on the ground.
    1. Filename: {Base Directory}/TheHealer/classes/TUTHealerPickup.uc
  3. /TUTHealerAmmo – Our weapon's ammo class.
    1. Filename: {Base Directory}/TheHealer/classes/TUTHealerAmmo.uc
  4. /TUTHealerAmmoPickup – The ammo's pickup class, what you see on the ground.
    1. Filename: {Base Directory}/TheHealer/classes/TUTHealerAmmoPickup.uc
  5. /TUTHealerFire – Our weapon's primary fire class.
    1. Filename: {Base Directory}/TheHealer/classes/TUTHealerFire.uc
  6. /TUTHealerAltFire – Our weapon's alternate (secondary) fire class.
    1. Filename: {Base Directory}/TheHealer/classes/TUTHealerAltFire.uc
  7. /TUTHealerBeamEffect? – The Healer's Beam Effect
    1. Filename: {Base Directory}/TheHealer/classes/TUTHealerBeamEffect.uc
  8. /TUTHealerAttachment? – Our weapon's attachment class.
    1. Filename: {Base Directory}/TheHealer/classes/TUTHealerAttachment.uc
  9. [/TUT The End]? – Putting it all together.

Discussion

The Unreal Engine Documentation Site

Wiki Community

Topic Categories

Image Uploads

Random Page

Recent Changes

Offline Wiki

Unreal Engine

Console Commands

Terminology

FAQs

Help Desk

Mapping Topics

Mapping Lessons

UnrealEd Interface

UnrealScript Topics

UnrealScript Lessons

Making Mods

Class Tree

Modeling Topics

Chongqing Page

Log In