Raised This Month: $51 Target: $400
 12% 

[TF2] Escalation - an Upgrades Mod for TF2 (v1.0.0, 8/11/2014)


Post New Thread Reply   
 
Thread Tools Display Modes
Author
SleepKiller
Junior Member
Join Date: Jul 2014
Plugin ID:
4378
Plugin Version:
1.0.0
Plugin Category:
Gameplay
Plugin Game:
Team Fortress 2
Plugin Dependencies:
Servers with this Plugin:
 
Plugin Description:
A mod for TF2 centred around earning credits and buying upgrades.
Old 10-05-2014 , 00:59   [TF2] Escalation - an Upgrades Mod for TF2 (v1.0.0, 8/11/2014)
Reply With Quote #1

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.

Spoiler


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.
Attached Files
File Type: zip Escalation.zip (219.0 KB, 466 views)

Last edited by SleepKiller; 11-07-2014 at 23:14.
SleepKiller is offline
Drixevel
AlliedModders Donor
Join Date: Sep 2009
Location: Somewhere headbangin'
Old 10-05-2014 , 06:23   Re: [TF2] Escalation - an Upgrades Mod for TF2 (0.9.7, 5/10/2014)
Reply With Quote #2

Taking a quick look at some of the code, this seems pretty solid. Nice work.
Drixevel is offline
deadmau54
AlliedModders Donor
Join Date: May 2013
Old 10-05-2014 , 07:53   Re: [TF2] Escalation - an Upgrades Mod for TF2 (0.9.7, 5/10/2014)
Reply With Quote #3

Is this something like this?
__________________
deadmau54 is offline
Happy DODs player
AlliedModders Donor
Join Date: Sep 2009
Old 10-05-2014 , 08:52   Re: [TF2] Escalation - an Upgrades Mod for TF2 (0.9.7, 5/10/2014)
Reply With Quote #4

This looks pretty good gone test this for surten.
__________________
Happy DODs player is offline
pcmaster
AlliedModders Donor
Join Date: Sep 2009
Old 10-05-2014 , 09:35   Re: [TF2] Escalation - an Upgrades Mod for TF2 (0.9.7, 5/10/2014)
Reply With Quote #5

Just FYI: you mixed up the [url] bbcode for tf2items/tf2attributes (step 1&2 in installation).
__________________
Stopped hosting servers as of November 2018, no longer active around here.
pcmaster is offline
milkcookie
Junior Member
Join Date: May 2014
Old 10-05-2014 , 11:08   Re: [TF2] Escalation - an Upgrades Mod for TF2 (0.9.7, 5/10/2014)
Reply With Quote #6

I'm having some serious errors.
when I have not enough money for upgrade, it announced that I did upgrade. and when i tested to check that upgrade is applied, upgrade doesn't applied to me. +
milkcookie is offline
SleepKiller
Junior Member
Join Date: Jul 2014
Old 10-05-2014 , 18:52   Re: [TF2] Escalation - an Upgrades Mod for TF2 (0.9.7, 5/10/2014)
Reply With Quote #7

Quote:
Originally Posted by r3dw3r3w0lf View Post
Taking a quick look at some of the code, this seems pretty solid. Nice work.
Thank you, I hope it is.

Quote:
Originally Posted by deadmau54 View Post
Is this something like this?
Well they both let you buy upgrades. So it is something like it. But I really don't know much about that one to be able to give an answer as to similar they are.

Quote:
Originally Posted by Happy DODs player View Post
This looks pretty good gone test this for surten.
Awesome, if you spot some ways to improve it be sure to say!

Quote:
Originally Posted by pcmaster View Post
Just FYI: you mixed up the [url] bbcode for tf2items/tf2attributes (step 1&2 in installation).
Fixed. I knew there was some mistake I would have made in the post. Thanks for pointing it out.

Quote:
Originally Posted by milkcookie View Post
I'm having some serious errors.
when I have not enough money for upgrade, it announced that I did upgrade. and when i tested to check that upgrade is applied, upgrade doesn't applied to me. +
Thanks for giving it a go. That is by design. You can add upgrades to your queue that you can't yet afford and they'll be brought when you can afford them. Perhaps I need to make this more clear in the plugin's messaging?
SleepKiller is offline
martellus
Member
Join Date: Jan 2013
Old 10-11-2014 , 17:17   Re: [TF2] Escalation - an Upgrades Mod for TF2 (0.9.7, 5/10/2014)
Reply With Quote #8

Very cool plugin, but here are some quick bugs I encountered:

/upgrades doesn't work

After closing the upgrade menu, it seems impossible to reopen it with chat commands, console still works -nevermind, it does work, but not nearly as often as console commands which are 100%

It gives you double credits than what it says you should recieve, 10 becomes 20, 20 becomes 40.


Is there a way to just set income levels in escalation_gameinfo for all game modes or maps?

Last edited by martellus; 10-11-2014 at 18:31.
martellus is offline
SleepKiller
Junior Member
Join Date: Jul 2014
Old 10-11-2014 , 20:02   Re: [TF2] Escalation - an Upgrades Mod for TF2 (0.9.7, 5/10/2014)
Reply With Quote #9

Quote:
Originally Posted by martellus View Post
Very cool plugin, but here are some quick bugs I encountered:

/upgrades doesn't work

After closing the upgrade menu, it seems impossible to reopen it with chat commands, console still works -nevermind, it does work, but not nearly as often as console commands which are 100%
Thanks for giving it a go! I'll add more chat triggers in the next update then. Thanks for the feedback.

Quote:
It gives you double credits than what it says you should recieve, 10 becomes 20, 20 becomes 40.
Well um this is awkward. Looks like I left the setter for a client's total earned credits (used to find the average credits when a client joins the game, which is also broken for some reason currently.) setting the value of a client's credits. This has been fixed in the next version. Thanks for pointing it out, can't believe I missed it myself.

Quote:
Is there a way to just set income levels in escalation_gameinfo for all game modes or maps?
Sure just copy one of the already existing gamemode configs, rename one or just use one. Then look for the "prefixes" section and change all the gamemodes you want using it to use your previously created config. After that just remove all the explicit map definitions from "map_configss" (which I only just noticed has a typo.) On a random note custom gameinfo files are on my to-do list, but probably won't make the next version.

I will hopefully have a new version out today that fixes all the bugs people have reported.
SleepKiller is offline
martellus
Member
Join Date: Jan 2013
Old 10-11-2014 , 20:32   Re: [TF2] Escalation - an Upgrades Mod for TF2 (0.9.7, 5/10/2014)
Reply With Quote #10

Is there a way to include non gamemode maps, or just one without a prefix? I am thinking of like dm maps. I assume thats not supported yet..?
martellus is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 15:27.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode