sv_neo_wep_xp_override cheat, includes fix for detpack loadout grant - #2082
Conversation
a97e43e to
6cc2716
Compare
Adds a replicated cheat cvar that overrides the effective XP used in weapon eligibility checks, so any rank tier can be tested without grinding XP. Applied at the loadout menu count, both server-side loadout validations, and bot weapon selection. Bot profile weapon-bit validation is left untouched since it validates per-rank config rather than a specific player's XP. Note that bots choose their loadout at spawn, so a mid-round change applies from the next spawn onward.
The recon spawn path hardcoded an XP >= 4 check before calling GiveDet, so raising or lowering sv_neo_detpack_xp_limit had no effect on whether the detpack was actually granted. Replace the hardcoded gate with an eligibility check at the top of GiveDet that reads the convar directly, making it the single source of truth. The check runs before the weapon entity is created, preserving the old gate's property that ineligible spawns never pay a create/destroy cycle. GiveDet's old internal cost check, which created the entity first to reach GetNeoWepXPCost, is dropped in its favor. The check routes through GetEffectiveXP so sv_neo_wep_xp_override covers the detpack as well.
Reimplement the cvar inside GetEffectiveXP as an effective max rank (XP_LIEUTENANT) instead of scattered bypass checks. This removes the two redundant call-site checks in neo_player.cpp and the unused extern in the loadout menu. Behavior change, wider scope on purpose: the cvar previously bypassed only the two server-side loadout validations, and the loadout menu never honored it, so locked tiers stayed unclickable and it only worked via a typed loadout command. It now also unlocks the menu UI, bot weapon selection, and the recon detpack grant, matching what its description already claims. It takes precedence over sv_neo_wep_xp_override when both are set.
6cc2716 to
e802240
Compare
Rainyan
left a comment
There was a problem hiding this comment.
Perhaps it would be useful to set disabled value of sv_neo_wep_xp_override to something nonnumeric, for example "" (empty string) instead of -1, since players can have a negative XP. This would allow doing stuff like sv_neo_wep_xp_override -1 to test the "Rankless Dog" loadout logic, whereby players with <0 XP should be restricted to just the MPN loadout.
I'll follow-up on this with my incoming follow-up PR! |
Description
The commits in order:
sv_neo_wep_xp_overridefor testing XP-gated weapon behavior without grinding XP.sv_neo_ignore_wep_xp_limitinto the same mechanism.Note
Follow-up: sunmachine/ntre-dev // Check loadout XP eligibility before creating weapon entities - #3
The new cheat
sv_neo_wep_xp_overrideis bidirectional (a value below your real XP locks weapons, useful for testing the locked path), never mutatesm_iXP, and leaves scoreboard/rank display untouched. It is consolidated withsv_neo_ignore_wep_xp_limit.Detpack consistency fix: the recon path hardcoded
m_iXP >= 4before callingGiveDet, sosv_neo_detpack_xp_limithad no effect the detpack being granted. The convar is now the single source of truth, checked at the top ofGiveDetbefore the weapon entity is created, preserving the old gate's property that ineligible spawns never pay an entity create/destroy cycle.sv_neo_ignore_wep_xp_limitconsolidation: This commit is separable if the wider scope is unwanted, but I'll argue it's consistency without breaking existing workflows.Testing
All loadout tiers unlock from round one and Recon bots spawn with detpacks. Values apply on next spawn (loadouts and bot weapon choices are decided at spawn time); reopen the loadout menu after changing the value to refresh button states. Verified in-game on the toolchain below.
Toolchain
Linked Issues