| 01-29-2006, 06:29 PM | #1 |
If I make a sound play on attack, and the cooldown is really fast, it only plays it once while it attacks. How do i make it so the sounds overlap? |
| 01-29-2006, 06:48 PM | #2 |
Replace the default attack sound, that should do it. |
| 01-29-2006, 07:00 PM | #3 |
thanks for the reply but i have 36 different heros that use the same model and they all need different sounds..lol |
| 01-29-2006, 07:03 PM | #4 |
Its because when one sound hasn't finished, new one is going to play and can't. |
| 01-29-2006, 07:36 PM | #5 |
Either make multiple sound variables and play each one according to if the other one is finished or just play the sound from path, creating a new sound variable each time. |
| 01-29-2006, 07:48 PM | #6 |
JASS:function UnitSound takes unit u, string id, integer volume, real d returns nothing local sound snd=CreateSound(id,false,true,false,10,10,"") call SetSoundPitch(snd,GetRandomReal(0.8,1.2)) call SetSoundVolume(snd,volume) call SetSoundDistances(snd,600,d) call AttachSoundToUnit(snd,u) call StartSound(snd) call KillSoundWhenDone(snd) set snd=null endfunction Trigger: Custom script: call UnitSound(udg_hero,"Units\\Human\\Rifleman\\RiflemanAttack1.wav",125,4500) |
| 01-29-2006, 08:31 PM | #7 |
i have no idea how to put that in |
| 01-30-2006, 01:50 PM | #8 |
Put jass to the Custom Script and the trigger you should use in trigger when your hero attacks. Pretty easy me thinks. |
| 01-30-2006, 01:53 PM | #9 |
Sorry, but damage problem allows this trigger to be abused. If you stop unit before she starts anim, sound will play but she won't attack. |
| 01-30-2006, 02:03 PM | #10 |
That's true, but he told that he using very fast cooldown so it's isn't a really issue. |
| 01-31-2006, 01:28 AM | #11 |
and that will make it stack? syntax error? Custom script: call UnitSound(GetAttacker(),"war3mapImported\tacticalshotgun.wav",125,4500) Expected Function Name? |
| 01-31-2006, 06:13 AM | #12 |
That's because you either: A: Didn't put the JASS function mentioned above in at all, or B: Put it later in the code then when you try to call it. Quick JASS tutorial. Jass has things called functions. You call a function by saying JASS:call MyFunc(arg1, arg2, argn) JASS:function MyFunc takes nothing returns nothing endfunction function MyFunc2 takes nothing returns nothing call MyFunc() endfunction JASS:function MyFunc takes nothing returns nothing call MyFunc2 endfunction function MyFunc2 takes nothing returns nothing endfunction So make sure when that when you define the UnitSound function, it is above the places in the code where you call it. P.S. - Learn JASS: It's easier, faster, better than GUI, and it makes you feel better about yourself. JASS FTW! |
| 01-31-2006, 07:18 AM | #13 |
Just copy the function to your map's custom script section (in the trigger editor, in the treeview on the left, click on your map name). Then call it from your trigger. Also, in Jass, you must use "\\" in filenames, not just "\". |
| 01-31-2006, 07:59 AM | #14 |
Couldn't you just use 3D sounds? |
| 01-31-2006, 08:04 AM | #15 |
How would that change... anything? |
