Skip to content
This repository was archived by the owner on Feb 19, 2021. It is now read-only.

Making Classes

Steven Webster edited this page Feb 18, 2021 · 15 revisions

As of Pre017, making subclasses got a whole lot easier, organized and just better.

In config:

Debugging

If you believe you've encountered an issue, there is a debug option that is set to false by default, toggle this on for some more information.

Additive chance

Maybe you don't want each chance to be individually calculated, this option allows you to make chances for classes additive. This affects all classes. The option is called additive_chance, it's false by default.

  • This basically means that if you have a subclass with a 50% chance and another with 50% chance that affect the same role, you're bound to get one or the other.

Weighted chance

This is basically the same as additive chance with the added benefit of weighing the chance so your additive chances don't need to add to 100. Make sure to set up BaseWeights in the main config file for the default roles as they're all 0 by default!

Global broadcast timer

This is the amount of time, in seconds, the got class broadcast message will remain. You can still override it with specific classes.

Spawn parameter separator

The character(s) that separate spawn parameter arguments.

The localization features

These are just string you can change into whatever you want. Introduced as localization features.

Making a subclass

Making a subclass is really easy, and as of pre017, it got way easier. If you wanted to make a class called "Elite MTF" and give it to the NTF Commander, first you'll want to make a new yml file (I suggest opening up the folder with a code editor like visual studio code that provides syntax highlighting and easier file making) and place it in the folder of your choice, explained next.

When you run the plugin on a specific server, it will generate 3 folders if it's brand new. First it'll generate a folder called Subclasses in EXILED/Configs and inside of it, it will create 2 more folders. One called global (global classes that apply to all servers) and a folder with the server's port as the name like this:

file hierarchy

If you want this class to only apply a specific server, make this file in the folder with the port of the server you want it to apply to. If you want it to apply to all servers, put the file in the global folder.

Back to actually making the class, if you want to make a class called "Elite MTF" and give it to the role NtfCommander, you'll add this to the file:

name: Elite MTF

affects_roles:
- NtfCommander

While the name is up to you, affects_roles is a list of what is called a RoleType, you can find a list of RoleTypes here. This is the role(s) that players can be to get this subclass.

Once you do this, you must complete the following steps or the plugin will error somewhere.

This guide will use Elite MTF as the class, replace it appropriately.

Editing subclass options - affects users

This allows you to define chances to get on a per-user basis. They still must have a role that's in affects_roles. It looks like this:

affects_users:
  76561198118318345@steam: 100

This would give the player with the steam id of 76561198118318345 a 100% chance to get the class. Set this to {} to have none, or simply don't include affects_users in the file. Additive chance does not apply to this option.

Editing subclass options - any permissions

This is like affects_users, but with permissions. This allows you to give people with specific permissions subclasses for certain ranks. They look very similar:

any_permissions:
  test: 100

This gives anyone with sc.test a 100% chance to get the class, given their role is listed in affects_roles. Notice how the permission is sc.test and not just test, they must have the sc prefix to work. If you want only them to get the class, set the regular ChanceToGet to 0. Additive chance does not apply to this option.

Editing subclass options - strings

These are the options that are strings, like cooldowns and cassie messages. Add this to your class yml file to register it.

string_options:
  GotClassMessage: You are an Elite MTF Commander. You have increased health.
  AbilityCooldownMessage: Your {ability} ability is on cooldown for {seconds} seconds!
  • GotClassMessage - The message the user sees when they get the class.
  • AbilityCooldownMessage - The message players see when they attempt to use an ability that's on cooldown.
  • Badge (optional) - A badge for the player.
  • BadgeColor (optional) - The color of the badge. See here for a list of acceptable colors.
  • CassieMessage (optional) - A message that will be announced by CASSIE when this subclass spawns. This list does not repeat. See here for a list of words and phrases CASSIE can say.
  • OutOfAbilityUses (optional) - The message people see when they run out of ability uses for any ability. {ability} is replaced with the ability name. This is required when you have any abilities with max uses.
  • HelpMessage (optional) - The message shown in player's consoles when they use the help command for this subclass.
  • Nickname (optional) - The nickname of the player when they get this subclass. {name} is replaced with their name.

You can put whatever you want in them, but you must have values for the options not labeled "optional" Though, if you have no abilities, you don't really need AbilityCooldownMessage, but it's safe to have the default in there.

You may notice {ability} and {seconds} in the AbilityCooldownMessage, these are replaced with the ability name and remaining cooldown respectively.

Editing subclass options - booleans

Every value in this must be in your config for every subclass, each value may be true or false:

boolean_options:
  Enabled: true
  DisregardHasFF: false
  HasFriendlyFire: false
  DisregardTakesFF: false
  TakesFriendlyFire: false

Here's what each option does:

  • Enabled - Enables the class.
  • DisregardHasFF - Disregards the value beneath it and uses the server default for friendly fire.
  • HasFriendlyFire - Enables friendly fire for this subclass, useful for traitorous subclasses, when a player with this option shoots a person on their team, everyone may shoot them regardless of DisregardTakesFF and TakesFriendlyFire.
  • DisregardTakesFF - Disregards the value beneath it and uses the server default for friendly fire.
  • TakesFriendlyFire - Whether players on the same team of this subclass may shoot the player and may not be shot back.
  • OnlyAffectsSpawnWave (optional) - If set to true, the subclass can only be given to a spawn wave. Defaults to false.
  • AffectsSpawnWave (optional) - If set to true, the subclass can be given to both individuals and spawn waves. Defaults to false.
  • GivenOnEscape (optional) - If set to false, the subclass will not be given to players after escaping. Defaults to true.
  • WaitForSpawnWaves (optional) - If set to true, this subclass will wait for a given number of spawn waves before spawning. Defaults to false.
    • If you use this, you must have the integer option NumSpawnWavesToWait set to an integer or it will not work.
    • There is an optional string option called WaitSpawnWaveTeam that tells it what team to wait for. By default it's RIP which in this context means count all spawn waves. Accepted values are RIP, MTF, and CHI as of now.
  • OnlyGivenOnEscape (optional) - If set to true, the subclass will only be given on escape. Defaults to false.

Editing subclass options - integers

These are normally base stats of the class. It looks like this, all values must be present, even if they are 0, use -1 for default.

integer_options:
  MaxHealth: 300
  HealthOnSpawn: 300
  MaxArmor: -1
  ArmorOnSpawn: -1

As stated above, you must have every value, use -1 for the default value.

  • MaxHealth - Max health of the class.
  • HealthOnSpawn - The health the class spawns with (must be less than or equal to MaxHealth, if this value is greater than MaxHealth, MaxHealth will be this value).
  • MaxArmor - The max amount of armor the class has.
  • ArmorOnSpawn - The armor the class has on spawn.
  • MaxAlive (optional) - The max number of people that can have this class at any given moment - disregarding spawn waves.
  • MaxSpawnPerRound (optional) - The max number of times this class can spawn per round. If this class is affecting a spawn wave, it is counted as 1. Defaults to no max.
  • MaxPerSpawnWave (optional) - This caps how many people can get this class in a small period of time which makes it effective at capping the number when spawning players in a spawn wave.

Armor is a value that decreases over the course of the game, unless given the ability that stops it from doing so.

Editing subclass options - floats

Currently, the only required float option is the chance to get the class. It's worth noting each chance is individual, internally, it goes over every class and calculates the chance separately, so you can technically have classes with subclasses that have more than 100% chance of occurring in total and not get one... Unless you have additive_chance on.

A float is basically a decimal value.

float_options:
  ChanceToGet: 30
  • ChanceToGet - The chance to get this class, not calculated with other classes for the same role.
  • BroadcastTimer (optional) - The time the GotClassMessage lasts.
  • ScaleX (optional) - The player's model scale across the X axis.
  • ScaleY (optional) - The player's model scale across the Y axis.
  • ScaleZ (optional) - The player's model scale across the Z axis.
  • SpawnOffsetX (optional) - The player's spawn offset relative to the X axis.
  • SpawnOffsetY (optional) - The player's spawn offset relative to the Y axis.
  • SpawnOffsetZ (optional) - The player's spawn offset relative to the Z axis.
  • OnHitDamageMultiplier (optional) - The damage multiplier this player has. A value of 2 will double their damage.

Editing subclass options - spawns

You may have a list of RoomTypes where this class is teleported to at the start of the round. Use Unknown for the default spawn location.

spawn_locations:
- Unknown

For a list of RoomTypes, go here.

This value is a list, there must be at least one value in this list.

Editing subclass options - spawn items

These are the items the class will spawn with, this will override the default spawn items. To use the default, this should be empty (Elite MTF: {}). This is a dictionary (key/value pair) of integers (non-decimal numbers) to another dictionary of ItemTypes to floats (decimal numbers).

Spawn items now supports custom items from 3rd party plugins if they register their plugin's methods through the Subclass API!

spawn_items:
  0:
    KeycardO5: 100
  1:
    GunE11SR: 100
  2:
    Flashlight: 50
  3:
    GrenadeFrag: 75

The value after the item is the chance to get that item individually. The number that the items are in (in this case 0, 1, 2, or 3) can technically be anything as it's just there to separate slots (but it doesn't put it in any specific slot). This was changed in order to allow duplicate items in the inventory. Any items past the 8th number will be disregarded as there's no where for the item to go. If you want the player to spawn with nothing, the easiest setup would be

  0:
    None: 100

"None" means nothing would be added, but because the dictionary isn't empty it still clears the player's inventory.

This value is a dictionary, it may be empty, if that's the case the value is spawn_items: {}

Editing subclass options - ammo

You can edit the default values of how must ammo a player has. This is a list that must contain the following 3 items. Use -1 for default.

spawn_ammo:
  Nato556: 500
  Nato762: 500
  Nato9: 500

These are the 3 ammo types in the game and they must be present, you can use -1 for the default value.

Editing subclass options - abilities

This is where the cooler custom stuff comes in. This is a list, it may be empty. Not all abilities are good, but they all add new things to the game.

abilities:
- InvisibleUntilInteract

This value is a list of AbilityTypes. It may be empty, if that's the case, the value should be abilities: []. If the ability has certain options, you will need to place them in the correct place, some abilities have options that are required, some don't this is further explained in the list of abilities.

Editing subclass options - ability cooldowns

You can set custom cooldowns for abilities that have cooldowns, currently only 2 do. For more info, see here.

ability_cooldowns:
  InvisibleUntilInteract: 5

This value is a map of floats, you may use decimals. It may be empty, if that's the case, the value should be ability_cooldowns: {}. This list should contain all abilities that could have cooldowns that the class has, even if you set them to 0.

You may also set initial ability cooldowns in the same way under a key called initial_ability_cooldowns:

initial_ability_cooldowns:
  InvisibleUntilInteract: 20

Editing subclass options - advanced friendly fire rules

With this list, you can give a subclass a list of other subclasses they can friendly fire upon.

advanced_ff_rules:
- Other MTF Class

This value is a list of strings (which are other subclass names). It may be empty, if that's the case, the value should be advanced_ff_rules: [].

Editing subclass options - roles that can't damage

This is essentially a list of roles that are unable to damage the subclass regardless of team. This is completely optional, your subclass does not need to be present here.

roles_that_cant_damage:
- ChaosInsurgency

If you want it to be empty, you can use roles_that_cant_damage: [] or just not include it. This has nothing to do with friendly fire, it's quite the opposite. This allows you to make spy classes where the normal classes can't fire on this particular subclass. If you're doing something like this, you may also want to edit the "EndsRoundWith" option (explained below).

Editing subclass options - can't damage

This is the other side of roles that can't damage in that these are the roles that players with this subclass can't damage. It is set up in the exact same way as roles_that_cant_damage with cant_damage being the main key.

Editing subclass options - can't damage teams

This is a list of Teams that a player with this subclass can't damage.

cant_damage_teams:
- CDP

Editing subclass options - teams that can't damage

This is the other side of can't damage teams. This is a list of Teams that this player cannot be damaged by. It is set up in the same way as cant_damage_teams, but the primary key is teams_that_cant_damage.

Editing subclass options - can't damage subclasses

This is a list of subclass names that a player with this subclass can't damage. This is case-sensitive.

cant_damage_subclasses:
- TestClass

Editing subclass options - subclasses that can't damage

This is the other side of can't damage subclasses. These are the names of the subclasses that a player with this subclass are immune to. This is case-sensitive. It is set up the same way as cant_damage_subclasses.

Editing subclass options - ends round with

This is the Team that players with this class can end the game with. It also accepts ALL to end with any team.

ends_round_with: RIP

This will change the player's role if they would be the last person alive for their real team, or their team would win if they were the role. RIP means the default team.

Editing subclass options - spawns as

Spawns as is an optional config variable. It defines what role the class will spawn as. None is the default meaning they spawn as the role they were going to.

spawns_as: None

Editing subclass options - escapes as

Escapes as is an optional config option. These define what role the class becomes upon escaping. There are options for cuffed and not cuffed.

escapes_as:
  cuffed: NtfScientist
  not_cuffed: ChaosInsurgency

If this is set to None, or is not provided, it will use the default.

Editing subclass options - spawn parameters

Spawn parameters are a way for you to define what needs to be present for the class to be spawned. It's explained more in-depth here

Others

There are other config options not explained here, see here for information about on hit effects, here for information about on spawn effects, and here for information about on damaged effects.

Final config:

File name: Elite MTF.yml

name: Elite MTF

affects_roles:
- NtfCommander

string_options:
  GotClassMessage: You are an Elite MTF Commander. You have increased health.
  AbilityCooldownMessage: Your {ability} ability is on cooldown for {seconds} seconds!

boolean_options:
  Enabled: true
  DisregardHasFF: false
  HasFriendlyFire: false
  DisregardTakesFF: false
  TakesFriendlyFire: false

integer_options:
  MaxHealth: 300
  HealthOnSpawn: 300
  MaxArmor: -1
  ArmorOnSpawn: -1

float_options:
  ChanceToGet: 30

spawn_locations:
- Unknown

spawn_items:
  0:
    KeycardO5: 100
  1:
    GunE11SR: 100
  2:
    Flashlight: 50
  3:
    GrenadeFrag: 75

spawn_ammo:
  Nato556: 500
  Nato762: 500
  Nato9: 500

abilities:
- InvisibleUntilInteract

ability_cooldowns:
  InvisibleUntilInteract: 5

advanced_ff_rules:
- Other MTF Class

roles_that_cant_damage:
- ChaosInsurgency

ends_round_with: RIP

on_hit_effects: []

on_spawn_effects: []

spawns_as: None

Final words

Please take time to think of abilities I can add. The more customization, the better!

Clone this wiki locally