Ive been making a map with multiple players gaining resources through controlled regions. Ive gotten most of the code but there something wrong and I cant find it. I posted a screen shot here:
I've changed it around but apparently i'm missing something, if anyone would help with some advice i would be greatful!
Controlling a region means you have the most amount of units in that region right?
So basically you have a trigger set up for each player so that if a unit enters center node 1, it's added to that players Node 1 control group. So "Player 1 Center Node" variable as a unit group.
Another trigger is If a unit leaves the node, it's taken out of the unit group.
If a unit dies, it's taken out of the unit group. So you have a variable group for each player holding all the live units for that player inside the center node.
Then you have 3 more triggers. One trigger set for if any unit dies, another for if any unit enters center node, and another trigger that if any unit leaves. These three triggers all trigger a comparison trigger each individual player. 4 players, 4 triggers.
The comparison trigger compares units in the players control group, to the number of living units in the "Center Controller group"
If the numbers are higher than the Center Control Group, then remove all units from from Center Control Group, then pick all units from that players control group and add all those units to Center Control Group. This player is not the Center node 1 region controller. As well as this, you want to reset a money timer.
The money timer will give the control group owner 50 resources every 5 seconds. Separate trigger.
The way you do that is you have Money Timer expires as an event
For each player you have a money trigger
Comparison. Owner of (unit 1 from Center Control Group)) = 1
Add 50 minerals for player 1.
So with that, you have a trigger for each player keeping track of how it's doing in the region. You have a trigger working out who is doing the best in the region. You have another trigger working out if and when minerals should be delivered. Then you have a trigger for each player working out if that player is the one who gets the minerals.
Yes there may be simpler ways to do this but I found it simpler to do it this way.
Check out my map if you want to see what I did.
Adrenaline Rush Elite
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Ive been making a map with multiple players gaining resources through controlled regions. Ive gotten most of the code but there something wrong and I cant find it. I posted a screen shot here:
I've changed it around but apparently i'm missing something, if anyone would help with some advice i would be greatful!
Ok really you need to set up multiple triggers.
Controlling a region means you have the most amount of units in that region right?
So basically you have a trigger set up for each player so that if a unit enters center node 1, it's added to that players Node 1 control group. So "Player 1 Center Node" variable as a unit group.
Another trigger is If a unit leaves the node, it's taken out of the unit group.
If a unit dies, it's taken out of the unit group. So you have a variable group for each player holding all the live units for that player inside the center node.
Then you have 3 more triggers. One trigger set for if any unit dies, another for if any unit enters center node, and another trigger that if any unit leaves. These three triggers all trigger a comparison trigger each individual player. 4 players, 4 triggers.
The comparison trigger compares units in the players control group, to the number of living units in the "Center Controller group"
If the numbers are higher than the Center Control Group, then remove all units from from Center Control Group, then pick all units from that players control group and add all those units to Center Control Group. This player is not the Center node 1 region controller. As well as this, you want to reset a money timer.
The money timer will give the control group owner 50 resources every 5 seconds. Separate trigger.
The way you do that is you have Money Timer expires as an event For each player you have a money trigger
Comparison. Owner of (unit 1 from Center Control Group)) = 1
Add 50 minerals for player 1.
So with that, you have a trigger for each player keeping track of how it's doing in the region. You have a trigger working out who is doing the best in the region. You have another trigger working out if and when minerals should be delivered. Then you have a trigger for each player working out if that player is the one who gets the minerals.
Yes there may be simpler ways to do this but I found it simpler to do it this way.
Check out my map if you want to see what I did.
Adrenaline Rush Elite