PivityGmodStore

Customize the abilities per job

Hello


As you may have noticed, a new update is out and added the ability to have custom parameters for some jobs. For example, a job named "Civil Protection" could have a better stamina, running speed or attackspeed. The idea is to allow some jobs to have different abilities. They're being updated when changing the job you're in, ie. if the server owner made that a Hobo has horrible abilities while Civil Protection has good abilities (Citizen still having the "default abilities" you set), this will be instantly changed depending on your team. This doesn't change the value saved in the database as we save a specific XP, and the XP system is not changing with it: we're only speaking about abilities.


How to do that


For every type of ability (Stamina, Running Speed, Strength, Attack Speed), you have a specific table:

  1. Stamina: Diablos.TS.StaminaJobAbilities
  2. Running speed: Diablos.TS.RunningSpeedJobAbilities
  3. Strength: Diablos.TS.StrengthJobAbilities
  4. Attack speed: Diablos.TS.AttackSpeedJobAbilities

These tables can be seen in the training_config.lua file.

Note: if you use the ingame config system for gmodstore, then you probably need to create a shared file (for example in diablos_training/init called sh_training_job_abilities.lua)


Example with stamina


The levels in the config file work like this (this is the default values for the StaminaLevels table):

Diablos.TS.StaminaLevels = {
{xp = 0, timeduration = 6},
{xp = 15, timeduration = 8},
{xp = 30, timeduration = 10},
{xp = 50, timeduration = 12},
{xp = 75, timeduration = 14},
{xp = 110, timeduration = 16},
{xp = 150, timeduration = 18},
{xp = 200, timeduration = 20},
}


So if your XP is set to 0, then the stamina is 6 seconds, if your XP is from 15 to 30-1=29, then stamina is 8 seconds, etc. They are the default values for every job, as usual. As you can see, we have 8 different stamina levels.

Now, you can create your table like this:


Diablos.TS.StaminaJobAbilities = {
["Civil Protection"] = {
{timeduration = 15},
    {timeduration = 20},
{timeduration = 25},
{timeduration = 30},
{timeduration = 35},
{timeduration = 40},
{timeduration = 45},
{timeduration = 50},
},
["Hobo"] = {
{timeduration = 1},
    {timeduration = 2},
{timeduration = 3},
{timeduration = 4},
{timeduration = 5},
{timeduration = 6},
{timeduration = 7},
{timeduration = 8},
}
}

Here, the Civil Protection job (so the job name should be properly written the same way than the job you have) will start with a stamina of 15 seconds. His last level will be a stamina of 50 seconds. If you are in the Hobo job, then your stamina will start at 1 second and ends at 8 seconds for the last level.

The most important thing: as we have 8 different levels for StaminaLevels, we need to put 8 different values for every job (same amount of values than in the Levels table above). You don't need to specify the XP value in the job ability table, as this still remains the same for everyone. The only value you need to change is the value used for abilities for the training, i.e:

  1. Stamina: timeduration value
  2. Running speed: runspeed value
  3. Strength: damage value
  4. Attack speed: attackspeed value


I think this is understandable enough for my fellow customers :D

An example with the Civil Protection job is given in the config file, so I think you should get it.

If you have any issue to understand or even after doing all of that, then don't hesitate to open a support ticket.

Thanks!