<aside> ⚠️ Warning: Before beginning this tutorial, you should have already read through and completed the tutorials for creating weapons, advanced weapons, and assist items to have a good understanding of all previous concepts.

</aside>

While weapons drive the vanilla gameplay forward and it’s fun to rack up a high count of unique weapons for a varied experience, a lot of the modding scene revolves around class based modifications which add new characters to play, either variants of the weapon based gameplay or new characters which have a restricted kit.

This page will discuss creating multiple types of classes as well as briefly go into custom death states for a class. We’ll begin basic then work our way upwards. Files for each class are provided at the bottom of this page, so make sure to browse through those after following along with the tutorial.

As with everything before, classes are just actors which use weapons and items at the end of the day, so our previous knowledge will serve us well. Just the same, it’s easiest to understand what makes up a class by seeing and adding a default one first.

actor Megaman? : ClassBase
{
	player.scoreicon "135ST00"
	player.displayname "Megaman?"
	player.soundclass "megaman"

	player.forwardmove 0.8, 0.8
	player.sidemove 0.78, 0.78

	player.jumpz 10
	gravity 0.8

	Health 100
	Player.MaxHealth 100

	player.startitem "BaseFlagPack", 1
	player.startitem "ModeWeps", 1

	player.startitem "MegaBuster"
	player.startitem "BusterAmmo", 3
	States
	{
		Spawn:
			EMEG A 0
			EMEG B 1
			EMEG A 1
			Goto Spawn+2

		See:
			EMEG BCDE 5
			Goto Spawn

		Missile:
			EMEG F 5
			EMEG G 4
			goto Spawn+2

		ClassPain:
			EMEG H 0
			goto MegamanPain
		ClassDeath:
			EMEG H 0
			goto MegamanDeath
	}
}

The DECORATE actor above is an almost duplicate of the default class except changed to be stylized after the Mega Man? character, mugshot included. This class will also be unable to use all the vanilla skins, because its display name is different from Megaman, which most skins are designed to be for.

However, this actor alone isn’t quite enough to get us to this class being playable. We also need to tell the game to make it a class option, so we’ll create a [KEYCONF](<https://zdoom.org/wiki/KEYCONF>) file in the root of our project and add the following code to it:

addplayerclass Megaman?

These two elements combined are enough to get this class into the game and playable.

Basic Class Properties


Every class can and should define some properties to define some aesthetic options and its gameplay statistics.

We define a score icon for the class to determine which graphic should be drawn as a mugshot for the class. In the case below, the graphic 135ST00, a resized version of Mega Man?’s mugshot, is used.

player.scoreicon "135ST00"

The TEXTURES definition for that graphic looks as follows:

graphic 135ST00, 32, 32 {XScale 4.0 YScale 4.0 Patch FACE135,0,0} //Megaman?

We then define a display name for the class. This is the name that players will actually see in menus and UI elements in-game. Additionally, this is the name that should be used for any custom skins for the class or bots designed to play as this class.

player.displayname "Megaman?"

We should also define a sound class for the class. This will allow us to give unique landing or pain sounds to a given class. For now, we’ll just copy the default sound class, but we’ll see more examples of how this works in practice later.