HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

How can I prevent sounds overlapping?

05-29-2006, 05:07 PM#1
Fulla
Ok I made a doublekill/tripple kill etc. sounds trigger.

Works fine, except the sounds can overlap.
E.g. if a guy kills 3 units at same time,
Double Kill/ Tripple Kill will be played at same time.

Setting The Sounds Trigger
Trigger:
Set Sounds
Collapse Events
Map initialization
Conditions
Collapse Actions
Set MultiKill_Sound[2] = DoubleKill <gen>
Set MultiKill_Sound[3] = triple_kill <gen>
Set MultiKill_Sound[4] = MultiKill <gen>
Set MultiKill_Sound[5] = MegaKill <gen>
Set MultiKill_Sound[6] = LudicrousKill <gen>

Counting Kills Trigger
Trigger:
MultiKills
Collapse Events
Unit - A unit Dies
Collapse Conditions
Collapse And - All (Conditions) are true
Collapse Conditions
((Dying unit) is A Hero) Equal to True
((Killing unit) is A Hero) Equal to True
((Owner of (Dying unit)) is an enemy of (Owner of (Killing unit))) Equal to True
Collapse Actions
Set MultiKill_Integer[(Player number of (Owner of (Killing unit)))] = (MultiKill_Integer[(Player number of (Owner of (Killing unit)))] + 1)
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Remaining time for MultiKill_Timer[(Player number of (Owner of (Killing unit)))]) Greater than 0.00
Collapse Then - Actions
Sound - Play MultiKill_Sound[MultiKill_Integer[(Player number of (Owner of (Killing unit)))]]
Else - Actions
Countdown Timer - Start MultiKill_Timer[(Player number of (Owner of (Killing unit)))] as a One-shot timer that will expire in 8.00 seconds

Resetting Timer Trigger
Trigger:
MultiKills Condition
Collapse Events
Time - MultiKill_Timer[1] expires
Conditions
Collapse Actions
Set MultiKill_Integer[1] = 0

thx
05-29-2006, 05:25 PM#2
Soultaker
Put the play sound action into the "timer expires" trigger, and you got it. I would properly set the timer to a bit less (like 4-5 sec). But that would make it first to trigger after those seconds..

If you don't get what I'm saying, I'll make a map with it :)

Btw. Do you know that if you just create a timer array, then if you start the [2], [3], [4...] they will simply not start.

- Soultaker
05-29-2006, 07:22 PM#3
Fulla
Ok I think I sort of follow.

Change start timer, to run (reset timer) trigger?
How can I stop it playing the sound, wait a bit then play the sound?
05-29-2006, 08:04 PM#4
blu_da_noob
How about storing the sound you play in a variable, and each time you are going to play a sound, stop whichever sound was last played (the one in the variable) then set the variable to your new sound (which you then play).
05-29-2006, 08:12 PM#5
Soultaker
Well, now I submitted the map :)

The thing is, that when I started created those 10 different timers, I thought.. what the heck? Why not just use integers?

If you then set "Cooldown" to 1 in the MultiKills2 trigger, then it will not show both double and triple kill if you killed em at the same time. I sat it to 2, so you just have a bit of time for killing the next one.

The old timers (fixed) are the ones disabled. Remember that you can't hear anything untill you imported the sounds and initialized them.

If you need some help with it, just ask again =)

- Soultaker
05-29-2006, 11:19 PM#6
Fulla
Ok I tested it quite a few times.
1 problem

- It plays the sounds the wrong way round- e.g. triple kill then double kill.

apart from that seemed good :-)

I added the sounds
Attached Files
File type: w3xMulti-Kills System2.w3x (110.4 KB)
05-30-2006, 01:55 PM#7
Soultaker
Quote:
Originally Posted by Fulla
Ok I tested it quite a few times.
1 problem

- It plays the sounds the wrong way round- e.g. triple kill then double kill.

apart from that seemed good :-)

I added the sounds

I don't have that problem.. So it's hard for me to fix it :P

Here's the system again, I optimized the code a bit and removed some units, so you only kill 2. If you run the map still get "Triple Kill", I have no idea what to do :)

You might just change number 2 and number 3.. But see if someone else also has that bug first.

- Soultaker
05-30-2006, 03:53 PM#8
Fulla
Ah, yes it works very nicely, I tried both methods of triggers both work :-)

Thx for your help :-)
However it doesnt quite do how I wanted it, (sorry dont mean to be rude).

Its meant to be,
You kill 1 hero: Nothing
You kill 2 heroes: Double Kill
then if..
You kill (A 3rd) hero: Tripple Kill
then if..
You kill (A 4th) hero: Mega kill

So you get the sounds after each other, so long you keep killing within the time limit.

Currently it waits, then plays sound, then RESETS the kills? Its meant to continue.

That was why I had the problem of sounds overlapping and not being played clearly/smoothly in sync after each other.

-----

So after each kill, it plays sounds, then gives you a time limit to kill again to play next sound, keeps repeating.
If you run out of time, it resets back from the start.

Youve already helped me alot, so I understand if you just wanna leave it.
05-30-2006, 04:31 PM#9
Soultaker
That's how I first thought of it too, but I got the idea that wasn't the way you wanted it :)

Anyways.. I got an idea how to make it...

I might start at it today, maybe tomorrow.. you'll find out ;)

- Soultaker

Btw. Is this meant for one player or should I make it for 8-10?
05-30-2006, 04:33 PM#10
Fulla
its meant to be for a 12player AoS :-)
3 teams

Therefore the maximum kills possible would be 8, in 1 go.
Ill need to add a nother sounds or 2 hehe.
05-31-2006, 01:18 PM#11
Soultaker
Weird.. I thought I already has posted it? o.O

Anyways, I totally reworked the system :) It now requires a bit more variables, but I hope that's okay.

Also, at the same time I deleted the old one with the timers, as that isn't going to work anymore.

I'm pretty pleased with the system myself, might use it in one of my maps :D

The only little thing I would change would be the speed of the sounds, but then you would have to reimport them and stuff like that, that's your choice :)

- Soultaker
06-02-2006, 06:31 PM#12
Soultaker
Sorry for making a double post, but this was the easiest way to send the new version to Fulla.

It's because that Fulla found a bug in it, which he sended to me in a pm.

Everybody that wants to use this, should use the new version. Also, please give credits to me :)

- Soultaker
Attached Files
File type: w3xMulti-Kills System v. 1.1.w3x (111.0 KB)
06-02-2006, 06:44 PM#13
Rising_Dusk
Just to let you know Fulla, 12 player AoS' are fine and dandy, but 3 teams?

There are only two neutral players I've seen work for creeps, neutral victim and neutral enemy. Neutral hostile/passive seem to have hardwired artificial intelligence or whatnot preventing them from listening.

You might want to reconsider that 3 team thingie.
06-04-2006, 06:32 PM#14
Fulla
Ive already set it up :-)
Seems to work fine (4v4v4)

Ill check out the sounds system "dl'ing"