• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[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