Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: [SOLVED] Music Loop
[SOLVED] Music Loop
This topic is locked. You can no longer write replies here.
Jul 1 2012, 7:19 pm
By: Cadia-  

Jul 1 2012, 7:19 pm Cadia- Post #1



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.

Jul 1 2012, 7:31 pm lil-Inferno Post #2

Just here for the pie

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.




Jul 1 2012, 9:39 pm staxx Post #3



Quote from lil-Inferno
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.

Jul 1 2012, 9:52 pm Pr0nogo Post #4



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.




Jul 1 2012, 10:04 pm Jack Post #5

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

Jul 1 2012, 10:21 pm NudeRaider Post #6

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




Jul 2 2012, 9:56 pm Cadia- Post #7



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.

Jul 2 2012, 10:06 pm lil-Inferno Post #8

Just here for the pie

Quote from Cadia-
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.




Jul 2 2012, 10:13 pm NudeRaider Post #9

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:
Trigger
Players
  • Force 1
  • Conditions
  • Current Player has suffered at least 2143 deaths of Cantina
  • Actions
  • Set deaths of Current Player to 0 for Cantina
  • Play wav
  • Preserve Trigger





  • Jul 2 2012, 11:46 pm staxx Post #10



    Like this...

    Music.scm is with hyper triggs

    Music1.scm is without.

    Attachments:
    Music.scm
    Hits: 1 Size: 533.36kb
    Music1.scm
    Hits: 4 Size: 533.21kb



    None.

    Options
      Back to forum
    Please log in to reply to this topic or to report it.
    Members in this topic: None.
    [2026-7-18. : 2:27 am]
    Symmetry -- https://staredit.net/topic/18903/ THE REVIEWS ARE HERE! "ok these are pretty good memes" - ssj9Kevin
    [2026-7-17. : 2:58 pm]
    Ultraviolet -- Symmetry
    Symmetry shouted: Man I wish we had this tech back in the day when people played ums lmao
    fr fr
    [2026-7-17. : 2:39 am]
    Symmetry -- Man I wish we had this tech back in the day when people played ums lmao
    [2026-7-16. : 6:28 am]
    NudeRaider -- EUD actions, specifically. The conditions remained. Today we can even have actions again, but they're all virtualized/whitelisted (not sure on the actual technical implementation) so you can only use them for specific intended purposed, not arbitrary code injections.
    [2026-7-16. : 6:26 am]
    NudeRaider -- I mean yes, maps - through EUDs - were theoretically able to do that as well, but that was patched quickly.
    [2026-7-16. : 6:25 am]
    NudeRaider -- Symmetry
    Symmetry shouted: Ohhh imagine a SC map that could delete itself
    not the map, the editor
    [2026-7-16. : 2:28 am]
    Symmetry -- I vaguely remember Voy doing some ACE back in the day, but I had no idea EUDs could do that kind of shit. I am very much catching up on the technology
    [2026-7-16. : 2:28 am]
    Symmetry -- Ohhh imagine a SC map that could delete itself
    [2026-7-15. : 8:51 pm]
    NudeRaider -- Symmetry
    Symmetry shouted: NudeRaider Is EUD editor capable of writing shit onto the player's harddrive? That seems like it would be dangerous
    yeah an editor that isn't allowed to write files sounds rather pointless, so I'd assume it can. Like most other programs too btw. and yes, obviously that's dangerous, but also kinda necessary. MS introduced that virtualization for exactly that reason.
    [2026-7-15. : 4:10 am]
    Ultraviolet -- I don't think so. I think they shut that shit down after 1.16, maybe even earlier
    Please log in to shout.


    Members Online: Roy