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.
    [03:20 am]
    Symmetry -- Dang I'm up to 155 minerals gambling really pays off guys
    [2026-10-11. : 6:02 am]
    Donald -- Samase
    [2026-10-09. : 2:53 am]
    Mr.BurnLiquid -- Symmetry
    Symmetry shouted: I'll check it out this weekend!
    Thanks
    [2026-10-09. : 2:47 am]
    Symmetry -- I'll check it out this weekend!
    [2026-10-09. : 2:40 am]
    Mr.BurnLiquid -- Symmetry
    Symmetry shouted: Another map maker? Damn we really ARE back
    I invite you to try out the map I modified. I don't have the creativity to create maps from scratch, but I do have the know-how to modify existing ones; my project is to tweak community campaigns (specifically those with errors—to make them playable.
    [2026-10-09. : 2:27 am]
    Symmetry -- Another map maker? Damn we really ARE back
    [2026-10-09. : 1:51 am]
    Mr.BurnLiquid -- Ultraviolet
    Ultraviolet shouted: Mr.BurnLiquid actually yeah though I wasn't really saying it to narc on you. It just caught me off guard because I don't usually see it (because it's against the rules) "The avatar may not be bigger than 150x150 pixels". Kinda silly that it relies on users to be well behaved rather than just limiting the dimensions on uploads :lol:
    Now that I wanted to change my avatar, the error image is showing up, haha.
    [2026-10-09. : 1:34 am]
    Mr.BurnLiquid -- Ultraviolet
    Ultraviolet shouted: Mr.BurnLiquid actually yeah though I wasn't really saying it to narc on you. It just caught me off guard because I don't usually see it (because it's against the rules) "The avatar may not be bigger than 150x150 pixels". Kinda silly that it relies on users to be well behaved rather than just limiting the dimensions on uploads :lol:
    Mr.BurnLiquid
    Mr.BurnLiquid shouted: Ultraviolet Thanks; I'm new to the site and a Spanish speaker. I must have missed the part where it was prohibited—I'll change it now.
    I invite you to try out a mission I'm modifying from *StarCraft Reversed*; I'm trying to make it more playable and challenging.
    [2026-10-09. : 1:33 am]
    Mr.BurnLiquid -- Ultraviolet
    Ultraviolet shouted: Mr.BurnLiquid actually yeah though I wasn't really saying it to narc on you. It just caught me off guard because I don't usually see it (because it's against the rules) "The avatar may not be bigger than 150x150 pixels". Kinda silly that it relies on users to be well behaved rather than just limiting the dimensions on uploads :lol:
    Thanks; I'm new to the site and a Spanish speaker. I must have missed the part where it was prohibited—I'll change it now.
    Please log in to shout.


    Members Online: Dem0n