• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Attempting a sort of advanced control-point trigger

Status
Not open for further replies.
Level 5
Joined
Jan 6, 2010
Messages
115
I have an existing and well working "control point" mechanism that I want to do a little more advanced. It sounded easy at first, but suddenly I'm digging my way into a million if's and something that seems unnecessary complex, and would therefore appreciate some fresh eyes on the problem. I guess what I ask for is the most elegant and simple way of triggering the following. I'm not asking for any more than pseudo-trigger, off course.

  • A control point can be be held by either Alliance or Horde, or by Neutral Passive which is the case at game initiation.
  • When the opposing force of the current owner of the control point has units (ground, alive, etc) within the influence-region of the control point, AND the owner has none, a countdown timer will ensue. At the end of the timer (say, 10 sec), the owner of the control point will change to the opposite faction.
  • However, If the current owner of the control point moves a unit into the influence region of the control point while the timer is still counting, it will be aborted.
  • Whenever the opposing force is the only one with units in the area again, the countdown will once again start from the full value (10 sec)

There are a few more small challenges and complications, but this is the essence of it. Any thoughts? For instance, what is the best event to check the above conditions? Periodic, or Unit entered, left, killed etc? I started triggering this as a periodic check (each second), with a boolean to keep track of whether or not a timer was already running.
 
Last edited:
When a unit enters your region.
If the time of the countdown timer is not equal to 0 do nothing else start the countdown timer.

Have a second periodic trigger running.
In the periodic trigger you pick every unit in the capture region that belongs to the team that is in control.
If the number of units in the group is 0 do nothing.
Else stop the countdown timer.

In a third trigger have the event that the countdown timer finishes.
Change owner of the capture point.


Something along those lines.

Edit:
You can also pick every unit in the region for both teams.
If units in controlling group = 0
and
If units in capturing group > 0

Edit 2:
Actually you could skip the "enter region" trigger altogether.
 
Level 12
Joined
Nov 3, 2013
Messages
989
Edit: Removed it cause of too much crap and Solu's suggestion was already very similar and simpler and closer to OP's description
 
Last edited:
Status
Not open for further replies.
Top