• 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.

WC3 sound looping

Status
Not open for further replies.
Level 2
Joined
Dec 15, 2010
Messages
8
Hi!

I have a problem. I'm in the middle of a map progress, and this map is sort of futuristic. So in the map I have Marines with weapons, and I would like to hear a nice, smooth gun sound, when those Marines are firing at enemies. Now I have a trigger, looking like this:

--------------------------------------------------------------------------

Events:
Unit - A Unit is Attacked

Conditions:
Or - Any (Conditions) are true
Conditions:
Unit Type of (Attacking Unit)) Equal to 'Marine Shotgun'
Unit Type of (Attacking Unit)) Equal to 'some other model I have'

Actions:
Sound - Play 'Shotgun sound' at X% volume, attached to (Attacking Unit)

--------------------------------------------------------------------------

This trigger simply runs when I have 1 Marine firing at a target. But here's the problem; this sound is like 5 seconds long. Now I place 2 Marines next to each other, the 1st starts firing at a target, and the 2nd starts firing at a target just 2 seconds after the first. Here I would like to force the sound to play 2 times, crossing eachother, but that won't work. I do only hear the sound being played once; the sound can only play once it's done playing, it can't LOOP.

So I thought that with downloading some kind of Model Editor I could open up a model, and find the attached sound to that model (Used War3 Model Editor) but with no luck. So any suggestions?
 
Level 2
Joined
Dec 15, 2010
Messages
8
function DefineSound takes string fileName, integer duration, boolean looping, boolean is3D returns integer
function DefineSoundEx takes string fileName, integer duration, boolean looping, boolean is3D, boolean stopwhenoutofrange, integer fadeInRate, integer fadeOutRate, string eaxSetting returns integer
function RunSound takes integer soundRef returns sound
function RunSoundOnUnit takes integer soundRef, unit whichUnit returns sound
function RunSoundAtPoint takes integer soundRef, real x, real y, real z returns sound
function RunSoundForPlayer takes integer soundRef, player p returns sound
function ReleaseSound takes sound s returns boolean
Where do I put this code?
In the trigger editor?
When I mark a trigger, I can click "Edit" and find "Convert to Custom Text", but then the trigger already has some codes within it.
 
Level 2
Joined
Dec 15, 2010
Messages
8
Probably.. And I must say that I've never worked with scripts, so...
Though I thought of another thing.

-------------------------------------------------------------------------------------

Events:
Unit - A Unit is Attacked

Conditions:
Or - Any (Conditions) are true
Conditions:
Unit Type of (Attacking Unit)) Equal to 'Marine Shotgun'
Unit Type of (Attacking Unit)) Equal to 'some other model I have'

Actions:
Sound - Stop (Last played sound) Immediately
Sound - Play 'Shotgun sound' at X% volume, attached to (Attacking Unit)

-------------------------------------------------------------------------------------

The thing is... I would like the sound to fade out, but this isn't possible without the sound being a socalled '3D sound'.
 
Status
Not open for further replies.
Top