• 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] replicating the traits of a global sound

Status
Not open for further replies.
Level 10
Joined
Sep 21, 2007
Messages
517
ok basically what i want is to base a local sound off the traits of a global sound created in the sound editor. i noticed CreateSound() doesnt work with it, even if i use the "gg_snd_SOUNDNAME" as the file name, should i use
CreateSoundFromLabel() ?

i attempted it here, but i failed:
JASS:
        set atk = CreateSoundFromLabel("gg_snd_Shotgun", false, true, true, 10, 10)
        call AttachSoundToUnit(atk, p)
        call StartSound(atk)
        call KillSoundWhenDone(atk)

even the volume to be replicated/copied.

is the mistake from me or, does the function not work the way i thought it could?

btw yes it is a 3D sound, and a has a minimum range.

thanks for your time
 
Level 13
Joined
Nov 22, 2006
Messages
1,260
CreateSoundFromLabel should take just a name as a label, not a global variable name, I think. So in your case it's something like "Shotgun" instead of "gg_snd_Shotgun".

Also, you can get labels from spells with the GetAbilitySoundById function (by passing the rawcode of the spell as a first and something like SOUND_TYPE_EFFECT as a second argument).

You can always search the forums about the problems with CreateSound or CreateSoundWithLabel...
 
Level 10
Joined
Sep 21, 2007
Messages
517
its not for spells, btw i did search forums. >_>

edit: problem is with fadein/fadeout rate (decided to use CreateSound(), since not sure labels work for custom sounds, guess its not like it is in sound editor, Lul

Edit2: it seems that .wav files dont play, il try to not include in it the filename...
 
Last edited:
Status
Not open for further replies.
Top