Hi there. I'm currently trying to figure out how to create a "zone control" map. For instance:
There will be 4 control points.
When a player gets in to a certain distance of a control point a "progress bar" appears with this teams "color" (lets say red for team 1, and blue for team 2). It takes 5 full seconds to capture a control point. Each player in the area speeds or slows the progress bar by .5 seconds (so two players the progress bar would move by 1).
if there is an equal amount of players in area on the opposition I want to "pause" the progress bar.
if team 1 has 2 players in the area, and team 1 has 1 player in the area, team 1 should slow the progress of the bar by .5
If a control point is already capped by a team, I want to uncap and then recap the control point.
Try to create some variables for each zone point and income variables for each player that will hold how much progress each second each players progress bar should increase.
if unit enter zone region then decrease the progress income variable. And then in trigger every 1 second check if there are units owned by each player and then increase their progress bar with the income variable.
I have a nice different solution also.
Create zone tower (building that can be captured) and set its regeneration rate to high number. First unit that will destroy tower will trigger the trigger that will create new tower for owner of unit that killed it. And if other players unit destroy attackers tower will regenerate fast :)
Its simplier solution still nice :) You can even set delay timer to regen towers HP like the protoss 10 sec delay for their shields to regen.
create a a boolean variable with an array index of 2 (index 1 for team 1, index 2 for team 2)
add players unit to a unit group upon entering a region
get the number of units in that unit group that are tied to that region
if the number of units in group 1 > group 2 - decrease the amount of time for group 1, and increase the amount of time for group 2 (after I check the boolean)
if group 1's timer elapsed (they completed capping the point) set a boolean to true, and apply some kind of behavior to the capping team.
if the number of units in group 2 = group 2, - pause
if the number of units in group 1 =< group 2, check and see if the boolean for group 1 is set to true (in which case group 1 has already capped the * * point, and it needs to be uncapped.
Edit: I would also have to create a function which can get the TeamID and PlayerID of each player that enters the region, and assign it to a unit variable.
Hi there. I'm currently trying to figure out how to create a "zone control" map. For instance:
Any help would be very much appreciated.
This should probably go in the tutorial request thread or the project/development thread.
Try to create some variables for each zone point and income variables for each player that will hold how much progress each second each players progress bar should increase. if unit enter zone region then decrease the progress income variable. And then in trigger every 1 second check if there are units owned by each player and then increase their progress bar with the income variable.
I have a nice different solution also. Create zone tower (building that can be captured) and set its regeneration rate to high number. First unit that will destroy tower will trigger the trigger that will create new tower for owner of unit that killed it. And if other players unit destroy attackers tower will regenerate fast :) Its simplier solution still nice :) You can even set delay timer to regen towers HP like the protoss 10 sec delay for their shields to regen.
What if I do the following:
Edit: I would also have to create a function which can get the TeamID and PlayerID of each player that enters the region, and assign it to a unit variable.