Having some problems with creating a music loop in my single player campaign mission. Right now, the issue seems to be detecting the number of deaths the player has accrued of 'Terran Marker'. Using 'at least', 'at most', and 'exactly' have all proven fruitless currently. I've screencapped the 3 triggers below.

This sets the timer that is slowly counted down, one death at a time. The amount of deaths is equivalent to the total running time of the song that plays in the background.

This is the actual counter. The switch is set correctly by a trigger with an 'always' condition. I also have 3 hypertriggers present in the map, owned by a player with no other triggers currently (and thus no wait blocks are possible).

This plays the first 10 second chunk of the song. Its only condition (other than the switch being set, which we already know occurs) is that at least 1 death has been subtracted from the main timer, indicating that the counter is active. Using 'at least' is fine for the first chunk, but obviously cannot be used for later trigger conditions because they have to occur after the first one. Using 'exactly' and 'at most' simply results in no sound being played.
Is there an obvious solution to this problem that I've missed?
Is the first trigger supposed to have preserve trigger?
Also who owns the triggers? If it is owned by any more than a single player, it will subtract more than 1 death each cycle and the "exactly" amount might get skipped over.
TinyMap2 - Latest in map compression! ( 7/09/14 - New build! )
EUD Action Enabler - Lightweight EUD/EPD support! (ChaosLauncher/MPQDraft support!)
EUDDB -
topic - Help out by adding your EUDs! Or Submit reference files in the References tab!
MapSketch - New image->map generator!
EUDTrig -
topic - Quickly and easily convert offsets to EUDs! (extended players supported)
SC2 Map Texture Mask Importer/Exporter - Edit texture placement in an image editor!
This page has been viewed [img]http://farty1billion.dyndns.org/Clicky.php?img.gif[/img] times!
The first trigger is supposed to only be run once.
Only the player the music plays for (player 1) owns the triggers.
Removing the game pause had no effect and setting them to exactly resulted in the same issue as before.
The first trigger is supposed to only be run once.
Then where is the timer reset?
TinyMap2 - Latest in map compression! ( 7/09/14 - New build! )
EUD Action Enabler - Lightweight EUD/EPD support! (ChaosLauncher/MPQDraft support!)
EUDDB -
topic - Help out by adding your EUDs! Or Submit reference files in the References tab!
MapSketch - New image->map generator!
EUDTrig -
topic - Quickly and easily convert offsets to EUDs! (extended players supported)
SC2 Map Texture Mask Importer/Exporter - Edit texture placement in an image editor!
This page has been viewed [img]http://farty1billion.dyndns.org/Clicky.php?img.gif[/img] times!

Find Me On Discord (Brood War UMS Community & Staredit Network)
Use at least and at most for condition. Then use set for action to bypass and stop the wav playing more than once.

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
Here's how it's supposed to work. Using different players, trigger order or count modificators (exactly, at least, at most) might break it, so for now copy it exactly to confirm it's working, then implement changes if you feel they are necessary.
Force of P1
Current Player has suffered exacly 0 deaths of 'Cantina'
Current Player brings at least 1 'Chooser' to 'Music ON'
Set deaths of 'Cantina' to 238 (this is for 20s. Formula is: 1000/84 * length of song in s)
Preserve
Force of P1
Current Player suffered exactly 238 deaths of 'Cantina'
Current Player brings at least 1 'Chooser' to 'Music ON'
Play WAV 'chunk 1'
Preserve
Force of P1
Current Player suffered exactly 119 deaths of 'Cantina'
Current Player brings at least 1 'Chooser' to 'Music ON'
Play WAV 'chunk 2'
Preserve
Force of P1
Current Player brings at least 1 'Chooser' to 'Music ON'
Subtract 1 deaths of 'Cantina'
Preserve
This is a very basic setup, because the simpler it is, the more robust and easier to bugfix it is. Music will stop after at most 10s when the chooser is moved away, and will take up to 10s to restart, depending on where the counter stopped. The former can be prevented by using smaller chunks, the latter obviously needs improving, when it's confirmed running. I'd simply set Cantina to 0 when the civ is moved away, so the music begins anew.
Then where is the timer reset?
It's in the trigger that plays the final chunk of the song.
Use at least and at most for condition. Then use set for action to bypass and stop the wav playing more than once.
Can you give me an example of this in action?
Here's how it's supposed to work. [...] This is a very basic setup, because the simpler it is, the more robust and easier to bugfix it is.
Wouldn't removing the secondary condition (in your case, the bring condition) be better than including it at all? Why is this simpler/more robust than a switch? In my triggers there's not even an action that turns the switch off because I've been having these problems to begin with.
I have 10 second chunks and it switches to a 10 second faded-out chunk when the song is set to end so a different track can take over. This transition process can take up to 20 seconds and can be as quick as 10 seconds. Even if I were to use a second death counter as a boolean (0 is standard, 1 is fade) it's no different than using a switch and should perform identically.
I'll post again when I have time to try your method instead.

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
Wouldn't removing the secondary condition (in your case, the bring condition) be better than including it at all? Why is this simpler/more robust than a switch? In my triggers there's not even an action that turns the switch off because I've been having these problems to begin with.
several reasons:
- I have no reason to distrust the robustness of bring (however you're right, it leaves more room for user mistakes, so you can remove it if you suspect an error with it)
- you gotta have user interaction at some point to make it work
- the switch which needs another trigger to be set or cleared
- you have neither visual feedback nor control over the condition when using a trigger controlled switch
I've successfully implemented your system, including a fade. I've also had success changing it over to a switch-based system.
The map is available
here if you want to review what I did. It only loops for up to 60 seconds before going back to the first chunk.
The
exact same system has been implemented into my campaign mission, and does not work. Once again, only the first chunk plays. No other chunks play. There is no instance of the switch being cleared in any of the triggers. I've completely wiped all other data from the map, and even then, it is malfunctioning in the exact same way as before.
Here's the map. I hope someone else can make some sense of the issue. Thanks for all your help so far.

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
Thing is, debugging is hard work. And sometimes there's a tiny mistake you just don't find because you know how it's
supposed to work, so remaking the system is often faster, so I took the "easy route".

An artist's depiction of an Extended Unit Death
I also have 3 hypertriggers present in the map, owned by a player with no other triggers currently (and thus no wait blocks are possible).
Triggers owned by missing players do not run. Player 8 is a human player, so if it's empty, your map has no hyper triggers.
Added the following trigger to your map (
copied from here), and the music works as expected:
All Players
All Players has suffered exactly 0 deaths of Cave.
Modify deaths for Current Player: Add 1 for Cave.
Wait for 0 milliseconds.
Modify deaths for Current Player: Subtract 1 for Cave.
Wait for 0 milliseconds.
Preserve Trigger.
Or, if you prefer SCMD code:
Trigger("All players"){
Conditions:
Deaths("All players", "Cave", Exactly, 0);
Actions:
Set Deaths("Current Player", "Cave", Add, 1);
Wait(0);
Set Deaths("Current Player", "Cave", Subtract, 1);
Wait(0);
Preserve Trigger();
}
//-----------------------------------------------------------------//
Oh, I must have forgotten to switch player 8 to computer. That's embarrassing. I'll debug it when I get home.
I'd still recommend to switching to use the HT.
You won't have to worry about who owns the trigger. Using it in place of previous methods will lead to a complete hassle-free mapping experience.
None.
Do you mean using Roy's suggestion? Should I include that in every trigger that needs a hyper?
Do you mean using Roy's suggestion? Should I include that in every trigger that needs a hyper?
Yes, Roy's suggestion.
You replace all of your hyper triggers with that single trigger. It's a one trigger solution.
None.
I'll test that out. Weird that I hadn't heard of it before. Thanks for the heads up guys.
When trying to implement Roy's suggestin in Classic Trigedit, it changes the UI to a death table calculation, like so:

Is this functionally the same as the normal GUI input method of death calculations? The same thing happens when trying to input 'Current Player' instead of 'All Players'.
In the meantime, I'll try to use the code,
although for some reason trigedit never saves my changes when I input them (I got this to save, testing now).
Post has been edited 1 time(s), last time on Sep 10 2016, 1:59 am by Pr0nogo.
I think it's fixed by filling in player last or something. If you are indeed using terran marine, then it is functionally identical.
TinyMap2 - Latest in map compression! ( 7/09/14 - New build! )
EUD Action Enabler - Lightweight EUD/EPD support! (ChaosLauncher/MPQDraft support!)
EUDDB -
topic - Help out by adding your EUDs! Or Submit reference files in the References tab!
MapSketch - New image->map generator!
EUDTrig -
topic - Quickly and easily convert offsets to EUDs! (extended players supported)
SC2 Map Texture Mask Importer/Exporter - Edit texture placement in an image editor!
This page has been viewed [img]http://farty1billion.dyndns.org/Clicky.php?img.gif[/img] times!
I've fixed it and the music seems fine, although it does desync at first because of the fact that the starting game speed is normal. That can be messed with, though. Looks like this issue has been resolved. Thanks everyone!