If you can spare a death counter, here's what you could do:
Conditions-
- Always
Actions-
- Wait 30000 milliseconds.
- Set switch "Gimme"
- Preserve trigger.
And then use this set of triggers for a binary countoff (use more triggers with higher binary powers if you expect to have large numbers):
Conditions-
- Switch "Gimme" is set.
- Current player has at least 32 custom score
Actions-
- Subtract 32 custom score for current player
- Add 32 minerals for current player
- Add 32 deaths of unit Independant Starport.
- Preserve trigger.
Conditions-
- Switch "Gimme" is set.
- Current player has at most 31 custom score
- Current player has at least 16 custom score
Actions-
- Subtract 16 custom score for current player
- Add 16 minerals for current player
- Add 16 deaths of unit Independant Starport.
- Preserve trigger.
Conditions-
- Switch "Gimme" is set.
- Current player has at most 15 custom score
- Current player has at least 8 custom score
Actions-
- Subtract 8 custom score for current player
- Add 8 minerals for current player
- Add 8 deaths of unit Independant Starport.
- Preserve trigger.
Conditions-
- Switch "Gimme" is set.
- Current player has at most 7 custom score
- Current player has at least 4 custom score
Actions-
- Subtract 4 custom score for current player
- Add 4 minerals for current player
- Add 4 deaths of unit Independant Starport.
- Preserve trigger.
Conditions-
- Switch "Gimme" is set.
- Current player has at most 3 custom score
- Current player has at least 2 custom score
Actions-
- Subtract 2 custom score for current player
- Add 2 minerals for current player
- Add 2 deaths of unit Independant Starport.
- Preserve trigger.
Conditions-
- Switch "Gimme" is set.
- Current player has exactly 1 custom score
Actions-
- Subtract 1 custom score for current player
- Add 1 minerals for current player
- Add 1 deaths of unit Independant Starport.
- Preserve trigger.
Conditions-
- Switch "Gimme" is set.
- Current player has exactly 0 custom score
Actions-
- Clear switch "Gimme".
- Preserve trigger.
And finally, use another binary countoff to restore your custom score:
Conditions-
- Switch "Gimme" is cleared.
- Current player has suffered at least 32 deaths of unit Independant Starport
Actions-
- Subtract 32 deaths of unit Independant Starport.
- Add 32 custom score for current player
- Preserve trigger.
Conditions-
- Switch "Gimme" is cleared.
- Current player has suffered at most 31 deaths of unit Independant Starport
- Current player has suffered at least 16 deaths of unit Independant Starport
Actions-
- Subtract 16 deaths of unit Independant Starport.
- Add 16 custom score for current player
- Preserve trigger.
Conditions-
- Switch "Gimme" is cleared.
- Current player has suffered at most 15 deaths of unit Independant Starport
- Current player has suffered at least 8 deaths of unit Independant Starport
Actions-
- Subtract 8 deaths of unit Independant Starport.
- Add 8 custom score for current player
- Preserve trigger.
Conditions-
- Switch "Gimme" is cleared.
- Current player has suffered at most 7 deaths of unit Independant Starport
- Current player has suffered at least 4 deaths of unit Independant Starport
Actions-
- Subtract 4 deaths of unit Independant Starport.
- Add 4 custom score for current player
- Preserve trigger.
Conditions-
- Switch "Gimme" is cleared.
- Current player has suffered at most 3 deaths of unit Independant Starport
- Current player has suffered at least 2 deaths of unit Independant Starport
Actions-
- Subtract 2 deaths of unit Independant Starport.
- Add 2 custom score for current player
- Preserve trigger.
Conditions-
- Switch "Gimme" is cleared.
- Current player has suffered exactly 1 deaths of unit Independant Starport
Actions-
- Subtract 1 deaths of unit Independant Starport.
- Add 1 custom score for current player
- Preserve trigger.
And that should do it. Replace the Independant Starport with any other undying unit you want.
Ha Ha tux is actually belived that campain creations tutorial. The max value in the conditions isn't needed. Unless you don't make the numbers go up high enouth and intend to have an overflow and your going to let it distribute the money over multiple trigger rounds.
Oh well i guess it doesn't hurt.
PS. My theroy with this kind of thing is guess about the max any player will ever receave, then double that. For an example if your making kills for money triggers. Make triggers to go up to values twice as high as you ever see them being.
(oh well i doubt anyone cares anyways)
The method is easier if the quantity of mineral is not hight (0-50):
You can use a countdown timer or a switch. I'm gonna use a countdown timer:
Trigger1:
Cond:
-Countdown timer is exactly 0
Actions:
-Set countdown timer to 30 seconds.
-Preserve trigger
AFTER THAT KEEP MAKING TRIGGERS LIKE THIS ONES:
Trigger2:
Cond:
-Countdown timer is exactly 0
-Custom score is exactly 1
Actions:
-Give 1 mineral
-Preserve trigger
Trigger3:
Cond:
-Countdown timer is exactly 0
-Custom score is exactly 2
Actions:
-Give 2 mineral
-Preserve trigger
Trigger4:
Cond:
-Countdown timer is exactly 0
-Custom score is exactly 3
Actions:
-Give 3 mineral
-Preserve trigger
etc
It wont work because it will run thew reset coundtdown timer trigger first and it will go to 030 seconds and add no minerals.
QUOTE
Hey guys, I just signed up and need some help with a map I've been working on recently.
I want it so every 30 seconds, you recieve minerals equal to your Upkeep (custom score). Your upkeep increases when you build units and stuff. I'm having trouble making a set of triggers that would work with my problem.
Heh, heh. You a remaking a WC3 map.

QUOTE(DT_Battlekruser @ Jul 29 2004, 11:24 AM)
It wont work because it will run thew reset coundtdown timer trigger first and it will go to 030 seconds and add no minerals.
you should test the things without post them

The countdown timer is a good one, but in order for it to really work you should make it give your minerals at...
Conditions:
Countdown timer is at least 1 second
Countdown timer is at most 3 seconds
Actions:
whatever actions you want and preserver trigger... and does anyone else smell smoke? i think my computer fan is burining up.

Hey guys, thanks for the input but I did exactly what Tuxedo Templar said to do and it didn't work

.
I'm just gonna eleborate on exactly what it is I want it to do and and what I've done so maybe you'll know what to do.
I want it so every 30 seconds, (I want a countdown timer too) you gain minerals equal to your Custom score (upkeep).
Your Upkeep begins at 25 when you enter the game.
I use Hyper Triggers.
Your Upkeep increases later on in the game.
That's pretty much it, and if it matters, Tuxedo Templar, I did exactly what you said and it gave me 16 minerals about every 36 seconds for some reason (with an Upkeep of 25).

Can't you use this trigger
Conditions
Countdown timer is 0
Actions
Set switch x
Conditions
Custom Score is more then 0
Switch x is set
Actions
Subtract 1 Custom Score
Add 1 mineral
Preserve trigger
Conditons
Custom Score=0
Actions
Clear switch x
Custom score is "what ever you want"
I don't believe the Tux hass incorrectly posted his, maybe that you've followed it incorrectly. You use custom score to keep count of you level, well, thats fine, and most of his works, accept maybe using the Wait, since you may have others which cause problems, i suggest replacing that Wait with either a countdown timer, or if you want in hidden, just use another Death Count which slowly goes up/down, and when it hits a certain amount resets, and work around using that.
If the Unkeep death won't increase too much use my triggers, and make one for each possible value of the unkeep deathcounter.
Campaign creations? Naw I came up with that myself, though I'm certain its known to others. The max value thing I added for debugging purposes, since for some inexplicable reason in a test map I had the triggers in order of highest to lowest binary power, but it kept getting scr00d until I added max values. I'm sure I was doing something wrong back then, but ever since I've just used the max value by habit.
Where you might need it, though, is if you can't predict the highest possible value, and it goes twice or more than that of the highest binary value. If you don't have max values then, you're triggers might still work, but it won't handle it in a predictable order, which for some applications could be a problem. But really, if you're paranoid enough about it, just use powers up to the max digits you can enter into staredit (or go all the way up to 2^31 with hex or sf).
QUOTE
If you don't have max values then, you're triggers might still work, but it won't handle it in a predictable order, which for some applications could be a problem.
how would it not handle it in a predictable order. Just make sure your triggers are in the correct order, its not like you have waits in them or anything.
Er, I mean if you're relying on having the individual bits of a given number accounted for, then it won't work properly. If that makes any sense.