Staredit Network

Staredit Network -> UMS Assistance -> need help with a death-> minerals trigger
Report, edit, etc...Posted by spikemonchi on 2007-01-14 at 11:34:49
ok this is another question i have protaining to my map im making.

This one however is a little more complex.

I want to make a trigger that states for every command center they make. they gain X amount of minerals per second.

EDIT: I APOLOGIZE FOR THE TRIGGER LAYOUT ON THIS AHEAD OF TIME.

Im trying to do this with the death counter.

Basically it would break down like this.

1 - 1 mineral per second
2 - 2 minerals per second
3 - 8 minerals per second
4 - 16 minerals per second
5 - 32 minerals per second
6 - 64 minerals per second

however if they were to build more... i want to to keep adding more without having more than 6 triggers.


one of my triggers im using for this looks like this.

Condition:

Deaths(CurrentPlayer, Exactly, 32, Vespene Gas Orb 1);
Switch(Switch 1, Clear);

Actions:
Comment("Bank Cash");
SetResources(CurrentPlayer, Add, 32, Ore);
SetDeaths(CurrentPlayer, Subtract, 32, Vespene Gas Orb 1);
SetDeaths(CurrentPlayer, Add, 32, Vespene Gas Orb 2);
Wait(500);
PreserveTrigger();


these triggers seem to work fine up until the 4th bank is built and then the trigger stops working.

This trigger is coinciding with this

CONDITION:

Deaths(CurrentPlayer, AtLeast, 32, Vespene Gas Orb 2);
Switch(Switch 1, Set);

ACTION:

Comment("Bank Cash1");
SetResources(CurrentPlayer, Add, 32, Ore);
SetDeaths(CurrentPlayer, Subtract, 32, Vespene Gas Orb 2);
SetDeaths(CurrentPlayer, Add, 32, Vespene Gas Orb 1);
PreserveTrigger();

Basically it goes from trigger one to trigger two.

like 1-2-1-2 etc.
Report, edit, etc...Posted by PCFredZ on 2007-01-14 at 11:57:24
You don't really need switches. Here is a tutorial on binary countoffs.
Report, edit, etc...Posted by spikemonchi on 2007-01-14 at 12:01:53
i can honestly say that i dont understand anything that page just said... it doesnt look like it applies to what i want however.
Report, edit, etc...Posted by Wormer on 2007-01-14 at 12:07:20
I dont understand your system. Where do you set/clear the switch and where CCs are counted?

You can use looping system to loop through all CCs and giving minerals for each of them. If there was only one player you could have used such triggers:

Trigger 1:
Owners:
Player 1.
Conditions:
Current Player brings At Least 1 Command Center to Anywhere.
Actions:
Give 1 Command Center owned by Current Player at Anywhere to Player 9. (for example)
Add 1 Mineral for Current Player.
Preserve Trigger.

Trigger 2:
Owners:
Player 1.
Conditions:
Current Player brings Exactly 0 Command Center to Anywhere.
Actions:
Wait for 500 milliseconds. (if you like a delay)
Give All Command Center owned by Player 9 at Anywhere to Current Player.
Preserve Trigger.

That way all CCs one by one would be given to Player 9 and when it happens there would be a delay and the next loop will come.

There are two problems with this method. The first, is that your command centers are given to another player and you cant select them till the loop ends. The second is that if there are several players all their CCs would shuffle in Player 9 hands smile.gif The best solution is to create invincible burrowed zerg units for unused players exactly under CCs (of course create at other place and then move em there) and give them to other unused player when circling through them (for example you can use P9 and P10), as I did with CCs. That way the CC indentifies the Owner and the burrowed unit identifies whether the CC was counted (when it controlled by one player, for ex. P9) or not (when it controlled by one player, for ex. P10).

If burrowed units are too complicated you can just have loops of reward executed one after another for each player and then CCs wont shuffle.

You can check the tutorials if you dont understand. There must be an article about looping through buildings. I dont remember how it is called. Mabe this can help.
Report, edit, etc...Posted by Falkoner on 2007-01-15 at 10:11:21
Hmm, are you killing the CC's or giving them to another player? because doing that would make it much easier, and making it so it doubles each time, rather than going from 2 to 8. That would make it very easy to do using deaths and hypertriggers.

ADDITION:
Tuxedo's tutorial is confusing, but don't listen to any of the math stuff, just the triggers. His method is simply a way to transfer death counts from 1 unit to another, faster than using the method of:If he has one death count, subract 1 and give 1. Depending on how many nexuses they will possibly make, that method could work with hypers.

Now.
It is time.
To answer..
YOUR QUESTION!!!

Okay. So when Player 1 commands one nexus, you give 1 nexus to P6 and add two minerals. Now when P1 has no nexuses give the nexuses owned by P6 back. and add waits in there so it only happens at certain times. So you could have it wait 5 seconds before it gives the nexuses back to Player 1. With hypertriggers, this method should work.
Report, edit, etc...Posted by PCFredZ on 2007-01-15 at 11:49:22
QUOTE(spikemonchi @ Jan 14 2007, 11:01 AM)
i can honestly say that i dont understand anything that page just said... it doesnt look like it applies to what i want however.
[right][snapback]613631[/snapback][/right]

It applies to what you want perfectly. Here is a map I made that uses a Building -> Money system. Check the triggers for Force 1 (labeled "Majesty RPG"), scroll down to "Income".
Report, edit, etc...Posted by spikemonchi on 2007-01-16 at 17:16:51
fred... link is broken:-(
Report, edit, etc...Posted by PCFredZ on 2007-01-16 at 18:17:53
Fine, I'll explain it. Each supply depot gives you 1 mineral every 10 seconds. Command Centers are unrealistic because an SCV's build time is more than 10 seconds and this process below will cancel out any actions performed by the building every 10 seconds.

Rhynadon is used for the following purposes: 1) time count and 2) check for looping the highest mineral count (e.g. you have 100 depots but your triggers only cover 16).


Trigger
Description:
Time count
Players:
¤ Force1
Conditions:
¤ Current player suffers at most 117 death of Rhynadon
Actions:
¤ Set deaths for current player: add 1 for Rhynadon
¤ Preserve trigger



Trigger
Description:
Money for 16+ Depots
Players:
¤ Force1
Conditions:
¤ Current player suffers exactly 118 death of Rhynadon
¤ Current player owns at least 16 Supply Depots
Actions:
¤ Give 16 Supply Depots owned by Current Player to P9
¤ Set resources for Current Player: add 16 Minerals
¤ Preserve trigger




Trigger
Description:
Start Money for 15- Depots
Players:
¤ Force1
Conditions:
¤ Current player suffers exactly 118 death of Rhynadon
¤ Current player owns at most 15 Supply Depots
Actions:
¤ Set deaths for current player: add 1 to Rhynadon
¤ Preserve trigger



Trigger
Description:
Money for 8-15 Depots
Players:
¤ Force1
Conditions:
¤ Current player owns at least 8 Supply Depots
¤ Current player suffers exactly 119 death of Rhynadon
Actions:
¤ Give 8 Supply Depots owned by Current Player to P9
¤ Set resources for Current Player: add 8 Minerals
¤ Preserve trigger



Trigger
Description:
Money for 4-7 Depots
Players:
¤ Force1
Conditions:
¤ Current player owns at least 4 Supply Depots
¤ Current player suffers exactly 119 death of Rhynadon
Actions:
¤ Give 4 Supply Depots owned by Current Player to P9
¤ Set resources for Current Player: add 4 Minerals
¤ Preserve trigger



Trigger
Description:
Money for 2-3 Depots
Players:
¤ Force1
Conditions:
¤ Current player owns at least 2 Supply Depots
¤ Current player suffers exactly 119 death of Rhynadon
Actions:
¤ Give 2 Supply Depots owned by Current Player to P9
¤ Set resources for Current Player: add 2 Minerals
¤ Preserve trigger



Trigger
Description:
Money for 1 Depot
Players:
¤ Force1
Conditions:
¤ Current player owns at least 1 Supply Depots
¤ Current player suffers exactly 119 death of Rhynadon
Actions:
¤ Give 1 Supply Depots owned by Current Player to P9
¤ Set resources for Current Player: add 1 Minerals
¤ Preserve trigger



Trigger
Description:
No more money
Players:
¤ Force1
Conditions:
¤ Current player suffers exactly 119 death of Rhynadon
¤ Current player commands exactly 0 Supply Depots
¤ P9 commands at least 1 Supply Depot
Actions:
¤ Give all Supply Depots owned by P9 to Current Player
¤ Set deaths for current player: set to 0 for Rhynadon
¤ Preserve Trigger
Next Page (1)