Skill variables

Skill variables #

Featureful SDK uses the same skill system as Half-Life (values are edited via skill.cfg), but with additional twists.

Skill variables are no longer cvars #

The skill variables are no longer implemented as cvars. This allows for some new features like dynamic addition of the new skill variables and support for difficulty-independent skill variables.

Setting non-skill cvars in the skill configuration file is invalid now (doing so has always been discouraged). Use features/featureful_exec.cfg to override the server cvar values.

Difficulty-independent skill variables #

If skill variable doesn’t end with a digit, it’s considered to be difficulty-independent - its value will be used across all difficulties, unless difficulty-specific variable is specified.

sk_barney_health 50

As you notice the sk_barney_health doesn’t end with 1, 2 or 3. So, if sk_barney_health1 is missing the value of sk_barney_health will be used on easy difficulty.

If both difficulty-independent and difficulty-specific variable are defined, the latter has a priority on an appropriate difficulty.

Values can be ranges #

Using ranges allow a skill value randomization (e.g. for randomized damage or health). To make a range use the numbers separated by comma:

sk_plr_9mm_bullet "8, 10"
sk_hgrunt_gren_launch_delay "2.5, 5.6"

Each time the skill value is requested by the entity the resulting value will be randomized between min and max (inclusive).

If both values in range don’t have the floating point part (or it’s zero) then the game will use the integer randomization (in the example above it will generate values 8, 9 and 10). If at least one of these values has a non-zero floating point part the floating randomization will be used.

Optional sk_ prefix #

The skill variables can be referred with sk_ prefix omitted. E.g. sk_barney_health and barney_health refer to the same variable.

The sk_ prefix was a notation used to distinguish the skill variables from other cvars. As skill variables are not cvars anymore, the prefix is no longer needed.

get_skill command #

Use get_skill console command to print the values for the skill variable on all difficulties. E.g. get_skill barney_health.

Overriding skill values for entity template #

Entity templates allow entities to override the skill variables they’re using. See Entity templates.

skillopfor.cfg #

If skillopfor.cfg exists in the mod directory the game will automatically read the variables from this file as well.