Hello. I'm working on a 12 player map that revolves around the control of resources spread around control zones. There are 42 control zones spread around the map and each control zone is to be secured in a battlefield flag style. The more units a player has around a control zone then the harder it will be to take it from him. If a player has more units than another player then he will capture the control zone from the owning player. Consequently, if two players are on a control zone that they do not own, the player with more units will be the one to begin to capture the control zone. I would like to be able to put a delay that waits for a few seconds before capturing, however making this suitable for 12 players able to capture many control points at once is becoming very difficult. I have currently created a test trigger to start off with only a few control points between a few players. However, I'm already running into issues with generating the appropriate boss bars and then counting them down then stopping the countdown if the condition that the capturing player has the most units within the control zone. This issue has been driving me insane for the day ages and I would really appreciate some help.
This event will never fire, because the triggering region is defined by an event, and only available in conditions or actions. You will need to pick specific regions for your events.
If then Else
If
(Triggering region) == Forest nWe control
Then
Unit Group - Add (Triggering unit) to Units To Convert
Variable - Set Number of Units = (Number of Living units in Units To Convert)
General - If (Conditions) then do (Actions) else do (Actions)
If
(Abs(Number of Units)) > (Number of Living units in (Units in (Triggering region) having alliance Enemy with player (Owner of (Triggering unit)) matching Excluded: Missile, Dead, Hidden, with at most Any Amount))
Then
General - While (Conditions) are true, do (Actions)
Conditions
Actions
Else
Unit Group - Remove (Triggering unit) from Units To Convert
Variable - Set Units To Convert = 0
Else
If then Else
If
(Triggering region) == foresrt sEe control
Then
Unit Group - Add (Triggering unit) to Units To Convert
Variable - Set Number of Units = (Number of Living units in Units To Convert)
General - If (Conditions) then do (Actions) else do (Actions)
If
(Abs(Number of Units)) > (Number of Living units in (Units in (Triggering region) having alliance Enemy with player (Owner of (Triggering unit)) matching Excluded: Missile, Dead, Hidden, with at most Any Amount))
Then
General - While (Conditions) are true, do (Actions)
Conditions
Actions
Else
Unit Group - Remove (Triggering unit) from Units To Convert
Variable - Set Units To Convert = 0
Else
Excellent! That's solved the issue and cut down the amount of triggers I would probably have to write by about 100. Now I just have to figure out how to enable the required boss bars for capping, time the capture and allow capture to be halted when the conditions are no longer met for capturing a control point. Thanks for your help.
That's even easier, When you create a boss bar, set the health to an Invisible unit of X amount of health. it always has 1 Health, when your capping a point, set health to +1 every second, when you leave the zone, set health back to 1..
@Pshyched: Go
I was thinking about that. I can use the actual control point unit and just give it 100 units of health or so and then apply that regeneration of 1 hp per sec.
Been trying to figure out how to change the owner of a point after the life has regenerated to 100. Really stuck with this final part? Any assistance would be greatly appreciated.
Issue is now that the trigger is not firing. I've cleaned it up as best I could. Is this the fact that I'm running it as a test player rather than online? Here's the trigger so far.
UnitEntersEventsUnit-AnyUnitEnters(Region(AnyRegion))Unit-AnyUnitLeaves(Region(AnyRegion))LocalVariablesConditionsActionsGeneral-If(Conditions)thendo(Actions)elsedo(Actions)If(Triggeringregion)==ForestnWecontrolThenGeneral-If(Conditions)thendo(Actions)elsedo(Actions)If(OwnerofControlPointMinor[24.16,222.87])!=(Ownerof(Triggeringunit))(Abs((NumberofLivingunitsin(Anyunitsin(Triggeringregion)ownedbyplayer(Ownerof(Triggeringunit))matchingExcluded:Missile,Dead,Hidden,withatmostAnyAmount))))>(NumberofLivingunitsin(Unitsin(Triggeringregion)havingallianceEnemywithplayer(Ownerof(Triggeringunit))matchingExcluded:Missile,Dead,Hidden,withatmostAnyAmount))ThenPlayerGroup-Addplayer(Ownerof(Triggeringunit))toCapturingPlayerPlayerGroup-Addplayer(OwnerofControlPointMinor[24.16,222.87])toCapturingPlayerUI-Displaybossbar(#ofBossBars+1)withtitle"Capturing: Forest North West Expans...",portraitAssets\Textures\ui_chatbaricons_terran_individual.ddsandmaximumvalue100forCapturingPlayerUI-Setbossbar(#ofBossBars+1)bosstoControlPointMinor[24.16,222.87](Dorefreshthebossbar)Ping-PingtheminimapatFORESTSEExpansionforCapturingPlayerover2.0seconds,usingthecolor(100%,0%,0%)Unit-SetControlPointMinor[24.16,222.87]LifeRegenerationRateto1.0Unit-SetControlPointMinor[24.16,222.87]Lifeto1.0ElsePlayerGroup-ResetCapturingPlayertohavenoplayersElse
trigger won't fire, period. Can't figure out what the error is.
This event will never fire, because the triggering region is defined by an event, and only available in conditions or actions. You will need to pick specific regions for your events.
I was afraid of something like that. This is going to be more difficult than I thought since each zone will have to have it's own trigger.
The issue is that multiple players could be fighting for a zone at once and multiple zones could all be being fought over at once.
You can set any unit enters any region
Etc, etc, etc
So you can still have it as 1 trigger.
@Pshyched: Go
Any unit enters any region isn't one of the options for region in my trigger editor. Either that or I just have a bad version.
Create a Region variable, and set the variable to Any Region.
Create Variable
Set Variable to:
- Preset
Any Region
Unit - Any Unit Enters (Region(AnyRegion))
Edit - Not Create Region, Create Variable. Lol.
Excellent! That's solved the issue and cut down the amount of triggers I would probably have to write by about 100. Now I just have to figure out how to enable the required boss bars for capping, time the capture and allow capture to be halted when the conditions are no longer met for capturing a control point. Thanks for your help.
That's even easier, When you create a boss bar, set the health to an Invisible unit of X amount of health. it always has 1 Health, when your capping a point, set health to +1 every second, when you leave the zone, set health back to 1..
That should work.
@Pshyched: Go I was thinking about that. I can use the actual control point unit and just give it 100 units of health or so and then apply that regeneration of 1 hp per sec.
@Providence932: Go
Would I have to attach a data editor made health regeneration behavior to this object in order to get it to regenerate properly?
Edit: Nevermind, I've found it. For anyone else looking it's under unit property (set) -Life regeneration
@Providence932: Go
Been trying to figure out how to change the owner of a point after the life has regenerated to 100. Really stuck with this final part? Any assistance would be greatly appreciated.
Set the owner of the Regenerating unit to owner of entering unit, so then you change the owner to owner of (Regenerating unit)
@Pshyched: Go
The issue is how do I detect when the health is at 100%?
Issue is now that the trigger is not firing. I've cleaned it up as best I could. Is this the fact that I'm running it as a test player rather than online? Here's the trigger so far.
trigger won't fire, period. Can't figure out what the error is.