Time for action – Using abstract
We'll use this modifier in our AwesomeWeapon
branch to see how it's useful.
Before we change anything, open up our test map in the editor and take a look at the weapon spawner properties. We can change the weapon it spawns to be an
AwesomeWeapon
instead of anAwesomeWeapon_RocketLauncher
:But if we look in our
AwesomeWeapon
class compared to the rocket launcher subclass, theAwesomeWeapon
class by itself is pretty useless. It doesn't have a static mesh specified, no firing modes or projectile classes or ammo count. If we change the spawner to useAwesomeWeapon
, in game we immediately get switched back to our default link gun.So with this in mind, why would we want
AwesomeGun
to show up in this list or be spawned in game at all? This is where the abstract modifier comes in handy.Change the top of our
AwesomeWeapon
class to the following:class AwesomeWeapon extends UTWeapon abstract;
Now compile and take a look at the spawner properties.
Now the class doesn...