Plugin "CreditSystem"
This plugin adds credits to the bot. People can gain credits atm by killing stuff.
Other plugins can make use of credits. Currently, SlotBlocking can block slots by credits and take credits away if people waste airplanes. Furthermore, Punishment can take credit points away due to punishment points a player gets due to team-kills or similar.
Configuration
The CreditSystem is configured with a file named config\plugins\creditsystem.yaml. You'll find a sample file in that directory:
# config/plugins/creditsystem.yaml
DEFAULT: # valid for all servers
initial_points: 10 # The initial points a player gets (default = 0).
max_points: 100 # The maximum points a player can get (default = unlimited).
multiplier: 1.0 # multiplier for credit points on proper landings if payback is enabled in slotblocking.yaml (default: 1.0)
points_on_rtb: false # only give credit points on RTB (default: false)
squadron_credits: true # enable squadron credits (see below).
squadron:
initial_points: 100 # default: 0
max_points: 1000 # default: unlimited
messages:
message_kill: You received {points} credit points for killing {victim}. # if not set, no kill message will be printed!
points_per_kill: # How many points do players get when they kill another unit?
- default: 1 # You get at least one point (default = 0).
- category: Ships # If you kill a ship. you get 2 points
points: 2
- category: Air Defence
points: 3
- category: Planes
type: AI # for planes and helicopters you can decide whether you killed an AI or a human player
points: 3
- category: Planes
type: Player
points: 4
- category: Planes
type: Player
unit_type: F-14B # you can specify the unit_type, unit_name, group_name as another differentiation
points: 5
- category: Helicopters
points: 3
- category: User # Bounty for specific users / roles. Could also be added to Planes / Helicopters.
ucid:
- 1122334455667788
discord:
- Cannon Fodder # Discord role (name or id)
points: 5
achievements: # OPTIONAL: you can give players Discord roles according to their achievements
- credits: 0
playtime: 0 # Playtime is in hours
badge: # Optional: give the player a badge
name: Rookie
img: https://example.com/rookie_badge.png
role: Rookie # Optional: Initially, with 0 credits and 0 playtime, you get the role "Rookie" (has to be in Discord)
- credits: 50
playtime: 25
role: Veteran # to get the Veteran role, you have to have EITHER 50 credit points OR a playtime of 25 hrs
- credits: 100
playtime: 50
combined: true # you need to have 100 credit points AND a playtime of more than 50 hrs to get the "Ace" role
role: Ace
leaderboard: # Simple leaderboard, persistent, displayed in a channel of your choice
channel: 112233445566778899
limit: 10 # max number of entries to be shown
DCS.dcs_serverrelease: # valid for a specific server
initial_points: # different initial points can be specified for different Discord roles
- discord: Donator
points: 15
- default: 10
If you use multiple entries for points_to_kill, please make sure, that you order them from specialized to non-specialized. That means, in the above example you need to specify the plane with the unit_type first, then the planes without. So this list will be evaluated exactly in the order the items are listed and the first match will count!
To enable the points system, you need to start a "Campaign" on the specific server (see Gamemaster). Same is true for achievements, where you can give your players Discord roles depending on either the time they were flying in that specific campaign or on the points they achieved. Losing points might downgrade the player again.
If you want to specify points for ground targets, you need to select the correct category out of this list:
- Unarmed
- Air Defence
- Artillery
- Armor
- Locomotive
- Carriage
- MissilesSS
Achiements are possible role changes, that happen when a player either reached a specific flighttime or s specific number of credits.
Squadron Credits (as of DCSSB 3.0.4)
You can now gain Squadron Credits, meaning, if you are a member of any squadron, your squadron will gather credits as much as you do. Only points that you gain are added to the squadron, not points that you lose due to buying a plane or whatnot. To enable that, you need to set squadron_credits to true in your creditsystem.yaml (see above).
Highscore Plugin
You can integrate the TrueSkill™️-rating into your highscores though.
To do that, you copy your /plugins/userstats/reports/highscore.json to /reports/userstats. Then replace one of the
"Graph" elements with this:
{
"class": "plugins.creditsystem.highscore.HighscoreCredits",
"params": { "col": 1, "row": 1 }
}
Discord Commands
| Command | Parameter | Role | Description |
|---|---|---|---|
| /credits info | [member] | DCS | Displays the players campaign credits. |
| /credits donate | <@member> |
DCS | Donate any of your campaign points to another member. |
| /credits reset | [user] | DCS Admin | Reset the current campaign credits [of a user]. |
In-Game Chat Commands
| Command | Parameter | Role | Description |
|---|---|---|---|
| -credits | all | Show your players credits. | |
| -donate | whom points | all | Donate credits to another player. |
| -tip | points [gci number] | all | Tip a GCI role. |
Usage inside Missions (Scripting API)
If you want to change user points based on any mission achievements, you are good to go:
if dcsbot then
dcsbot.addUserPoints('Special K', 10) -- add 10 points to users "Special K"'s credits. Points can be negative to take them away.
end
if dcsbot then
dcsbot.addSquadronPoints('MyFancySquadron', 10, 'Just because I love you.') -- add 10 points to squadron "MyFancySquadron"
end
Tables
CREDITS
| Column | Type | Description |
|---|---|---|
| #campaign_id | SERIAL | ID of this campaign. |
| #player_ucid | TEXT NOT NULL | The UCID of the player |
| points | INTEGER NOT NULL DEFAULT 0 | The earned credits of this player |
Configuration reference
| Key | Type | Description | Example |
|---|---|---|---|
DEFAULT |
map | Applies to every instance. | |
commands |
|
||
chat_commands |
|
DEFAULT
| Key | Type | Description | Example |
|---|---|---|---|
DEFAULT.initial_points |
any | Credit points every player starts a campaign with. (one of: initiator) | 10 |
DEFAULT.max_points |
int | Maximum credit points a player can accumulate. (range: min 1) | 100 |
DEFAULT.multiplier |
float | Multiplier applied to credits earned on proper landings. | 1.0 |
DEFAULT.points_on_rtb |
bool | Only grant credit points once the pilot is back at base. | false |
DEFAULT.squadron_credits |
bool | Also credit the player's squadron with earned points. | true |
DEFAULT.squadron |
map | Starting balance and cap for squadron credits. | initial_points: 100 |
DEFAULT.squadron.initial_points |
int | Credit points every squadron starts a campaign with. (range: min 0) | 100 |
DEFAULT.squadron.max_points |
int | Maximum credit points a squadron can hold. (range: min 0) | 1000 |
DEFAULT.messages |
map | Text templates for credit-related in-game messages. | message_kill: You received {points} credit points for killing {victim}. |
DEFAULT.messages.message_kill |
str | Kill message; may hold {points} and {victim}. (range: min 1) | You received {points} credit points for killing {victim}. |
DEFAULT.points_per_kill |
list | Points awarded per kill; the first matching rule wins. | - category: Ships |
DEFAULT.points_per_kill[].default |
int | Fallback points for kills matching no other rule. (range: min 0) | 1 |
DEFAULT.points_per_kill[].category |
str | Unit category a kill must match to award these points. (one of: Planes, Helicopters, Ships, Fortifications, LTAvehicles, WWII structures, Animal, Unarmed, Air Defence, Artillery, Armor, Infantry, Locomotive, Carriage, MissilesSS, User) | Ships |
DEFAULT.points_per_kill[].type |
str | Whether the victim must be an AI unit or a human player. (one of: AI, Player) | Player |
DEFAULT.points_per_kill[].unit_type |
str | Restrict the rule to a specific DCS unit type. (range: min 1) | F-14B |
DEFAULT.points_per_kill[].unit_name |
str | Restrict the rule to a specific unit name. (range: min 1) | Red Bear 1 |
DEFAULT.points_per_kill[].group_name |
str | Restrict the rule to a specific group name. (range: min 1) | Enemy CAP |
DEFAULT.points_per_kill[].ucid |
list | Player UCIDs eligible for this bounty. | - 1122334455667788 |
DEFAULT.points_per_kill[].discord |
list | Discord roles eligible for this bounty. | - Cannon Fodder |
DEFAULT.points_per_kill[].points |
int | Points awarded when this rule matches a kill. | 5 |
DEFAULT.achievements |
list | Discord roles granted once credit or playtime goals are met. | - credits: 50 |
DEFAULT.achievements[].credits |
int | Credit points threshold for this achievement. (range: min 0) | 50 |
DEFAULT.achievements[].playtime |
int | Flight time in hours required for this achievement. (range: min 0) | 25 |
DEFAULT.achievements[].combined |
bool | Require both credits and playtime instead of either. | false |
DEFAULT.achievements[].role |
text | Discord role granted when the achievement is reached. | Veteran |
DEFAULT.achievements[].badge |
map | Optional badge image awarded alongside the role. | name: Rookie |
DEFAULT.achievements[].badge.name |
str | Display name of the badge. (range: min 1) | Rookie |
DEFAULT.achievements[].badge.img |
url | URL of the badge image. | https://example.com/rookie_badge.png |
DEFAULT.leaderboard |
map | Persistent credits leaderboard shown in a channel. | channel: 112233445566778899 |
DEFAULT.leaderboard.channel |
int (required) | Discord channel that shows the leaderboard. | 112233445566778899 |
DEFAULT.leaderboard.limit |
int | Maximum number of players shown on the leaderboard. | 10 |
<(.+)>
| Key | Type | Description | Example |
|---|---|---|---|
<(.+)> |
any | (one of: element_schema, instance_schema) | |