So, you remember that project I was working on that would turn someone else's Minecraft recreation of Mann Manor back into a playable TF2 map? I ran into a weird problem.
See, among other things, I reskinned the resupply cabinet as a wooden chest. And thanks to Freyja's advice on replacing sounds, I was able to successfully swap out the sound it usually makes when you open and close one. It took me some trial, error, and judicious use of snd_refresh to get it to sync up properly with the actual animation, since the pause in between the open and close sequences is hard coded into the game. But once I finally got it right, I discovered a new issue: The sound file cuts off before it can finish!
My first thought was that there must be a hard limit to how long this sound will play. So I double-checked whether the open and close sequences were in fact as fast as they are in the real game, and sure enough, they were a bit too slow. So I cut them down, recompiled the model, and reloaded the game; even without changing the sound file in any way, the faster animations failed to mess up the syncing. But then I got another idea: What if it was cutting out the sound at the moment the animation ended? So I added a little extra time to the end of the close sequence to see if it did anything. But again, the sound stopped the split second the lid landed.
Any clue what might be happening here? Is there maybe an actual hard limit on length?
See, among other things, I reskinned the resupply cabinet as a wooden chest. And thanks to Freyja's advice on replacing sounds, I was able to successfully swap out the sound it usually makes when you open and close one. It took me some trial, error, and judicious use of snd_refresh to get it to sync up properly with the actual animation, since the pause in between the open and close sequences is hard coded into the game. But once I finally got it right, I discovered a new issue: The sound file cuts off before it can finish!
My first thought was that there must be a hard limit to how long this sound will play. So I double-checked whether the open and close sequences were in fact as fast as they are in the real game, and sure enough, they were a bit too slow. So I cut them down, recompiled the model, and reloaded the game; even without changing the sound file in any way, the faster animations failed to mess up the syncing. But then I got another idea: What if it was cutting out the sound at the moment the animation ended? So I added a little extra time to the end of the close sequence to see if it did anything. But again, the sound stopped the split second the lid landed.
Any clue what might be happening here? Is there maybe an actual hard limit on length?