- Joined
- Jan 6, 2010
- Messages
- 118
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.
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.
- 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: