• 🏆 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!

[JASS] 3d sound wont sound!0_0

Status
Not open for further replies.
Level 7
Joined
Mar 22, 2010
Messages
228
JASS:
function Trig_useapple_Actions takes nothing returns nothing
    call PlaySoundBJ( gg_snd_bite2 )
    if GetItemCharges(GetManipulatedItem()) == 0 then
        call UnitRemoveItemSwapped( GetManipulatedItem(), GetManipulatingUnit() )
        call RemoveItem( GetManipulatedItem() )
    endif
endfunction
i did not set it to MAP Init, this trigger runs when a unit uses an item, i imported a file in sound editor and used it as a sound then set it to 3D, but whenever i try to run the trigger i wont make any sound...
 
Level 7
Joined
Mar 8, 2009
Messages
360
Sounds are tricky, this is the way i play a sound at a location

JASS:
local sound s = CreateSound("Units\\Orc\\Shaman\\ShamanReady1.wav", false, false, true, 10, 10, "")
call SetSoundPosition(s, GetSpellTargetX(), GetSpellTargetY(), 0)
call SetSoundVolume(s, 127)
call StartSound(s)
call KillSoundWhenDone(s)
set s = null

It can be more efficient to not destroy the sound and only create sound once and only do
JASS:
call SetSoundPosition(s, GetSpellTargetX(), GetSpellTargetY(), 0)
call SetSoundVolume(s, 127)
call StartSound(s)
each time you want to play the sound.
 
Status
Not open for further replies.
Top