Wikis / Unreal Wiki / Legacy:TheHealer/TUTHealerAmmoPickup

TUTHealerAmmoPickup - The Healer Part 4 of 9

In this part of the Healer tutorial, we will set up our ammo pickup class – what you see in the game. Before we get into the code, make sure that your file is set up correctly.

Filename: {Base Directory}/TheHealer/classes/TUTHealerAmmoPickup.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.

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 : TUTHealerAmmoPickup
// class type : Pickup
// description: The Healer's ammunition pickup properties
// author     : HSDanClark
//------------------------------------------------------------------------------
// TODO       :
//
//------------------------------------------------------------------------------
class TUTHealerAmmoPickup extends UTAmmoPickup;
  • Our pickup extends (or is a child of, so-to-speak) the UTAmmoPickup class.

Exec Directives and Variable Declarations

None.

Functions

None.

Default Properties

defaultproperties
{
    InventoryType=class'TUTHealerAmmo'
 
    PickupMessage="You picked up Tutorial Healer charges."
    PickupSound=Sound'PickupSounds.LinkAmmoPickup'
    PickupForce="LinkAmmoPickup"
 
    AmmoAmount=30
 
    CollisionHeight=10.500000
    MaxDesireability=0.240000
 
    StaticMesh=StaticMesh'WeaponStaticMesh.LinkAmmoPickup'
    DrawType=DT_StaticMesh
}
  • AmmoAmount – Like I said in Part 3, this is where we define how much ammo is in each ammo pack.

The Next Step

Continue to Part 5, TheHealer/TUTHealerFire

The complete tutorial map:

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

Discussion

Page Information

2022-11-18T16:03:02.864939Z 2003-11-21T03:12:02Z HSDanClark * https://wiki.beyondunreal.com/Legacy:TheHealer/TUTHealerAmmoPickup Attribution-NonCommercial-ShareAlike 3.0