Open RalphORama opened 1 year ago
confirmed issue. around for a long time too
there's a workaround in my fork here that mitigates the issue but it's fairly hacky: https://github.com/SpiffyJUNIOR/ArcCW/blob/master/lua/weapons/arccw_base/sh_anim.lua#L270
ArcCW already has a line that does the same thing - it doesn't fix this issue fully.
The problem appears to be that when the weapon is spawned directly into the player's hands, the deploy animation is never called with IsFirstTimePredicted()
returning true, so the sound table never plays since this line only wants to play on first prediction. Can be verified by spawning a weapon on the ground, picking it up, then switching to it - ready animation sounds should work.
Probably symptom of a deeper issue, but we can workaround it.
should probably close this because https://github.com/HaodongMo/ArcCW/pull/148 got merged
I just tested and #148 did not fix the ready sound issue in a dedicated server or as listen server host.
Additionally, ready (and presumably draw) animations do not play sound in a dedicated server if swapping from another ArcCW weapon. The cause is likely the same - the PlayAnimation
function is never called with a first predict so soundtable never plays.
Does SWEP:Deploy being called on client change anything?
It's relevant because in singleplayer we don't ever worry about prediction, and SWEP:Deploy()
is only ever called once.
I don't remember the bodygroup issue but if it's checking IsFirstTimePredicted()
in SWEP:Deploy()
it will likely encounter this exact issue.
Pushed a hacky fix. If someone else can verify it works, I'll close this issue for the time being.
After testing it for some time, it seems to work...kind of. What I mean by that is that, yes, the ready sound does now play for me, but for some reason, it plays at a volume that is basically silent. It feels like the ready sound is at 1% volume for me, but still better than 0% of course lol!
And inspect animations did break for me too, but I don't know if that is because of this exact change or not.
After testing it for some time, it seems to work...kind of. What I mean by that is that, yes, the ready sound does now play for me, but for some reason, it plays at a volume that is basically silent. It feels like the ready sound is at 1% volume for me, but still better than 0% of course lol!
If you enable arccw_dev_alwaysready
, can you hear a difference between the volume of a bugged ready or a normal one?
Situations that trigger the ready bug including spawning a weapon directly into your hand, and swapping to a weapon from a different ArcCW gun (or potentially any gun with a holster mechanic). Swapping from an engine weapon (like physgun) to an already initialized weapon on your player should play the sounds normally.
Also, if you can provide the weapon pack you are testing this with, and/or video recording of the issue, it would help greatly.
arccw_dev_alwaysready did fix the problem! I was testing this within my TTT2 server and enabling that command does always play the sound with the correct value.
I've been testing this with the Urban Decay + Urban Renewal weapon packs. Here's a clip https://streamable.com/nk0a42 (if the clip's expired please let me know)
Pushed another fix as I think I found the root cause.
Since the weapon is relying on SWEP.UnReady
to check whether the deploy is the first time, and immediately unsets the flag, later predicted deploy calls will think this deploy is not the first time, and use draw animation instead. The flag is now only set for the client after deploy is over and disabled state changes to idle, or on holster.
@GermanPlasma Please pull latest and test again - I'm a lot more confident that this fix addresses the problem.
@TheOnly8Z I am sorry to say that after testing with the latest version, none of the sounds seem to appear anymore. arccw_dev_alwaysready
doesn't change anything either :(
@GermanPlasma I've made a few changes since - can you test again?
@TheOnly8Z So I've tested it and I think it's some good progress, but there is still an issue:
It seems that weapons do play their ready sounds now regardless of if arccw_dev_alwaysready
is on or off. However, with arccw_dev_alwaysready
set to off, they only do it once for each weapon. For example, if you play TTT2 and you pick up a weapon, it will play the ready sound, but if you throw that weapon away and pick it back up, it will not play the ready sound any more.
It seems that weapons do play their ready sounds now regardless of if
arccw_dev_alwaysready
is on or off. However, witharccw_dev_alwaysready
set to off, they only do it once for each weapon. For example, if you play TTT2 and you pick up a weapon, it will play the ready sound, but if you throw that weapon away and pick it back up, it will not play the ready sound any more.
The intended behavior (with alwaysready
off) is that the gun should only play the ready
animation and sound the first time it is deployed by anyone, and all subsequent deploys play the draw
animation and sound even if the gun is dropped and picked up by someone else.
Are you saying that the animation is behaving as intended but the sounds are not?
The way it is right now, the ready
animation plays every time the weapon is picked up, but the sound of the ready
animation only plays the first time the weapon is picked up.
here's a video to demonstrate the issue (alwaysready
is set to off)
Seems like the client isn't setting the UnReady variable. I've pushed a fix - see if this one works.
It seems to still do it :/ However I'm pretty certain that it is unique to UC and UR weapons. Other weapons do not seem to have this issue, at least from what I could tell.
Appears that there's code that resets UnReady on drop for TTT - but it was only serverside. It's disabled now, so it should really work this time, maybe. @GermanPlasma
Honestly I couldn't notice any apparent issue with the newest update! I only really did a small test, but yeah, the ready animation plays once per weapon now, sounds play fine as well. I'll do some more testing later on (and especially once I play with friends but that's gonna take some days) but I love it so far!
Sounds good. I'll close the issue for now - feel free to reopen it if it's still happening.
The issue still exists. I was testing it with another user, animation and sound only plays one single time. Any further weapon after the first then on only plays the initial ready animation (as it should of course) but without any sound to it. However, this seems to only be the case for any user that isn't the host. I (as the host) don't seem to have the issue.
@TheOnly8Z And I don't think I have permission to reopen this issue
However, this seems to only be the case for any user that isn't the host. I (as the host) don't seem to have the issue.
Presumably in a listen server?
Peer-to-peer, I believe that qualifies as listen server yeah.
When writing a SWEP with a
SoundTable
field in the["ready"]
animation sequence, the sounds do not play for the client when in a multiplayer server. They will, however, play for other clients (i.e. you cannot hear yourself rack a slide when picking up a gun, but players around you can).I believe this is an issue with how sound tables are played in
sh_anim.lua
.Example Code
Taken from the Black Ops SWEP pack
Steps to reproduce
Sounds working in single player
ready
sounds will play when given a weapon in the single player gameSounds not working in multiplayer
ready
sounds will not play when given a weapon in the multiplayer server