• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Sound Issues In Reforged?

Status
Not open for further replies.
Level 2
Joined
Oct 6, 2016
Messages
4
There seems to be sound issues in reforged from maps coded in 1.26. I think the bug has something to do with PlaySoundOnUnitBJ.

function PlaySoundExFollowUnit takes string filePath,unit u,boolean isLoop,boolean is3D,integer volume,integer minRange,integer maxRange returns sound
set bj_lastPlayedSound=CreateSound(filePath,isLoop,is3D,true,minRange,maxRange,"Default")
call SetSoundDistanceCutoff(bj_lastPlayedSound,10000000.)
call PlaySoundOnUnitBJ(bj_lastPlayedSound,volume,u)
call StartSound(bj_lastPlayedSound)

"All Sounds are silent using this function."
call PlaySoundExFollowUnit("war3mapImported\\raohRW.mp3",LoadUnitHandle(YDHT,GetHandleId(GetExpiredTimer()),$437E2A40),false,false,127,5000,6000)
This sound does not work.
Deleting PlaySoundOnUnitBJ actually makes these sounds work which is a pretty weird bug.
 
Level 12
Joined
Jan 30, 2020
Messages
875
Looking at the BJ inBlizzard.j :
JASS:
function PlaySoundOnUnitBJ takes sound soundHandle, real volumePercent, unit whichUnit returns nothing
    call AttachSoundToUnitBJ(soundHandle, whichUnit)
    call SetSoundVolumeBJ(soundHandle, volumePercent)
    call PlaySoundBJ(soundHandle)
endfunction
(The BJ inside are mostly wrappes, the playsound one being a wrapper for the local player context)

Makes me think that your function "PlaySoundExFollowUnit" starts the sound twice.

Try to just remove "call StartSound(bj_lastPlayedSound)" or simply stay away from crappy BJ wrappers ;)
 
Status
Not open for further replies.
Top