Skip to content

Conversation

@sunzenshen
Copy link
Contributor

@sunzenshen sunzenshen commented Sep 29, 2025

Description

  • When fast switching by pressing 4 to select utility items, the utility item that matches your class's default utility will now be prioritized over others.
  • When switching next/previous weapon and the carousel arrives on slot 4, prioritizes the class utility if it exists.
  • If you don't have the default utility item for your class, you will cycle through any available utility items in the order in which they are defined in /game/neo/scripts/weapon_*.txt
    • (e.g. weapon_grenade.txt, weapon_smokegrenade.txt, and weapon_remotedet.txt)
    • This cycling order also applies if you already have slot 4 equipped.

Toolchain

  • Windows MSVC VS2022

Linked Issues

@sunzenshen
Copy link
Contributor Author

Demo of how this PR handles fast switch to the preferred class utility:

equip_utility_prioritize_class_default.mp4

Note that the cycle order after already being in equipment slot 4 depends on the order in which weapon_*.txt scripts define the UserCmd_Slot4 bucket assignments.

Demo of being a support player with all utilities expending their utilities:

equip_utility_support_expended_utilities_cycle.mp4
  • Note that the remaining utility that you switch to is defined by the incremented item number that follows the utility you just expended. For example, after the Support player expends their smoke grenades, the game autoswitched to the detpack, because the detpack is in the +1 bucket after smoke grenades.
  • Note that the order of swap preference when there are no more class utilities follows grenade, then smoke, then detpack. The demo shows this with the Support player switching to primary weapon and then back to slot 4, which prioritizes the available grenade.

Tested by overriding in file neo_player.cpp the default class equipment assignments by giving every class all of the utilities in CNEO_Player::GiveDefaultItems and also reducing the XP cost of detpack assignment to nothing in GiveDet(CNEO_Player* pPlayer).

@sunzenshen sunzenshen requested a review from a team September 29, 2025 07:32
@sunzenshen
Copy link
Contributor Author

This is what cycling next/previous through the weapon carousel looks like when the class utility is prioritized with Recon/Assault

equip_cycle_carousel_prioritize_utility_recon_assault.mp4

Carousel cycling for Support

equip_cycle_carousel_prioritize_utility_support.mp4

@sunzenshen sunzenshen changed the title Prioritize fastswitch slot4 to class default equipment Prioritize class default equipment when switching to slot 4 Sep 29, 2025
@sunzenshen
Copy link
Contributor Author

sunzenshen commented Sep 30, 2025

Added a configuration menu to toggle between the standard engine behavior and the new class prioritized utility selection (the new default):

image

Looking for feedback on what to name the default value...

Currently in the PR:
image

Alternatively:
image

@sunzenshen sunzenshen force-pushed the class-assault-utility-switch-prioritize-he branch from ad2b424 to 9ba6f42 Compare September 30, 2025 03:13
@sunzenshen sunzenshen added the Enhancement New feature or request label Oct 25, 2025
@sunzenshen sunzenshen force-pushed the class-assault-utility-switch-prioritize-he branch from ad8cd1f to 95c2f4f Compare November 9, 2025 20:40
Prioritize class utility when cycling carousel

Config: Utility slot equip priority

Choose between standard source engine bucket behavior or prioritizing the default class utility (default)
@sunzenshen sunzenshen requested a review from a team November 9, 2025 20:41
@sunzenshen sunzenshen requested a review from a team November 20, 2025 03:48
@Rainyan Rainyan requested review from Rainyan and removed request for a team November 25, 2025 15:29
Copy link
Collaborator

@Rainyan Rainyan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@sunzenshen sunzenshen merged commit 4d2ee7f into NeotokyoRebuild:master Nov 26, 2025
7 checks passed
@sunzenshen sunzenshen deleted the class-assault-utility-switch-prioritize-he branch December 16, 2025 04:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Utility should default to frag grenade for assault even when they pick up other utilities

3 participants