HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Sound Help Fast

06-03-2006, 02:44 PM#1
Kilroy40
Okay I am using the Konstruct marine and I need to make it so each time the unit attacks, it plays a gun sound. I am using his minigun, assault rifle, submachine gun, sniper rifle, and shotgun. Each gun needs it's own sound, and each gun is on a different hero. I already have sounds for it I just need to know how to apply them to the models.
I tried doing so with triggers but it won't play the sound every time the unit shoots.
06-03-2006, 04:44 PM#2
Panto
Either the modelling or sound forums would have been a more appropriate choice. I'll try moving you to Sound and see if that helps.
06-03-2006, 10:18 PM#3
Challis
Best I can suggest is that you have no sound embedded in the model, just trigger it to play the sound when it attacks. Use triggers, that's my advice.
06-06-2006, 07:57 PM#4
Kilroy40
I do, but it doesn't play the sound EVERY time it attacks.
Heres the trigger I think.
Events
A unit is attacked
Conditions
Unit type of - attacking unit - equal to SWAT
Actions
attach Submachine_Gun_Sound to Attacking unit

Is there a way to make it play the sound every time?
06-06-2006, 08:07 PM#5
SnaKy
Put jass thing to the Custom Script
Collapse 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
And then ...
Trigger:
Custom script: call UnitSound(udg_hero,"Units\\Human\\Rifleman\\RiflemanAttack1.wav",125,4500)
06-06-2006, 08:25 PM#6
Kilroy40
And also, how do I make a sound only play for a certain player?
_____________________

I don't understand how to use that JASS, or any JASS. Can you explain?
06-06-2006, 09:17 PM#7
Tim.
Read our Rules, do no double post. This is a trigger issue so I will move the thread.
06-07-2006, 12:49 AM#8
Kilroy40
Okay I think I just solved all my problems with the WEU. THANK YOU WEU YOU ROCK, WOOOOOOOOOOOOOO!