How do units moving backwards in a tower defense?

MissKerrigan

Active Member
Reaction score
23
Hello,

- I created a path in my tower defense for the creeps to move over
- I just drew this path by using the terrain editor
- I used about 12 regions which function like waypoints for the creeps

question

I want to make a special ability for towers which having 5% chance to let the targeted creep moving backwards the path for about 3-4 seconds

I tried SO MANY things but nothing seems to work well
Can anyone help me with this?

MissKerrigan


(I tried a trigger to order the targeted unit to the start, and after 3 seconds to the finish again, but the unit is NOT moving backwards at the path, it just walks in a straight line to the start)
 

Darthfett

Aerospace/Cybersecurity Software Engineer
Reaction score
615
Is your tower defense the type that allows players to maze with their towers, or the type that has towers outside the path of the creeps, so that the creeps always have a predetermined direction?

If you allow mazing, would you expect creeps to go backwards through a player's maze?

One catch-all way of doing this, is to track the last 3-4 seconds worth of positions (log a new position every 0.1 seconds or so) for each creep, and to move it backwards through these points when it gets hit.
 

MissKerrigan

Active Member
Reaction score
23
No I don't have any maze, in fact I hate maze tower defense games :)

- The creeps starting in the left and going to the right in a specific way by a few bends
- I called my 12 regions 'corner 1' 'corner 2' 'corner 3' etc...
- The creeps moving from corner 1,2,3,4,5,6,7,8,9,10,11,12 to the finish
- The players must build towers outside the path and stop the creeps

the problem is JUST that I don't know which trigger to make because I don't know WHERE the targeted units are when the effect occurs, so I can't send them to any corner

does anyone understand this?
 

X-maul

AKA: Demtrod
Reaction score
201
Well, the easiest way I can think off, would be to make the area around the path, unpathable. Then you could just order the units to walk to the Start, and then go to the end when the effect wears off.
 

MissKerrigan

Active Member
Reaction score
23
I already thought of that but this is not working, because it's too complicated and takes too much time to place so many path blockers in the map
 

MissKerrigan

Active Member
Reaction score
23
I just created a straight line from left to right and created a trigger which orders the targeted unit to the start, and after x seconds to the finish
 

Phubar

Ultra Cool Member
Reaction score
30
Sry for the schematic answer but i have some problems explaining it using normal sentences.

You have to:
- get which is the destination point of the order that is in the index 0 (zero) of the tageted unit
-assign it to a variable
-check what "corner" is equal to this variable
-order that unit to go to the previous "corner"
-after a while order the unit to go to the point in the variable

All this will work only if the unit will only walk while are in the path, not if they will make attacks (becouse the order in the index 0 in this case can be a move order or an attack order)
 

X-maul

AKA: Demtrod
Reaction score
201
If you go into the Terrain editor and click [H] you will go to the pathing part of the terrain editor. Here you can paint the path as you want, it does not take that long. But do as you find best.
 

MissKerrigan

Active Member
Reaction score
23
The problem with pathing (H) is that the minimun pathing is 0.5 tile, so I tried to make the path 1 tile (surrounding by 0.5 tile pathing)

This is causing trouble the creeps walking to 1 edge of the pathing since I MUST give the creeps 0 radius, because some effects (slow, stun, teleport)


It would be only possible for me to create a path of 0.5 tiles and surrounded by 0.5 tile pathings, but this bothers the map from not being equally in beauty
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top