• 🏆 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!

[Trigger] GUI: Tower Defense Creep Blocking

Status
Not open for further replies.
Level 25
Joined
May 11, 2007
Messages
4,651
Ya, writing every word with capital letter is fun!
But to the point:

Anyone got a good system for detecting and moving a unit who is attacking to a point? I thought I had a good one, but I'm having trouble making it work:
  • New Ultra Good Block Detecter Team1
    • Events
      • Unit - A unit owned by Player 1 (Red) Is attacked
      • Unit - A unit owned by Player 2 (Blue) Is attacked
      • Unit - A unit owned by Player 3 (Teal) Is attacked
    • Conditions
      • ((Attacking unit) has buff Blocking Warning ) Equal to False
      • ((Owner of (Attacking unit)) is an enemy of Player 1 (Red)) Equal to True
    • Actions
      • Unit - Add Blocking Warning (Creep, Unholy Aura) to (Attacking unit)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Waypoint (Creeps) for (Triggering unit)) Equal to 1
        • Then - Actions
          • Set movepoint1 = (Center of P2 <gen>)
          • Unit - Order (Triggering unit) to Move To movepoint1
          • Unit - Increase level of Waypoint (Creeps) for (Triggering unit)
          • Game - Display to (All players) the text: moving to p2
          • Custom script: call RemoveLocation( udg_movepoint1 )
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Waypoint (Creeps) for (Triggering unit)) Equal to 2
        • Then - Actions
          • Set movepoint1 = (Random point in P3 <gen>)
          • Unit - Order (Triggering unit) to Move To movepoint1
          • Unit - Increase level of Waypoint (Creeps) for (Triggering unit)
          • Game - Display to (All players) the text: moving to p3
          • Custom script: call RemoveLocation( udg_movepoint1 )
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Waypoint (Creeps) for (Triggering unit)) Equal to 3
        • Then - Actions
          • Set movepoint1 = (Center of P4 <gen>)
          • Unit - Order (Triggering unit) to Move To movepoint1
          • Game - Display to (All players) the text: moving to p4
          • Unit - Increase level of Waypoint (Creeps) for (Triggering unit)
          • Custom script: call RemoveLocation( udg_movepoint1 )
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Waypoint (Creeps) for (Triggering unit)) Equal to 4
        • Then - Actions
          • Set movepoint1 = (Center of P5 <gen>)
          • Unit - Order (Triggering unit) to Move To movepoint1
          • Unit - Increase level of Waypoint (Creeps) for (Triggering unit)
          • Game - Display to (All players) the text: moving to p5
          • Custom script: call RemoveLocation( udg_movepoint1 )
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Waypoint (Creeps) for (Triggering unit)) Equal to 5
        • Then - Actions
          • Set movepoint1 = (Center of P6 <gen>)
          • Game - Display to (All players) the text: moving to p6
          • Unit - Order (Triggering unit) to Move To movepoint1
          • Unit - Increase level of Waypoint (Creeps) for (Triggering unit)
          • Custom script: call RemoveLocation( udg_movepoint1 )
        • Else - Actions
-------------------
  • Creep Attacks
    • Events
      • Unit - A unit owned by Player 1 (Red) Is attacked
      • Unit - A unit owned by Player 2 (Blue) Is attacked
      • Unit - A unit owned by Player 3 (Teal) Is attacked
    • Conditions
      • (Owner of (Attacking unit)) Equal to Player 8 (Pink)
      • ((Attacking unit) has buff Blocking Warning ) Equal to True
    • Actions
      • Game - Display to (All players) the text: TELEPORTING
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Waypoint (Creeps) for (Triggering unit)) Equal to 0
        • Then - Actions
          • Set MovePointTeam1 = (Center of P1 <gen>)
          • Unit - Move (Attacking unit) instantly to MovePointTeam1
          • Custom script: call RemoveLocation( udg_MovePointTeam1)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Waypoint (Creeps) for (Triggering unit)) Equal to 1
        • Then - Actions
          • Set MovePointTeam1 = (Center of P2 <gen>)
          • Unit - Move (Attacking unit) instantly to MovePointTeam1
          • Custom script: call RemoveLocation( udg_MovePointTeam1 )
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Waypoint (Creeps) for (Triggering unit)) Equal to 2
        • Then - Actions
          • Set MovePointTeam1 = (Center of P3 <gen>)
          • Unit - Move (Attacking unit) instantly to MovePointTeam1
          • Custom script: call RemoveLocation( udg_MovePointTeam1 )
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Waypoint (Creeps) for (Triggering unit)) Equal to 3
        • Then - Actions
          • Set MovePointTeam1 = (Center of P4 <gen>)
          • Unit - Move (Attacking unit) instantly to MovePointTeam1
          • Custom script: call RemoveLocation( udg_MovePointTeam1 )
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Waypoint (Creeps) for (Triggering unit)) Equal to 4
        • Then - Actions
          • Set MovePointTeam1 = (Center of P5 <gen>)
          • Unit - Move (Attacking unit) instantly to MovePointTeam1
          • Custom script: call RemoveLocation( udg_MovePointTeam1 )
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Waypoint (Creeps) for (Triggering unit)) Equal to 5
        • Then - Actions
          • Set MovePointTeam1 = (Center of P6 <gen>)
          • Unit - Move (Attacking unit) instantly to MovePointTeam1
          • Custom script: call RemoveLocation( udg_MovePointTeam1 )
        • Else - Actions
But the thing is.. They seem only to use
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (Level of Waypoint (Creeps) for (Triggering unit)) Equal to 0
    • Then - Actions
      • Set MovePointTeam1 = (Center of P1 <gen>)
      • Unit - Move (Attacking unit) instantly to MovePointTeam1
      • Custom script: call RemoveLocation( udg_MovePointTeam1)
    • Else - Actions
And none of the others. Help please.
NOTE: I don't want the creeps to go on a rage frenzy killing every tower (wintermaul).
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
The easiest anti-block is just this:

spawn dummy:
  • Events
    • Time - Every 4.00 seconds of game time
  • Conditions
  • Actions
    • Unit - Create 1 Dummy Runner for Player 12 (Brown) at (Center of Region) facing Default building facing (270.0) degrees
    • Unit Group - Pick every unit in (Units of type Dummy Runner) and do (Unit - Order (Picked unit) to Orc Blademaster - Wind Walk)
    • Unit Group - Pick every unit in (Units in Region owned by Player 12 (Brown)) and do (Unit - Order (Picked unit) to Move To (Center of End Region))
Block:

  • Actions
    • Unit - A unit Is issued an order with no target
  • Condtitions
    • (Unit-type of (Triggering unit)) Equal to Dummy Runner
  • Actions
    • Unit - Order (Random unit from (Units within 130.00 of (Position of (Triggering unit)))) to Orc Blademaster - Wind Walk (= Sell-ability, can be something different for you)
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Region contains (Triggering unit)) Equal to True
      • Then - Actions
        • Unit - Order (Triggering unit) to Move To (Center of End Region)
      • Else - Actions
I've done the if/then/else in case there are multiple lanes, so you know where you need to send the dummy to.
If you only have 1 lane, only use the action, the if/then/else isn't necessary

Make it so you can't see the dummy and give him 522 MS and... you're done :p
 
Level 5
Joined
Dec 18, 2007
Messages
205
you could use the custom value of a unit.
each checkpoint gives a unit another custom value.
for example you spawn a unit for player 1 with the custom value 10 and for player 2 with 20.
then they keep passing checkpoints and get always a higher custom value for each checkpoint, best is +1 (requires of course less than 10 checkpoints for each player).

so then you recognize an attack of a creep. check the custom value. and then move the unit to the next point.
e.g.: unit with custom value 24 attacks a tower. then you must know which checkpoint gives the unit the custom value 25. and then move instantly to that point and order the unit to move the checkpoint that gives the custom value 26.
best to do this is via a global rect array.
so 'your_area[10]' would be the spawn of the creeps for player 1 and 'your_area[11]' the first checkpoint of player1's creeps.

greetz
 
Level 25
Joined
May 11, 2007
Messages
4,651
~bump~
Tried it with mana, didn't help, I've heard custom values are leaking like hell,
so..

Could anyone post a decent trigger on how to detect and move? I don't want to have to deprotect gemtd/island TD just cause of that..
 
Level 25
Joined
May 11, 2007
Messages
4,651
checking ability levels fails. custom values should work.

easier ways to order blocked creeps to move again is checking when they kill a tower or giving them suicide ability on autocast.

I heard custom value leaked like hell.
~Bump, anyone got any system to share? Right I got that when a creep attacks.. it removes tower and returns cash. Thing is that creeps goes crazy and attacks like hell all the time..
 
Status
Not open for further replies.
Top