Skip to content

[TF2] Auto-equip powerup canteen when ForceUpgrades is enabled (Freaky Fair) #1424

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Lizard-Of-Oz
Copy link

@Lizard-Of-Oz Lizard-Of-Oz commented Jul 13, 2025

Description

TL;DR: this PR auto-equips a free powerup canteen on cp_freaky_fair (and other non-MvM maps with Upgrades), a QoL change already applied to other gameplay-relevant action items, and even canteens in MvM.

When playing MvM, you get a powerup canteen as a default Action Item in your loadout menu that gets auto-equipped if your action slot is empty.
Similarly, you auto-equip a free Spellbook Magazine on maps that use Spells and the Grappling Hook in Mannpower.

This, however, isn't the case on non-MvM maps with Upgrades enabled via ForceEnableUpgrades. One such map, cp_freaky_fair, was added in Scream Fortress 2024.
You have to manually equip your powerup canteen in your loadout... Assuming you have one... Which will then remain equipped and prevent you from using the Spells on other Halloween maps.

This Pull Request fixes that and gives you a temporary powerup canteen if ForceEnableUpgrades is set to 2, which is how non-MvM maps enable Upgrades.

This PR also adds mode 3 to ForceEnableUpgrades. This new mode also enables the Upgrades (like mode 2), but does NOT auto-equip the canteen.
This is made for potential maps that would want to use MvM money for purposes not related to Upgrades.
Because most (if not all) maps that currently use ForceEnableUpgrades do so specifically for the Upgrades, it's worth having canteens auto-equipped by default should Upgrades be enabled, unless specifically told not to.

image

Bitl added a commit to BitlDevelopmentStudios/source-sdk-2013-bds-base that referenced this pull request Jul 18, 2025
@Mikusch
Copy link

Mikusch commented Jul 23, 2025

Changing the current behavior of ForceEnableUpgrades 2 is not a good idea, as it is also commonly used to enable the currency counter in the HUD. Any maps or scripts using this feature would now get the popup even if they don't want it.

This should really be its own input/netprop instead of overloading the meaning of m_nForceUpgrades and introducing potentially undesirable changes.

@Lizard-Of-Oz
Copy link
Author

The popup doesn't appear outside of MvM - the only change this does is replacing an empty action slot with a "stock" powerup canteen if the conditions are met.

If the behavior of existing ForceEnableUpgrades values must be preserved, we could make it so that ForceEnableUpgrades 3 gives the players a "stock" canteen, which would require 1 line change to this PR.

bool CTFGameRules::ShouldProvidePowerupBottle( void )
{
-	return GameModeUsesUpgrades() && m_nForceUpgrades != 3;
+	return GameModeUsesUpgrades() && m_nForceUpgrades != 2;
}

This change will provide a free canteen if the m_nForceUpgrades value is either (3) or (0 and it's MvM).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants