Staredit Network

Staredit Network -> UMS Assistance -> Looping multiple pieces of music
Report, edit, etc...Posted by MidnightGladius on 2005-04-23 at 11:26:54
After reading the article in the tutorials section on looping music, I realized that you could only loop one piece for one player using waits.

Basically, I have 7 players, each with a different piece of music playing in the background constantly. How would I accomplish this?

Help would be appreciated.
Report, edit, etc...Posted by LegacyWeapon on 2005-04-23 at 12:57:45
Using a deathcount timer or a physical timer.
Report, edit, etc...Posted by MidnightGladius on 2005-04-23 at 13:56:01
The physical timer is being used already.

Could you explain how the death count would work?

I'm going to try what I think you mean.

EDIT: While we're at it, could someone tell me how long the normal cooldown time for triggers (w/o hypers) is?
Report, edit, etc...Posted by Urmom(U) on 2005-04-23 at 14:47:54
a death counter timer is another way to keep time kind of. with hypertriggers, if you continuously add one counter then itll make 12 in a second. people use this method so that it wont interfere with waits. take a look at this trigger.

Trigger
Conditions:
¤ Always
Actions:
¤ Add one for current player: add one for rhynadon(badlands)
¤ preserve trigger


now you will continuously add a counter. but you may be thinking of a way this could be useful. take a look at this triger which relates to the first one.
Trigger
Conditions:
¤ Current Player has suffered at least 60 deaths of rynadon(badlands)
Actions:
¤ set deaths for rynadon(badlands) to 0
¤ do an event
¤ preserve trigger


this will make it do something once the counter you made reaches 60. if you do the math, 60 deathcounters divided by 12(the amount created in a second)= 5 seconds. youve made a trigger to do something every five seconds and it will loop. now just implement this into your music triggers(it will be more than one trigger)
Report, edit, etc...Posted by (U)Bolt_Head on 2005-04-23 at 15:13:12
QUOTE(MidnightGladius @ Apr 23 2005, 12:56 PM)
The physical timer is being used already.
[right][snapback]193700[/snapback][/right]


lol thats funny.

You know you can use more than one right?
Report, edit, etc...Posted by Ultimo on 2005-04-23 at 15:25:06
I think when he says "physical timer", he's talking about the countdown timer.
Report, edit, etc...Posted by (U)Bolt_Head on 2005-04-23 at 19:38:14
Oh, that would make since. I though he was refering to units patroling. Thats what it normally means at least unless i have been mistaken.
Report, edit, etc...Posted by O)FaRTy1billion on 2005-04-23 at 19:57:09
When I do music I put a cloaked unit somewhere, put a loction on it called "Music #a" (# being the player) then another one that seems reasonably away called "Music #b" (# being the player). Then I do Play Wav, order to B. when it gets to B move back to A. To get the distance right, just change the space between.

*Put the unit as a comp so the humans can't see*

This has some advantages and disadvantages:
Advantages:
  • Dealth can't always be perfect, it takes a few milliseconds with hypertrigger for a +1, and a few seconds without hyper for +1. These just change the distance, or resize it. (SF can place off the grid*)
  • Players can start/play the song independant of eachother (If you do one player for them all, only the lowest player hears music)
  • Doen't interfere with waits
  • Not that complicated
Disadvantages:
  • Wastes X units (X is how many players)
  • Sometimes difficult to find the right location distances.
  • Wastes two locations for each player
  • Time consuming

Can't think of much more than that.
Report, edit, etc...Posted by l)ark_13 on 2005-04-23 at 20:19:47
I always use death count music timers. Its incredibly easy. (By the way, without hyper triggers it takes 2 second for each trigger to fire, approx.). Lets say the piece of music is 30 seconds long; if you are using hyper triggers that means:
30 seconds x 12 deaths/second (30x12) = 360 deaths. If you aren't using hyper triggers that would mean:
30 seconds x 0.5 deaths/second (30x0.5;30/2) = 15 deaths (because ever trigger fires 2 seconds apart). You need 3 triggers:


Trigger
Description:
Music Start
Players:
¤ Music Player
Conditions:
¤ Always.
Actions:
¤ Play "Music".wav.
¤ Set death of "Unit 1" to 1.

That makes the song start as well as setting the death count timer.

Trigger
Description:
Death Count Music Go
Players:
¤ Music Player
Conditions:
¤ Deaths of "Unit 1" is at least 1. (The "At Least" is very important!)
Actions:
¤ Add 1 death to "Unit 1".
¤ Preserve Trigger.

That makes the death count timer go. It is the "Wait".

Trigger
Description:
Death Count Music Restart
Players:
¤ Music Player
Conditions:
¤ Deaths of "Unit 1" is at least 360 (or 15; depends of weather there is HT's or not).
Actions:
¤ Play "Music".wav.
¤ Set death of "Unit 1" to 1.
¤ Preserve Trigger.

That restarts the death count timer as well as plays the music again.
So there you have it. You can make one of those for each player and calculate the deaths for a different song for each player. Hope that works happy.gif
Report, edit, etc...Posted by O)FaRTy1billion on 2005-04-23 at 20:25:12
If you have hyper triggers and your song is between the little "+1 death = X elapsed time" thing, it will either cut off a second (sometimes that matters), or it has a break (oh noes!)

Sorry if not explained well.
Report, edit, etc...Posted by MidnightGladius on 2005-04-23 at 22:23:06
Well everyone thanks for the help.

All this information should clear everything up.

EDIT: Oh, and by the way, I wanted to know about normal triggers because A. my songs are LONG (2467800 deaths) and B. the continuous deaths of the afore-mentioned 2467800 units (multiplied by 7) caused an enormous amount of lag.

It works. Pwnage.
Report, edit, etc...Posted by in_a_biskit on 2005-04-24 at 01:08:08
Can someone please remind me why music can't be looped totally within one player with a wait action? Say like this:
Trigger
Players:
¤ player 1
Conditions:
¤ Always.
Actions:
¤ Play "music.wav"
¤ Wait for (#duration of music).
¤ Preserve trigger.
Report, edit, etc...Posted by LegacyWeapon on 2005-04-24 at 01:14:31
It can, but if the player has any other waits, wait blocks can occur.
Report, edit, etc...Posted by Rantent on 2005-04-24 at 04:36:11
I was wondering if you could use other things instead of waits in that trigger. I know that if you add large amounts of minerals to a player, they take a while to count up.

Trigger
Description:
Music clock thing
Players:
¤ a comp or something
¤ players who hear the music
Conditions:
¤ If computer player gets amount of minerals
Actions:
¤ subtract all minerals
¤ play music
¤ add a bunch of mins

Could this work? I don't know what it would improve, but it would take less triggers. dots.gif
Report, edit, etc...Posted by sckor on 2005-04-24 at 04:47:19
Any counter works. Even the countdown timer I think.
Report, edit, etc...Posted by (U)Bolt_Head on 2005-04-24 at 05:17:43
QUOTE(O)FaRTy1billion @ Apr 23 2005, 06:57 PM)
This has some advantages and disadvantages:
Advantages:

  • Dealth can't always be perfect, it takes a few milliseconds with hypertrigger for a +1, and a few seconds without hyper for +1. These just change the distance, or resize it. (SF can place off the grid*)
  • Players can start/play the song independant of eachother (If you do one player for them all, only the lowest player hears music)
  • Doen't interfere with waits
  • Not that complicated
Disadvantages:

  • Wastes X units (X is how many players)
  • Sometimes difficult to find the right location distances.
  • Wastes two locations for each player
  • Time consuming

Can't think of much more than that.
[right][snapback]193894[/snapback][/right]


First off it is imposable for a physical timer (ie: a unit walking from one place to the next) to be more accurate than a method that uses pure triggers. The time it actually takes for a unit to move from one location to the next can actually be more accurate but you still have to wait for the triggers to detect the units presence at the location so its accuracy is limited by the trigger's firing rate.

2: The lowest player hearing the music is a result of the first player clearing the conditions before the remaing players check there triggers.


QUOTE(Rantent @ Apr 24 2005, 03:36 AM)
I was wondering if you could use other things instead of waits in that trigger. I know that if you add large amounts of minerals to a player, they take a while to count up.




Trigger
Description:
Music clock thing
Players:
¤ a comp or something
¤ players who hear the music
Conditions:
¤ If computer player gets amount of minerals
Actions:
¤ subtract all minerals
¤ play music
¤ add a bunch of mins

Could this work? I don't know what it would improve, but it would take less triggers. dots.gif
[right][snapback]194234[/snapback][/right]


No matter how many minerals you have there still subtracted in the same amount of time and the next action will follow immediately after.
Report, edit, etc...Posted by MidnightGladius on 2005-04-24 at 08:58:26
Due to the nature of my map, using minerals, units walking around, countdown timers, and long waits is implausible.

I might as well close this.

EDIT: Eh, how do I close this?
Report, edit, etc...Posted by Deathknight on 2005-04-24 at 09:46:04
You don't need to close this.

QUOTE
Oh, and by the way, I wanted to know about normal triggers because A. my songs are LONG (2467800 deaths) and B. the continuous deaths of the afore-mentioned 2467800 units (multiplied by 7) caused an enormous amount of lag.

You should shorten up the sounds, lower the quality a little for a smaller size, and use WinMPQ to import them. I find that the Staredit compression doesn't work. WAV files can be compressed a lot in MPQ(scm,scx) files, but you do need to compress it some outside of the MPQ.

Anyway, just use what l)ark_13 posted to loop the sounds.
Report, edit, etc...Posted by MidnightGladius on 2005-04-24 at 15:02:27
If I shorten up the sounds, they'll lose all coherency (I already cut out the un-needed rests).

How do you lower the quality? I followed the compression steps in the tutorial that told me to change the format. Is that what you mean?
Report, edit, etc...Posted by RexyRex on 2005-04-24 at 15:14:11
Yeah, it doesn't sound much worse...I mean, get a much lower filesize than that.
Report, edit, etc...Posted by (U)Bolt_Head on 2005-04-25 at 04:15:31
You wouldn't want to use a unit patroling timer for music anyways because the time would vary with game speed.

Physical timers are only really usefull when you want the time to be porportional to the game speed.

Also you don't need alot of space for longer times you could mix it with a counter, and just require that the unit walk that distance X times. If you were so inclined you could use one unit to control all your timming elements for the whole map by making it walk a very short distance and adding to differant counters for differant things. The distance would be your smallest increment of time.
Report, edit, etc...Posted by in_a_biskit on 2005-04-25 at 04:26:11
In fact, death counters also change their speed according to the game speed, so they're not 100% reliable either.

I think the only things that do not rely on game speed are wait actions and transmissions (and wav files).
Report, edit, etc...Posted by (U)Bolt_Head on 2005-04-25 at 05:12:36
Death counters themselfs have no increment of time.

If you have hyper triggers going then death counters speed do not vary with game speed becaused there based off of waits.

But if you dont' have hyper triggers they do because there based off of the NEO.
Report, edit, etc...Posted by sckor on 2005-04-25 at 06:43:06
And to close it, there should be a selection box, that says "Moderation Options", click "close topic".
Report, edit, etc...Posted by in_a_biskit on 2005-04-25 at 07:40:51
Sorry, when I said "death counter" I meant "deaths counting time".
--------------------

Hypertriggers do vary with game speed.
With wait time 0, the minimum waiting time is 1/12th of a game second. If you increase the game speed, your triggers will fire faster.
Next Page (1)