Can someone Explain the Income Trigger? (Income Defence, Spawn Defence)
Or show me how to do it?
Income Defense uses the potential of binary count-offs for income triggers. This is done by having an income budget(gas) add to your current cash (minerals) without losing value in the budget (hence the usage of binary count-offs).
For example: If a player has an income budget of 100, triggers will subtract the 100 gas and add it to a death counter with binary count-offs (add 1, add 2, add 4, etc. by the powers of 2), then re-add then back to both your income budget and your current cash.
can you write a simple trigger out? or no?
Trigger |
Description: |
Income Triggers (Binary Count-offs) |
|
Conditions: |
¤ Current player has suffered exactly 1 deaths of "Income Switch"
|
¤ Countdown timer is exactlyt 0 seconds
|
¤ Current player has at least one gas |
Actions: |
¤ Preserve trigger
|
¤ Subtract 1 gas
|
¤ Add 1 deaths of "Income Counter" to current player |
^copy this trigger and double the gas and death numeric values until 1024 or higher.Trigger |
Description: |
Income Triggers (Zero Gas) |
|
Conditions: |
¤ Current player has suffered exactly 1 deaths of "Income Switch"
|
¤ Countdown timer is exactly 0 seconds
|
¤ Current player has exactly 0 gas
|
¤ Current player has suffered at least 1 deaths of "Income Counter" |
Actions: |
¤ Preserve trigger
|
¤ Set to 0 deaths of "Income Switch" for current player |
Trigger |
Description: |
Income Triggers (Add income w/Binary Count-offs) |
|
Conditions: |
¤ Current player has suffered exactly 0 deaths of "Income Switch"
|
¤ Current player has suffered at least 1 deaths of "Income Counter" |
Actions: |
¤ Preserve trigger
|
¤ Subtract 1 deaths of "Income Timer" for current player
|
¤ Add 1 gas for current player
|
¤ Add 1 mineral for current player |
^Do the same thing with the gas, mineral, and death condition and actions as you did with the first trigger.Trigger |
Description: |
Income Triggers (End Process) |
|
Conditions: |
¤ Current player has suffered exactly 0 deaths of "Income Switch"
|
¤ Current player has suffered exactly 0 deaths of "Income Counter"
|
¤ Countdown timer is exactly 0 seconds |
Actions: |
¤ Preserve trigger
|
¤ Set to 1 deaths of "Income Switch" for current player
|
¤ Set countdown timer to 1337 seconds
|
¤ Display text: "You have received your income. |
Is that understandable enough?Do you want to have just constant income, or do you want income for kills?
When do you want them to get money and do you want to have them all the cash at same time?
Constant Income
xmrxsiegecopx for the trigger do you have to keep on doing like
substact 1, 2, 3 and so on?
This what
You send units and get gas for it ,you have 2000 gas lets say, you wait 60 seconds and the gas goes down 2000 and you get 2000 Minerals and the gas regains it self and the whole process stars all over.
QUOTE(KillerDrill900 @ Dec 29 2006, 08:06 AM)
xmrxsiegecopx for the trigger do you have to keep on doing like
substact 1, 2, 3 and so on?
[right][snapback]607157[/snapback][/right]
no, its powers of 2
2^0 = 1
2^1 = 2 * 1
2^2 = 2 * 2
2^3 = 2 * 2 * 2
etc...
AKA
1
2
4
8
Make sure to start the binary countoffs with the highest value first, or it won't work in one trigger cycle (thus defeating the purpose of the binary countoff).
That is, start with "at least 1024," then "at least 512," etc.
Ok you know you have to do like 1024 and then 512? What if you got an income of 800?
1
2
4
8
16
32
64
128
256
512
1024
Lets say you have these as your trigger #s, so when you have at least this amount, you get that gas.
By my calculations, 800=512+128+32
You will get your 800 minerals using 3 triggers. Easy, no? Just make sure you put the big numbers first, so that they are subtracted before the small numbers. Otherwise, starcraft will do:
800=1+2+4+8+16+32+64+128+256, repeat triggers 1+2+4+8+16+32+64+128, repeat triggers 1+2+4+8+16, repeat triggers 1+2. All those numbers should add up to 800 still, but it took 4 trigger runs to do it.
Binary is a wonderful thing, since you'll notice that if you add all the numbers before the next step, it's always 1 less than that step, ie... 1+2+4=7, which is right before 8, and even 1+2+4+8+16+32+64+128+256+512=1023.
Then again, there are only 10 kinds of people in the world. Those who understand binary, and those who don't.
Ohoooooohhhh haha I get it, now i need to see if i get the triggers