Hey guys I am having problems doing a couple of triggers. Right now the big one is I am trying to get a trigger that will fire every thirty seconds that will subtract a portion of the income generated by a building owned by a play who is allied with a specific player and add that amount to their ally (basically a reoccurring tribute). In practice there will be six players, five of whom will lose money why the other gains. My current idea is to have a data table for the buildings that generate income. The trigger will use an if then statement that should basically function like this: If a player who is (2-6) are allied with player 1, then for every structure in (unit group taken from data table) give a player (2-6 negative 15 of resource) and player 1 (15 of resource). I am posting my attempt so far and would appreciate feedback on how to make So far my attempts to make this happen have come out trigger wise like this:
"UntitledTrigger001
Events
TriggerAddEventTimePeriodic(30.0, c_timeGame)
Local Variables
R = 0 <int>
A = 0 <int>
Humanity = (PlayerGroupEmpty()) <playergroup>
Conditions
Actions
ForEachInteger(A, 1, 6, 1)
actions
IfThenElse()
if
Comparison((PlayerStatus(A)), ==, c_playerStatusActive)
Comparison((PlayerGroupAlliance(c_playerGroupAlly, 1)), ==, Humanity)
then
PlayerGroupAdd(Humanity, {0})
ForEachPlayerInGroup(A, Humanity)
actions
GivePlayerResources((UnitGetPosition(Imperial Palace Security Center [90.50, 246.50])), 2, 25, null, null, 1)
else"
Events
Timer - Every 30.0 seconds of Game Time
Local Variables
Conditions
Actions
Player - Modify player # Minerals: Add/Subtract ((Number of Living units in Unit Group) +/- #)
Set "unit group" like
Unit Group: Units In Unit Group With Alliance
Group: (No Value)
Alliance: Enemy/Ally
Player: 1
Count: Any Amount
Hope this helps some.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Hey guys I am having problems doing a couple of triggers. Right now the big one is I am trying to get a trigger that will fire every thirty seconds that will subtract a portion of the income generated by a building owned by a play who is allied with a specific player and add that amount to their ally (basically a reoccurring tribute). In practice there will be six players, five of whom will lose money why the other gains. My current idea is to have a data table for the buildings that generate income. The trigger will use an if then statement that should basically function like this: If a player who is (2-6) are allied with player 1, then for every structure in (unit group taken from data table) give a player (2-6 negative 15 of resource) and player 1 (15 of resource). I am posting my attempt so far and would appreciate feedback on how to make So far my attempts to make this happen have come out trigger wise like this:
"UntitledTrigger001 Events TriggerAddEventTimePeriodic(30.0, c_timeGame) Local Variables R = 0 <int> A = 0 <int> Humanity = (PlayerGroupEmpty()) <playergroup> Conditions Actions ForEachInteger(A, 1, 6, 1) actions IfThenElse() if Comparison((PlayerStatus(A)), ==, c_playerStatusActive) Comparison((PlayerGroupAlliance(c_playerGroupAlly, 1)), ==, Humanity) then PlayerGroupAdd(Humanity, {0}) ForEachPlayerInGroup(A, Humanity) actions GivePlayerResources((UnitGetPosition(Imperial Palace Security Center [90.50, 246.50])), 2, 25, null, null, 1) else"
@lonestarkiller:
Events
Timer - Every 30.0 seconds of Game Time
Local Variables
Conditions
Actions
Player - Modify player # Minerals: Add/Subtract ((Number of Living units in Unit Group) +/- #)
Set "unit group" like
Unit Group: Units In Unit Group With Alliance
Group: (No Value)
Alliance: Enemy/Ally
Player: 1
Count: Any Amount
Hope this helps some.