- 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.
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]
-
Events
Last edited: