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

[vJASS] Play 3D Sound

Status
Not open for further replies.
Level 17
Joined
Feb 11, 2011
Messages
1,860
Hi,

I based a lightning spell off the Channel spell. I want to play the "LightningBolt.wav" sound when the spell is cast. The problem is that when I set the "Sound - Effect Sound" field of the spell to the desired sound, it doesn't play. I figured that I would have to trigger the sound. Here is what I have so far:
JASS:
local sound snd = CreateSound("Abilities\\Spells\\Orc\\LightningBolt\\LightningBolt.wav", false, true, true, 12700, 12700, "")
call StartSound(snd)
call SetSoundPlayPosition(snd, 3)
call SetSoundPosition(snd, GetUnitX(.caster), GetUnitY(.caster), 0)
call SetSoundChannel(snd, 11)
call SetSoundDistanceCutoff(snd, 3000)
call SetSoundVolume(snd, 122)
call KillSoundWhenDone(snd)
set snd = null
Am I missing an important function?

Thanks for your help.
 
Status
Not open for further replies.
Top