• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[Trigger] Tower defense, point problem

Status
Not open for further replies.
Level 6
Joined
May 13, 2009
Messages
260
Well me and my friend are developing a tower defense, but we have found a problem. The tower defense is Node based with mazing (A unit must move to the first square then walk to the next etc). Because you can maze, the creeps must be able to attack, if not everyone will cheat.

When a unit attacks it will move to Location. Location is a variable and will change the value to the node after the current one. So if it entered Node 2 it will go to Node 3. But when a unit attacks and comes back (we use a trigger that allows the creeps to land a punch but will then start to walk to Location again). But when it recovers it moves to the wrong node. We know where the problem is but we can't find out how to fix it. When a unit attacks the creeps still walk and will change Location's value. So how do we do multi-unit variable?

We would rather not use Custom value because we use it for spells and to make the unit not skip a node, but if there's no other way then it's okay.

We know there are other ways then letting the unit attacks but we don't know how to make one. Like in Island TD where blocked units starts a counter and when it reaches 0, you will automatically leak.

And if you know a way to make all players use the same trigger, we would be grateful.

  • Player 1 Node 1
    • Events
      • Unit - A unit enters Player 1 Node 1 <gen>
    • Conditions
      • (Custom value of (Entering unit)) Equal to 0
      • (Owner of (Entering unit)) Equal to Player 12 (Brown)
    • Actions
      • Set Location[1] = (Center of Player 1 Node 2 <gen>)
      • Unit - Set the custom value of (Entering unit) to 1
      • Unit - Order (Entering unit) to Move To Location[1]
EDIT Please move it to World editor help zone, created it in the wrong section. My bad
 
Last edited:
Status
Not open for further replies.
Top