Ok I'm making a defense map, and as part of the game you get some rewards for every 10 kills you get. Sounds simple right? Wrong! I've tried everything i can think of, going through kill scores, making it so 1 kill gives you 1 gas and 10 gas = your rewards, and a few other methods. Now each one works great, but it only works twice before it breaks. I use the preserve trigger, and yet it doesn't work indefinitely. I remember to subtract the units, still doesn't work. I tried downloading Starcraft X-tra Editor and that helped very little. This trigger is the only thing holding me back, everything works without a hitch, my purchase system works great, my hyper triggers work smoothly. All i need is this. I read some other related forums on this site, but none really answered my question. So What am i doing wrong?
None.
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
http://www.staredit.net/wiki/Kills_To_CashHowever what you describe is basically the correct solution. Maybe you're trying to subtract kills instead of kills score, because that's not possible.
Oh and when working with kills score and using
exactly x score keep in mind that 2 kills within one trigger loop can happen, even with hypers, due to splash. So you need to have an at least x score trigger too, as a failsafe.
I ended up doing this the brute-force way in my map. It works for me because players generally don't kill hordes and hordes of enemies.
I simply have 500 triggers in the form of:
Player kills at least 1 men
Add 1 ore for player
Player kills at least 2 men
Add 1 ore for player
Player kills at least 3 men
Add 1 ore for player
...
The important part is not to use preserve trigger on any of the triggers. This system handles splash perfectly and doesn't require the 'kill-box' zone or fiddling around with which player has killed the most etc, and registers kills instantly.
None.