Repository navigation
Partial reloads 15: Add partial reloads to the SRS - #2301
Closed
sunzenshen wants to merge 1 commit into
Closed
sunzenshen wants to merge 1 commit into
sunzenshen wants to merge 1 commit into
Conversation
The SRS script gets the reload phases from neoAssets and a chamber
slot: #base "weapon_srs_reload_phases.txt", "ReloadPhases" {} and
"ChamberedRound" "1", and game_sounds_weapons.txt the three reload
sound pieces the phases play (weapon_srs.reload_unload, reload_load,
reload_cycle). The generic phase code then resumes a reload
interrupted after the unload or the load, and a reload with a round
chambered skips the bolt pull.
The bolt cycle after a shot needs its own hooks, all inert with
sv_neo_reload_experimental at 0. Until the bolt is home (the charge
row of the phase table) the chamber holds the spent case, so
IsRoundChambered() is false, a shot is ignored, and a reload with
rounds left waits: it would otherwise count the case as a chambered
round and add one round from nothing. A switch during the bolt cycle
keeps it pending, and the next draw finishes it before the gun fires.
The chamber queries of the base weapon become virtual for this
override.
This was referenced Nov 9, 2026
sunzenshen
force-pushed
the
stack/reload-zr68c/95-aa13
branch
from
November 10, 2026 02:10
93c20eb to
7edf5ab
Compare
sunzenshen
force-pushed
the
stack/reload-zr68c/100-srs
branch
from
November 10, 2026 02:10
31c04bd to
cf239c9
Compare
This was referenced Nov 13, 2026
Contributor
Author
|
Closing to clear the board in favor of the PR stack of sunzenshen#34 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Depends on NeotokyoRebuild/neoAssets#187 (layer 15: the SRS sources, clips, phases file and sound pieces).
Partial reloads 15: add partial reloads to the SRS. This PR builds on layer 14 (#2300, the AA13) and pairs with
neoAssets layer 15. Next: #2302 (16, PZ252).
The phase code of 03-05 is generic: a weapon gets partial reloads from its weapon script and a phases file. The SRS
also needs code, because it is a bolt action: after a shot the chamber holds the spent case until the bolt is home.
#base "weapon_srs_reload_phases.txt","ReloadPhases" {},"ChamberedRound" "1", as the ZR68Chas them. Its reload has three steps (magazine out, magazine seat, bolt) and three new sound entries,
weapon_srs.reload_unload,_load,_cycle.weapon_srs.cpp): thechargerow of the phases file gives the time the bolt is home.Until then
IsRoundChambered()is false, a shot is ignored, and a reload with rounds left waits. Without the wait areload during the bolt would count the spent case as a chambered round: one round from nothing. A switch during the
bolt keeps it pending; the next draw finishes it before the gun fires. Every hook does nothing with the flag at 0.
HasChamberSlot,IsRoundChambered,RoundsInMagazine,MagazineCapacity) becomevirtual; the SRS overridesIsRoundChambered.sv_neo_reload_experimentaldefaults to 1 while the partial-reload stack is reviewed (Partial reloads 06: Resume a ZR68C reload after the magazine is unloaded #2293); thelast PR of the stack sets it back to 0. With the flag at 0 the SRS behaves as on master.
How to review
weapon_srs.h/weapon_srs.cpp: theBoltPhases*hooks and theIsRoundChamberedoverride.weapon_neobasecombatweapon.h: the fourvirtualkeywords.weapon_srs.txt: the three lines, asweapon_zr68c.txthas them (Partial reloads 06: Resume a ZR68C reload after the magazine is unloaded #2293, Partial reloads 08: Keep a chambered round through a partial reload #2294).game_sounds_weapons.txt: the three SRS entries, in theweapon_zr68.reload_*pattern.chargerow).How to test
5+1.5+1. Fire it empty and reload: 5 with a dim round icon, then4+1atthe bolt.
5+1, not6+1.with a round chambered. Then once dry after the new magazine is seated (about 1.9-3.2 s in).
sv_neo_reload_experimental 0(set before the map loads): master behavior, 5 rounds, no+1.Results
Layer 15 build (this PR + neoAssets layer 15), Linux Debug,
ntre_engage_ctg, owner SRS plus abot_mimicbot:reload_skipcycle: 1 at the unload (+1.01 s) -> 6 (5+1) at the load (+1.88 s), ends +2.40 s; unload and load sounds once each; no bolt pullreload: 0 -> 5 with the round icon dim (+1.88 s) -> 4+1 at the bolt (+3.24 s)drawunloaded_reload: 0 -> 5 (+2.15 s) -> 4+1 (+3.51 s); load and cycle soundsdrawunloaded_reload_skipcycle: 1 -> 6 (+2.15 s)drawtocycle_reload: 5 dim -> 4+1 (+1.64 s); cycle soundchargeplays; the reload starts at the bolt home (0.99 s after the shot) from 1+1: 1 at the unload -> 6 (5+1)charge; chambered again 0.99-1.11 s after the shot (thechargerow is 0.833 s from the start ofcharge)reload3 -> 5 and 0 -> 5 at +3.12 s, whole sound; R during the bolt starts a masterreloadat once, 2 -> 5match_end=True, 0 asserts; bots reloaded to 6 (5+1)Toolchain
Linked Issues