Animation sound event plays continuously when saving and loading Created 2 weeks ago2024-10-27 14:02:05 UTC by Xawdlan Xawdlan

Created 2 weeks ago2024-10-27 14:02:05 UTC by Xawdlan Xawdlan

Posted 2 weeks ago2024-10-27 14:02:05 UTC Post #349284
I've got a custom animated .mdl, one sequence has a number 5004 event to emit a sound at a certain frame. It works well in HLAM and ingame, but when I save the game and then load, the sound gets played repeatedly (and annoyingly) every frame. Only way to unstuck it is to run the sequence again. Saving and loading again gets me the error once more. This only happens if the sequence has been triggered at least once before saving, nothing happens otherwise (as it should). I've read somewhere that 5xxx events are for weapon viewmodels only but that's not accurate I think.

I seem to recall that this was a common HL engine bug many years ago but it got fixed... Right?
Posted 1 week ago2024-11-08 21:46:34 UTC Post #349325
Perhaps it has something to do with this?

https://www.jwchong.com/posts/npc-ammo-duplication

Something is definitely not being saved-restored correctly and the sound gets triggered again when loading. Well, I used a workaround as I couldn't reproduce it by modding standard entity models with the model viewer to add a 5004 event and force the bug.
Posted 6 days ago2024-11-10 19:47:52 UTC Post #349326
I'm no coder/modeller, and I'm not familiar with this particular bug I'm afraid. Considering nobody has come by to answer this, you might have better luck asking on the Discord server. Most members simply hang around there now, rather than on site.
monster_urby monster_urbyGoldsourcerer
Posted 5 days ago2024-11-11 20:55:28 UTC Post #349327
Thanks, luckily it's not a critical issue, just something that bugged me because I got it with my custom model but can't seem to replicate it with HL's models. Could also be because my model doesn't have an "idle" animation, so when the sequence plays it doesn't switch to another animation, it just stays frozen in the last frame, so when loading the game maybe the engine fires the event again (HL models have many idle anims, so for example when killing a soldier there is a "dead_idle" sequence used after the "dying" one, instead of just freezing the last "dying" frame). Who knows.
You must be logged in to post a response.