This right here is the result of me thinking how I wanted a gamemode for TF2 that you could buy upgrades for weapons in TF2. So I started learning how to write plugins for SourceMod and then a few months (and several thousand lines of code) later this is the result.
So what exactly is it? The idea is really quite simple, when you complete an objective, do something that helps your team or kill an enemy you earn credits. You then use those credits to buy upgrades. It currently has support for CP, PL, PLR, KOTH and CTF.
And to solve the problem of when you're defending the last point and really don't have the time to buy upgrades each client (and each client's class) has an upgrade queue that you can populate when they first join the server. The upgrades on their queue are then brought for them (if they can afford them) whenever they resupply or respawn in the order they put them on their queue.
Now I'm not going to lie, it probably needs a lot of improvements. If you do give it a go please give me some feedback. Something I would love some on is if I should keep the downsides on upgrades or get rid of them. Anything constructive you have to say is welcome though.
Queue Saving Info
By default the plugin Escalation_QueueSaving saves a client's upgrade queue to a database when they disconnect. It will first try to use your default SQL connection, if that doesn't work it then will try to use SQLite. In the event of SQLite failing it will just maintain an in memory cache of their queues.
If you'd prefer to just use the in memory cache at all times you can set the CVar escalation_queuesaving_usesql to 0 in Escalation_QueueSaving_Config.cfg (You can find it in the SourceMod folder of your server's cfg folder.)
How to Install?
Step 1. Install
TF2Attributes
Step 2. (Optional, but recommended) Install
TF2Items
Step 3. (Optional, but recommended) Install
SteamTools
Step 4. Download Escalation.zip
Step 5. Extract Escalation.zip
Step 6. Using FTP, Drag and Drop the folders configs, plugins, scripting and translations into your server's SourceMod folder.
Step 7. Using rcon execute "sm plugins refresh"
Step 8. Enjoy?
Public Commands
All are usable with '!' or '/' in chat as well. Unless you've changed your server's chat trigger.
- upgrade - Opens up the upgrade menu to let put upgrades on your queue and edit your queue. Also responds to "upgrade" or "upgrades" in chat, both can also have '!' or '/' put in front of them.
- credits - Replies with how many credits you currently have. (Your credits are displayed on your HUD, this is just an old command left in place for when I get around to letting players disable the credits being displayed on their HUD.)
- buyupgrade <upgradename> - Manually adds an upgrade to your queue. The upgrade name is untranslated. (So it'll usually look something like UpgradeScattergunDamage, see the config files for a list. Or do the smart thing and just use the upgrade menu.)
- clearupgrades <class> - Clears a class's upgrade queue or all classes if class is left empty.
Admin Commands
The plugin does have admin menu integration so you should really just use that, it's simpler.
Also "weapon index" means the weapon's item definition index.
- sm_reloadconfigs - Reloads all of Escalation's config files. Be warned this may stall your server for a tiny bit. Defaults to CVar access flag.
- sm_banupgrade <upgradename> - Bans an upgrade by their untranslated name. Defaults to ban flag.
- sm_bancombo <upgradename> <weapon index> - Bans an upgrade/weapon combination, preventing the upgrade from being brought while the player has the specified weapon equipped. Defaults to ban flag.
- sm_unbanupgrade <upgradename> - Unbans an upgrade, allowing players to buy it again. Defaults to ban flag.
- sm_unbancombo <upgradename> <weapon index> - Unbans an upgrade/weapon combination, allowing them to be brought again. Defaults to ban flag.
- sm_reset_bannedupgrades - Resets all banned upgrades. Defaults to ban flag.
- sm_reset_bannedcombos - Resets all banned upgrade/weapon combinations. Defaults to ban flag.
- sm_menu_banupgrade - If for some reason you don't have the admin menu loaded you can use this to access the "Ban Upgrade" menu. Defaults to ban flag.
- sm_menu_unbanupgrade - If for some reason you don't have the admin menu loaded you can use this to access the "Unban Upgrade" menu. Defaults to ban flag.
- sm_setgameinfo <Section.Key> <Value> <IsFloat (1 or 0)> - Enables you to set gameinfo variables from Escalation_Gameinfo. Defaults to cheats flag.
CVar List
- escalation_enabled - When set to 1 the plugin is enabled,
- escalation_version - The version of the plugin. What else is there to say?
- escalation_hudreminder - If 1 a HUD reminder tells players to open the upgrade menu will be displayed to players connecting to the server for the first time.
- escalation_chatreminder - If 1 a chat reminder tells players to open the upgrade menu will be displayed to players connecting to the server for the first time.
- escalation_queuesaving_usesql - Controls if the plugin Escalation_QueueSaving will use SQL or not.
Developer Commands
These only exist in the plugin if you compile it with DEV_BUILD defined. It's also worth keeping in mind if for some reason you decide that you do want access to them that they are not very well debugged and some of them are even dangerous to use.
API Stuff
There is an API for Escalation and it's custom attributes module. Simply go look at their respective include files to find out more. If there is something you would like added to it simply tell me about it and I'll see what I can do.
Change Log
Code:
v1.0.0
Bug Fixes
-Fixed the plugin failing to load if their were players on a spectator team.
-Player's now get the correct amount of credits when they destroy a building.
Code Changes
-Added an upgrade queue saving sub-plugin named Escalation_QueueSaving. By default it will use SQL, can be made to just cache queues in memory using escalation_queuesaving_usesql.
-Using the client preferences extension the plugin will no longer display reminders to open the upgrade menu to players that have done it before.
-Changed the way the plugin stores gamemode information. If you customized Escalation_Gameinfo.cfg you must remake those changes in the new Escalation_Gameinfo.cfg.
-Client's upgrade queues are now processed at round start and when they change class in spawn.
CVar Changes
-Added escalation_hudreminder to enable admins to disable the HUD reminder.
-Added escalation_chatreminder to enable admins to disable the chat reminder.
-Added escalation_queuesaving_usesql to enable admins to disable SQL queue saving.
Command Changes
-Upgrade commands can no longer be used when not ingame and when not on a team.
-Added sm_setgameinfo admin command. (Defaults to cheats flag)
Upgrade Changes
-The Big Earner's Cloak On Backstab upgrade now grants the Silent Killer attribute as well.
Gamemode Changes
-Added support for CTF.
v0.9.9
Bug Fixes
-Updated the path to items_game.txt after Valve changed it again.
Code Changes
-Added Esc_ClientHasData native.
Upgrade Changes
-The Sniper Rifle and Huntsman's reload speed upgrade now works correctly.
v0.9.8
Bug Fixes
-Fixed various mistakes in the natives that caused them to wrongly error.
-Fixed clients not getting their starting credits when they joined mid-game.
-Fixed clients getting double the credits they were supposed for certain objectives.
-Fixed Spies being able to upgrade their disguise weapon.
-Fixed the reminders to open the upgrade menu not working.
Code Changes
-Remembered that STV is a thing and implemented a IsClientValid function to stop the plugin creating data for it.
-Added Esc_GetArrayOfUpgrades native and Esc_CoreConfigsLoaded forward.
Upgrade Changes
-The Righteous Bison can no longer buy the Clip Size upgrade.
-Fixed The Soda Popper and Force-A-Nature gaining clip size of 12. It should now max out at 4 correctly.
-Fixed The Lugermorph not being upgradeable.
Gamemode Changes
-Added support for Payload Race.
Command Changes
-"sm_reloadconfigs" now reloads Escalation_Gameinfo.cfg as well
-"upgrade" Now responds to upgrade, upgrades, !upgrades and /upgrades in chat.son can no longer buy the Clip Size upgrade.
-Fixed The Soda Popper and Force-A-Nature gaining clip size of 12. It should now max out at 4 correctly.
-Fixed The Lugermorph not being upgradeable.
Gamemode Changes
-Added support for Payload Race.
Command Changes
-"sm_reloadconfigs" now reloads Escalation_Gameinfo.cfg as well
-"upgrade" Now responds to upgrade, upgrades, !upgrades and /upgrades in chat.
v0.9.7
-First Public Release
Credits
Everyone behind Metamod Source and SourceMod.
Valve for making TF2.
Dr. McKay - For morecolors.inc
asherkin - For TF2Items and SteamTools
FlaminSarge - For TF2Attributes.
linux_lover - I stole the code for checking if a round had started from his RTD plugin.
bl4nk - For this fine plugin here
https://forums.alliedmods.net/showpo...24&postcount=2
psychonic - For solving the mystery of detecting when someone was jarated.
MasterOfTheXP - For this little code snippet here
https://forums.alliedmods.net/showpo...66&postcount=2
Some-Person-Who's-Name-I-can't-Remember - Firstly, forgive me for forgetting your name and also thanks for the tip off in one of your posts about the new player condition for explosive jumping.
The folks behind Valve's developer Wiki, I used it to find out how to read from VPK files.
Js41637 - For reminding me of the importance of brackets and loads of other small things throughout the development of the plugin.
Everyone behind the official TF2Wiki, it came in handy more than once.
The process of designing the upgrades was made so much easier thanks to this fine site here
http://optf2.com/ that was made by Lagg I do believe.
Their credits list can be found here
http://optf2.com/about
Obligatory Religious Credit Follows
God - For giving me the skills I needed to make the plugin.
If I forgot someone I am so sorry! The odds are you're a fantastic person (if you're reading the credits list you are anyway) who deserves credit for whatever you did.
Okay now what am I forgetting... GitHub, if you like GitHub
https://github.com/SleepKiller/Escalation. And I've probably forgotten at least ten other things, but oh well.
If you take the time to give feedback it is greatly appreciated.