Bunslinger Posted September 11, 2020 Share Posted September 11, 2020 i modified an existing mod to allow for hitsounds, but there's a problem: if you use a shotgun, it makes a hitsound for each individual pellet, and given how new vegas' sound works, this is considered "loud" and thus overrides most other sounds for a hot second. is there a way to allow only one instance of a sound? I.E. a sound can not overlap itself, especially if multiple instances occur at the same time, inadvertently making the sound louder? Link to comment Share on other sites More sharing options...
UnvalidUserName Posted September 11, 2020 Share Posted September 11, 2020 There's the StopSound command from JIP, and that's about it. I recommend making some check to see if the script fired in the last 2 or 3 frames, and skip the PlaySound if it did. Link to comment Share on other sites More sharing options...
lStewieAl Posted September 12, 2020 Share Posted September 12, 2020 You could instead just prevent the sound playing within some time interval of another by storing and comparing the current time before playing the sound. Link to comment Share on other sites More sharing options...
Bunslinger Posted September 19, 2020 Author Share Posted September 19, 2020 so how would i check the number of frames passed? the only functions i've seen count in realtime or game time, not frames Link to comment Share on other sites More sharing options...
UnvalidUserName Posted September 19, 2020 Share Posted September 19, 2020 I assume you are working on that hitsound mod and therefore you want to use it in an event handler. If that's the case, it's easier to use GetSecondsPassed but you might need to test how it behaves if called multiple times in a same frame. It theory it should return 0 unless it's being called without breaking out of the UDF Link to comment Share on other sites More sharing options...
KiCHo666 Posted September 19, 2020 Share Posted September 19, 2020 You could try using NVSE's OnHit. That one won't register more than 1 shotgun pellet per hit. Link to comment Share on other sites More sharing options...
Recommended Posts