Team Fortress: Global Offensive
Because Gun Mettle wasn't enough.
What exactly is this?
TF:GO brings the bomb defusal mode from Counter-Strike: Global Offensive to Team Fortress 2 Arena.
All players begin the game with basic weapons and can buy new equipment at the start of each round with money earned from neutralizing enemy players or planting the bomb.
This was my first attempt to create a SourceMod plugin, with no prior knowledge of SourcePawn.
You can find the source code and download links over on the
GitHub repository.
Features- Similar gameplay to Counter-Strike: Global Offensive's bomb defusal mode
- Easy-to-use buy menu
- Support for a wide range of arena maps
- Critical headshots on weapons like pistols, SMGs and revolvers
- Highly configurable using the plugin configuration and cvars
- Support for custom music kits
- Support for custom map voting plugins
Configuration
TF:GO uses a single configuration file (
sourcemod/configs/weapons.cfg) to define properties for each weapon. It allows you to change their cost in the buy menu, the amount of cash you get per kill, and even if they are capable of dealing critical hits on headshots. The default values should work for most use cases but if you feel like something needs to be changed, it's as easy as editing a single value.
Weapon configuration example:
PHP Code:
"209" // Pistol (Scout/Engineer)
{
"kill_award" "300"
"armor_penetration" "0.475"
"is_default" "1"
"can_headshot" "1"
"reskins" "160;294;15013;15018;15035;15041;15046;15056;15060;15061;15100;15101;15102;15126;15148;30666"
}
Everything not related to weapons is available as a cvar for you to configure. The available cvars should cover pretty much everything you might want to configure but feel free to tell me if something is missing.
Cvar List:
Code:
tfgo_free_armor
tfgo_max_armor
tfgo_buytime
tfgo_consecutive_loss_max
tfgo_bombtimer
tfgo_halftime
tfgo_startmoney
tfgo_maxmoney
tfgo_cash_player_bomb_planted
tfgo_cash_player_bomb_defused
tfgo_cash_player_killed_enemy_default
tfgo_cash_player_killed_enemy_factor
tfgo_cash_team_elimination
tfgo_cash_team_loser_bonus
tfgo_cash_team_win_by_time_running_out_bomb
tfgo_cash_team_loser_bonus_consecutive_rounds
tfgo_cash_team_terrorist_win_bomb
tfgo_cash_team_win_by_defusing_bomb
tfgo_cash_team_planted_bomb_but_defused
If this is too much for you to configure, you can check out the included configuration files in the
cfg folder, namely
tfgo_competitive.cfg and
tfgo_casual.cfg. They also contain some other TF2 cvars that you may want to change. Both configurations play quite differently, so go try them out.
Music Kits
What would CS:GO be without music kits?
TF:GO allows you to add custom music kits using the power of
soundscripts. You can find two natives in
tfgo.inc that allow you to register and use custom music kits.
PHP Code:
/**
* Registers a new music kit with the specified name and soundscript.
*
* @param name Name of the music kit.
* @param path Path to the soundscript text file.
* @param isDefault Whether this music kit can be randomly assigned to players as a default kit.
* @param precache Whether to precache the sounds in this music kit. All music kit sounds are automatically precached on map start.
*/
native void TFGO_RegisterMusicKit(const char[] name, const char[] path, bool isDefault = false, bool precache = false);
/**
* Sets the active music kit for a client.
* The music kit passed must be registered prior using TFGO_RegisterMusicKit.
*
* @param client Client index.
* @param name Name of the music kit.
*/
native void TFGO_SetClientMusicKit(int client, const char[] name);
PHP Code:
#undef REQUIRE_PLUGIN
#include <tfgo>
public void OnLibraryAdded(const char[] name)
{
if (!StrEqual(name, "tfgo"))
return;
//Registers a new music kit called "darude_01" using the provided soundscript
TFGO_RegisterMusicKit("darude_01", "sound/tfgo/music/darude_01/game_sounds_music.txt", false, true);
}
Custom Map Vote Support
If you are a server operator and use a non-standard map voting plugin, you can integrate it directly into TF:GO with minimal code.
I don't want to go too in-depth with this as the code will look different for every map voting plugin but you should know that these natives exist.
PHP Code:
/**
* Called when the game has entered half-time.
* Intended to be used with map voting plugins to allow a vote to start.
*
* @note This forward does not get called if tfgo_halftime is set to 0.
*/
forward void TFGO_OnHalfTimeStarted();
/**
* Called repeatedly when the game is about to leave half-time.
* Intended to be used with map voting plugins, this forward should return false if a vote is still in progress.
*
* @note This forward does not get called until the initial half-time duration (tfgo_halftime_duration) has elapsed.
* @note This forward does not get called if tfgo_halftime is set to 0.
*
* @return true if the half-time should end, false if it shouldn't end and call this forward again.
*/
forward bool TFGO_HasHalfTimeEnded();
/**
* Called when the game is about to switch or scramble the teams after half-time.
*
* @note This forward gets called regardless of the current value of the tfgo_halftime_scramble convar.
*
* @return true if the teams should be switched or scrambled, false if not.
*/
forward bool TFGO_ShouldSwitchTeams();
Installation- Grab the latest release from the download link at the bottom of the page.
- Extract the contents of the archive into the tf folder of your server.
- Install all the required dependencies listed below.
- Restart your server or run sm plugins load tfgo and sm_reload_translations.
- Load any arena map.
Dependencies
Did I forget to mention something?
Tell me, and I'll add it onto the thread.
Download from GitHub