how do i make a sound file loop with out making it overlap eachother, i have a theme song and i want it to play again right after it finishes.
thanks for the help
None.
Multiply the length in seconds by 12, and use a deathcounter of that value to time it. When that timer is up play it again.
Multiply the length in seconds by 12, and use a deathcounter of that value to time it. When that timer is up play it again.
Follow Inferno's math if using hyper triggs
If not using hyper triggs then you would have to multiply by 0.75 and round off the number.
None.
Your typos amuse me.
Definitely use death counters instead of waits. Even if the game is paused or other waits are present in the map, death counters will run just fine and the music will loop.
>be faceless void >mfw I have no face
Isn't it 11.8 or 11.9? On longer clips it matters, being precise.
Red classic.
"In short, their absurdities are so extreme that it is painful even to quote them."
We can't explain the universe, just describe it; and we don't know whether our theories are true, we just know they're not wrong. >Harald Lesch
11.9 or more exactly 1 / 84ms
so if i understand correctly i have to kill units? and make a counter for the deaths? or am i understanding this totaly wrong
None.
so if i understand correctly i have to kill units? and make a counter for the deaths? or am i understanding this totaly wrong
No, use the set deaths action to add 1 to the deaths of a certain unit. I would recommend using some of the unused units (like literally the unit "Unused"). When the deaths of that unit is at least (length of song in seconds * 12) then play the song and set the deaths of your unit to 0. Alternatively subtract 1 death of a certain unit and initially set it at (length of song in seconds * 12), and then when the death reaches 0 you can play the song and then set the death to what it originally was.
We can't explain the universe, just describe it; and we don't know whether our theories are true, we just know they're not wrong. >Harald Lesch
When using
Death Counters there are no actual units dying. You're using set deaths actions and suffered deaths conditions for unused units to modify the counter at your will. Like a variable in a programming language.
Combine that with
Hyper Triggers which makes your triggers run every 84ms you can measure time fairly accurately:
Every trigger loop (=84ms) you add 1 to a death counter and when it reaches 10 you know 840ms have passed. Now say you have a 3 minute (180s) song you have to count to 180s / 0.084s = 2143 and then play it again and reset your death counter to 0:
Force 1Current Player has suffered at least 2143 deaths of CantinaSet deaths of Current Player to 0 for CantinaPlay wavPreserve Trigger
Like this...
Music.scm is with hyper triggs
Music1.scm is without.
Attachments:
None.