Repository navigation
Sketch: M41 and MilSO reload resume as data - #2287
Closed
sunzenshen wants to merge 13 commits into
Closed
sunzenshen wants to merge 13 commits into
sunzenshen wants to merge 13 commits into
Conversation
A weapon script may list, per viewmodel reload sequence, the reload phases it credits (drop, seat, bolt), when each counts and when each sound piece plays. Weapons without the block parse no tables, which keeps them on the existing reload.
Behind sv_neo_reload_experimental (default 0), a weapon whose script has a ReloadPhases block credits the drop of its old magazine during the reload. A switch after the drop keeps that phase, and the next draw plays the weapon's draw-resume sequence, which seats the fresh magazine and pulls the bolt. A switch before the drop cancels the reload as before. The reload itself, its sound and its ready-time load are unchanged. Weapons without the block, and every weapon with the flag off, run the existing code.
The ZR68C reload credits the magazine drop at 0.700 s. The draw_resume_drop_dry sequence seats at 1.433 s and bolts at 2.367 s, with the seat, slap and bolt sound pieces at their transients.
The drop credit no longer empties the clip: an uninterrupted reload shows the clip as master's does, which bots read to tell an empty weapon. The old magazine is lost only when the draw resumes the reload. The seat sets the ready time, so FinishReload loads as on master and the end-of-reload hook goes away. A switch or a drop now stops the sound pieces, as the player stops the single reload sound. A dropped weapon, also on death, cancels its reload, so the next owner does not resume it. The resume no longer sends drawempty in the same deploy.
Describe what sv_neo_reload_experimental does in its help text and bound it to 0-1 like the other weapon cvars. Hoist the parser's name tables to file scope, group FindReloadTable with the other methods, and word the comments without reference to the base branch. No behavior change.
weapon_zr68c.txt includes its ReloadPhases rows with #base from weapon_zr68c_reload_phases.txt, which neoAssets ships and times from the Blender markers, so the sound and credit times follow the animation. A missing file leaves the block empty; the parser then warns and the weapon reloads without phases, as it does without the flag. The configure copy of neoAssets is ignored by git.
Use the step names neoAssets now ships: phases 1_unload, 2_load and 3_cycle (RELOAD_PHASE_UNLOADED, LOADED, CYCLED), the resume sequence resume_after_1_unload_empty, the row keys ammo, sound and sound2 (sound names under sound_name, sound2_name), and sound entries named after their step. No behavior change.
A resume sequence's ReloadPhases block may give a 4_ready time: the reload is done and fire is allowed there, and the clip plays on to its end unless a shot interrupts it. Without the key, fire waits for the end of the sequence as before.
Drop the 4_ready time: the resume clip now ends where the hands are at rest, so the reload finishes and fire is allowed when it ends.
Reload() now times the phases of the sequence the viewmodel plays, not a fixed "reload", so a gun whose empty reload is reloadempty gets that table. A row's "resume" key names the sequence that resumes a reload interrupted after its step; Holster keeps the phase and the table that names it, and a second switch before a resume's first step plays that resume again. This replaces the hardcoded resume name. Sound pieces stop from the playing table only.
Sketch, not a product. weapon_m41.txt includes the M41 phases from neoAssets, and the three-step reload pieces get sound entries. No C++ change is needed for the resume after the unload.
Sketch, not a product. weapon_milso.txt includes the pistol phases from neoAssets, and the load step gets a sound entry. No C++ change is needed for tactical and dry resumes after the unload.
Contributor
Author
|
This PR is not ready for review, it was mostly intended to sketch out what it would look like to integrate multiple weapons for partial reloads, so that the code in #2285 ideally mostly survives with the end goal in mind. The idea is know how much code needs to be added in order to add another weapon to the partial reload feature set. I plan to rebase this branch as other PRs get merged, to get an idea of what is left to integrate as far as the code stubs go. |
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
Sketch, not for review. This draft tests whether the ZR68C MVP's reload-resume code (#2285) extends to more weapons as data only. It adds the M41 and the MilSO pistol, each resuming after the unload step. Nothing has been run in game, and the M41 and MilSO sounds are placeholders.
The branch contains the MVP commits. The notes below describe only what it adds.
Result
No reload C++ changed. Only data and
// NEO TODOcomments:weapon_m41.txtandweapon_milso.txt: the#baseline for the phases file and an empty"ReloadPhases"block.game_sounds_weapons.txt: the M41 sound pieces (4) and the MilSO load piece (1).Two MVP choices made this data only: the table is looked up by the sequence that plays, and each row's
resumekey names its resume sequence.How the pistol fits
reload(tactical) andreloadempty(dry) each have their own table and their own resume:resume_after_1_unloadandresume_after_1_unload_empty.reloadempty's3_cyclerow.drawemptystays the fallback for a model without the resume.Open items
Recorded as comments in the weapon scripts and the phases files:
ReloadReadyBeforeEnd; whether to ship recompiled base models; share clips across the M41 family or not.holstervsholsteremptyis picked at random during a dry resume.Toolchain
Linked Issues