-
-
Notifications
You must be signed in to change notification settings - Fork 23
Customizing Perks
Filip Tomaszewski edited this page Jan 21, 2019
·
10 revisions
Perk values are all set in rtd2_perks.default.cfg. However, to counter the requirement of having to edit that file each time new perks are released, rtd2_perks.custom.cfg was added.
Editing rtd2_perks.custom.cfg will override any values that are in rtd2_perks.default.cfg at the same position. View examples down below.
rtd2_perks.custom.cfg addresses the perks in a different way than rtd2_perks.default.cfg. This is why you should never copy the contents of the default config file to the custom config file.
Custom Config Template ^
//Usage:
//
//"token" // Perk's token used for identification.
//{
// "name" "Perk Name" // The name that appears in chat or searchup.
// "good" "1/0" // Is the perk good? 1 and over - yes; 0 and below - no.
// "sound" "sound_path" // The path to the sound which is played on a client who rolls that perk.
// "time" "-1, 0, n" // Custom time for the perk, set to -1 if it's not on timer, 0 if cvar standard, anything >0 is custom time
// "class" "X" // Limit to class(es): "0" -> all-class; "1"-"9" -> Scout to Spy respectively; "1,4,8" -> Scout, Demoman or Sniper. Repeats or numbers higher than 9 are not counted.
// "weapons" "X,Y,Z,..." // Limit to weapon classes. Roller's weapons' classes must CONTAIN X, Y or Z for the perk to be applied (not EQUAL). For an example, see Homing Projectiles(13).
// "settings" // An optional value used for certain behavior in some perks. This MUST NOT exist when a perk doesn't have custom options.
// {
// "option1" "value1"
// "..." "..."
// }
// "tags" "tag1, tag2" // Tags used to find this perk via `sm_rtds` (perk searchup), separated by a comma.
// "call" "Function_Name" // Internal function's name to use when the perk is called
//}
//********** NOTE *********
// This config will override any value at the same position in rtd2_perks.default.cfg
//*************************
// Edit the below by adding new sections. Basically, replicating rtd2_perks.default.cfg
"Effects"
{
}
Config File Breakdown ^
-
"name"
— Perk's name which appears in chat, HUD or searchup -
"good"
— (0/1) Is the perk good? -
"sound"
— Path of the perk's initiation sound. -
"token"
— Perk's name without caps, special symbols or spaces, core way of addressing the perk. -
"time"
— (-1=no timer/0=cvar/X=custom) Perk's duration. -
"class"
— (0-9) "0"=all class, "X"=individual class, "X,Y,Z"=3 different classes. -
"weapons"
— Only players with these parts of weapon classnames are eligible. -
"settings"
— (subsection) The settings subsection defining options for each perk. -
"tags"
— (tag1, tag2, tag3) Used for searchup. If a tag is in a single perk, it can be used to address it. -
"call"
— Internal function's name to use when the perk is called.
Config File Detailed Breakdown ^
-
"good"
- Whether the perk is good is actually determined before the roll via sm_rtd2_chance or sm_rtd2_dchance ConVar.
- If a perk of specified perk intention is not available (all are disabled or none left for player's class) a perk * of the opposite intention will be tried to be rolled.
-
"sound"
- Path of the perk's initiation sound starting from the /sounds/ folder.
- It will be played to all with origin of the player who rolled the perk.
- You can set this to your custom sounds if you'd like to.
-
"token"
- Perk's name without caps, special symbols or spaces.
- Main thing by which to address the perk, changing it in the default config will result in errors.
- Impossible to edit in the custom config.
-
"time"
- Perk's duration. Valid values are:
-
-1
— The perk is instant (ex: Lucky Sandvich), therefor no timer will start. This could be an issue if a timed perk is set to -1 (because it will never end). -
0
— The perk will use the default perk duration, specified by sm_rtd2_duration ConVar. -
X
— Anything greater than 0 will override the ConVar and will give the perk custom time.
-
- Perk's duration. Valid values are:
-
"class"
- Specify which classes the perk is allowed to be applied to:
-
0
or blank — all-class. -
1-9
— Individual classes, from Scout to Spy respectively. -
X, Y, Z
— Specify custom classes, repeats are not counted. (ex:"1, 4, 6"
will make a perk be applicable to Scout, Demoman and Engineer only)
-
- Only digits in this string are counted.
- Specify which classes the perk is allowed to be applied to:
-
"weapons"
- Specify parts of weapon classnames to limit the perk to.
- You only need to put unique parts of the classname.
- Only players holding weapons of any of the specified classnames will be able to obtain the perk.
- Example:
"rocketl"
will limit the perk to players who have a rocket launcher equipped. - Spaces are escaped during processing.
-
"settings"
- The settings field contains subfields of options per perk.
- If settings field is missing, the perk has no options.
- All settings are documented on the Perk List page.
-
"tags"
- Tags are single words, separated by a comma.
- They are used to find perks when using
sm_rtds
(perk search-up). - Spaces are escaped during processing.
-
"call"
- Cell defined which internal function to call when the perk is triggered.
- All perks have individual calls but you can change them to some other perk's call should you want to.
- You may have two of the same perks with different settings supplied.
- You will have to sacrifice a perk in order to do that, an option to add perks through the custom config file may be implemented in the future.
Examples ^
Set Noclip to be flying only ^
"Effects"
{
"flying"
{
"settings"
{
"mode" "0"
}
}
}
Override Spawn Sentry settings and set its custom time ^
"Effects"
{
"spawnsentry"
{
"time" "30"
"settings"
{
"level" "3"
"keep" "1"
}
}
}
Do both of the above ^
"Effects"
{
"flying"
{
"settings"
{
"mode" "0"
}
}
"spawnsentry"
{
"time" "30"
"settings"
{
"level" "3"
"keep" "1"
}
}
}