• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

How to make a "TD"(Tower Defense)

Did this tutorial help?

  • Yes, it is amazing thanks!!!

    Votes: 3 37.5%
  • No, it's not entirely what i was looking for...

    Votes: 5 62.5%

  • Total voters
    8
Level 5
Joined
Jan 15, 2009
Messages
80
Difficulty 3/10

In this tutorial i will explain how to make a TD, I will show you how to make the unit walk a path to the end where you will lose a life, and i will also show you the basics to triggering spawns etc.


Step 1 Terrain
Every TD needs to have a path for the units to walk so all you will need to do is make a simple walkway for the unit. The terrain the unit must walk on will have to be unbuildable for the type of TD i am showing you. If you are not quite sure of what i am talking about refer to my map i will link.


Step 2 Regions
Regions are the main necessity for a TD to function, you will need to put a region for the area you would like the units to spawn (Name it spawn), then add regions at every corner so that he will get the message when we make the triggers to make a turn (Name the regions "Move 1" "Move 2" ect.) When you get to the end make another region at the end and name it "End". If you are not quite sure of wait i am explaining refer to the map i will link.


Step 3 Movement Triggers
The main point of a game is to make the units move to the end and then you lose a life, so what kind of game would it be if the unit didn't move?
Here is the frame to this trigger...
Event - Unit - A unit enters Move 1 <gen>
Conditions - (Owner of (Entering unit)) Equal to Player 12 (Brown)
Actions - Unit - Order (Entering unit) to Move To (Center of Move 2 <gen>)

Event - Unit - A unit enters Move 2 <gen>
Conditions - (Owner of (Entering unit)) Equal to Player 12 (Brown)
Actions - Unit - Order (Entering unit) to Move To (Center of Move 3 <gen>)

This might take a bit to make ever move, but it will be worth it in the end!

Step 4 Spawning Units
For a spawning trigger to work you must have a small time in between each spawn so that the units will not get clustered and walk off the path. To make this trigger you must set the timing up perfectly, for example at the beginning give the player about 15 seconds to build and then make the trigger run and then separate all the spawns by 1 second. When you get to the end make a wait time of around 10 seconds and then make a action to run the next spawn so that it wont just stop at that first wave.
If you have done the trigger right it should look something like this...

If you are going to use splash towers in your map make the units close together.(Reduce the Wait Time between spawns)

Event - Time - Elapsed game time is 15.00 seconds
Condition -
Actions - Unit - Create 1 Level 1 for Player 12 (Brown) at (Center of Spawn <gen>) facing (Position of (Triggering unit)
Wait 1.00 seconds
Unit - Create 1 Level 1 for Player 12 (Brown) at (Center of Spawn <gen>) facing (Position of (Triggering unit)
Wait 1.00 seconds
Unit - Create 1 Level 1 for Player 12 (Brown) at (Center of Spawn <gen>) facing (Position of (Triggering unit)
Wait 1.00 seconds
Unit - Create 1 Level 1 for Player 12 (Brown) at (Center of Spawn <gen>) facing (Position of (Triggering unit)
Wait 1.00 seconds
Unit - Create 1 Level 1 for Player 12 (Brown) at (Center of Spawn <gen>) facing (Position of (Triggering unit)
Wait 1.00 seconds
Unit - Create 1 Level 1 for Player 12 (Brown) at (Center of Spawn <gen>) facing (Position of (Triggering unit)
Wait 1.00 seconds
Unit - Create 1 Level 1 for Player 12 (Brown) at (Center of Spawn <gen>) facing (Position of (Triggering unit)
Wait 1.00 seconds
Unit - Create 1 Level 1 for Player 12 (Brown) at (Center of Spawn <gen>) facing (Position of (Triggering unit)
Wait 1.00 seconds
Unit - Create 1 Level 1 for Player 12 (Brown) at (Center of Spawn <gen>) facing (Position of (Triggering unit)
Wait 1.00 seconds
Unit - Create 1 Level 1 for Player 12 (Brown) at (Center of Spawn <gen>) facing (Position of (Triggering unit)
Wait 1.00 seconds
Unit - Create 1 Level 1 for Player 12 (Brown) at (Center of Spawn <gen>) facing (Position of (Triggering unit)
Wait 1.00 seconds
Unit - Create 1 Level 1 for Player 12 (Brown) at (Center of Spawn <gen>) facing (Position of (Triggering unit)
Wait 1.00 seconds
Unit - Create 1 Level 1 for Player 12 (Brown) at (Center of Spawn <gen>) facing (Position of (Triggering unit)
Wait 1.00 seconds
Unit - Create 1 Level 1 for Player 12 (Brown) at (Center of Spawn <gen>) facing (Position of (Triggering unit)
Wait 1.00 seconds
Unit - Create 1 Level 1 for Player 12 (Brown) at (Center of Spawn <gen>) facing (Position of (Triggering unit)
Wait 1.00 seconds
Unit - Create 1 Level 1 for Player 12 (Brown) at (Center of Spawn <gen>) facing (Position of (Triggering unit)
Wait 1.00 seconds
Unit - Create 1 Level 1 for Player 12 (Brown) at (Center of Spawn <gen>) facing (Position of (Triggering unit)
Wait 1.00 seconds
Unit - Create 1 Level 1 for Player 12 (Brown) at (Center of Spawn <gen>) facing (Position of (Triggering unit)
Wait 1.00 seconds
Unit - Create 1 Level 1 for Player 12 (Brown) at (Center of Spawn <gen>) facing (Position of (Triggering unit)
Wait 1.00 seconds
Unit - Create 1 Level 1 for Player 12 (Brown) at (Center of Spawn <gen>) facing (Position of (Triggering unit)
Wait 10.00 seconds
Trigger - Run Spawn 2 <gen> (checking conditions)



This is repeated 20 times so that 20 units will spawn.

Step 5 "Lose a Life"
This is a relatively complicated trigger for the level i am explaining at but what you will need to do first is make a variable and name it "Lives"(Integer), this will be the integer to how ever many lives you have. Now you will make a event "if unit enters End" then make a condition to question if it belongs to player 12 and next you will need to do the check for if you are at 1(one because if you have one you will remove another life later in the trigger and then you will have 0) lives(you lose), then you will make a set variable action and set lives to -1 from what it was last at(If you aren't following don't worry i will explain it better in a second), second last thing you will do is make another action displaying text telling you that you have lost a life, and last but not least you will make the unit dissapear.
This is what the trigger should look like...

Events - Unit - A unit enters End <gen>
Conditions - (Owner of (Triggering unit)) Equal to Player 12 (Brown)
Actions - If (Lives Equal to 1) then do (Game - Display to (All players) for 30.00 seconds the text: YOU FAIL!) else do (Do nothing)
If (Lives Equal to 1) then do (Player Group - Pick every player in (All players) and do (Game - Defeat Player 1 (Red) with the message: Defeat!) else do (Do nothing)
Set lives = (Lives - 1)
<--- This is a arithmatic but you can refer to my example map if you are confused
Game - Display to (All players) for 10.00 seconds the text: (You have lost a life! + (String(Lives))
Unit - Remove (Triggering unit from the game


Step 6 Adding towers
When you add towers you will most likely want towers that upgrade, this is the process in making a map that takes most of your time. This takes so long because you will have to balance out the damage, effects, and life of units. You can also make your game more fun by making the effects of your towers poison, frost, fire, slow, air, splash, etc. You will also need a builder and you can fool around with this making many different types of builders like night elf, undead, human, fairy, etc...

I'm sorry i didn't go much further on this part of the tutorial but really fooling around with this part is pretty fun so i thought i would leave it to you.

Step 7 Enhancing your TD
So far i have explained all the basic's to making a TD but i will tell you a few things that enhance a player's experience when playing a TD in case you are making one.

1. Making the entire map visible.
2. Making a leaderboard displaying lives, players kills, and the level you are currently on.
3. Adding Special effects for when a unit reach's the end alive.
4. Balancing dmg, life, and effect's your towers have on units.


Well sadly this is the end to my tutorial, hope it helps and remember to have fun!!!
 

Attachments

  • TD Tut.w3m
    19.2 KB · Views: 96
Last edited:
Level 14
Joined
Jan 5, 2009
Messages
1,127
This tutorial is ok. But i suggest:
Make sure it doesn't leak, because your tutorial leaks alot. Tell them to
create a point variable for each region then tell them to set the variable
  • Example
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Spawn = (Center of Spawn <gen>)
Oh and by the way use trigger tags, its so hard reading coloured writing!
 
Level 3
Joined
Dec 19, 2009
Messages
53
Looks like a good tutorial, however you should use trigger tags as stated by Crazed Seal. You should also include screenshots for simplicity.
 
Level 9
Joined
Aug 21, 2008
Messages
533
This is really bad cause:
1)leaks with no ends
2)very ineficent triggering
3)hard to red(first i even dont saw the black text)
4)I would never do so much work making step 3...
5) quite short( imean it should be for a TD...)
6)Step 6 is really short, thats the most important step for a TD.I mean for a good one, with triggered abilitys and so on..
 
Level 14
Joined
Jan 5, 2009
Messages
1,127
Ok another thing:
Use this instead of having a million and one actions. Why? Because when you add something to a really big trigger it gets annoying and you can get lost and accidently forget to put something. Heres my suggestion:
  • Spawn
    • Events
      • Time - Elapsed game time is 15.00 seconds
    • Conditions
    • Actions
      • For each (Integer Spawn2) from 1 to 20, do (Actions)
        • Loop - Actions
          • Unit - Create 1 Peasant for Player 12 (Brown) at Spawn facing Default building facing degrees
          • Wait 1.00 seconds
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
This is really bad, this will show people the wrong way to create TD's.
The difficulty of this should be about 1/10, it would be a good tutorial for the people who are completely new to mapping and only understand the most basic functions in the world editor.

You use 20 triggers (total) for 1 player.
I can do it with 7 triggers for all players with as much checkpoints as you like (there can be 1000 checkpoints per player and it doesn't need an extra trigger, only a bit of effort to set up those checkpoints).
Apart from that, I can adjust the delay between 2 unit spawns, the gold given per level, when lumber is given, the amount of units spawned, what kind of wave it is and whatever you want, all by adjusting a few variables.
(Of course, everything is leakless).

The difficulty might be a bit higher, but I don't see the point in teaching people how to do something wrong.
 

Attachments

  • Sample TD.w3x
    24.6 KB · Views: 112
Level 20
Joined
Jan 6, 2008
Messages
2,627
hmm, its possible to make with 3 triggers in total, and if ppl follow this tut it will be like, the normal amount of players is 10, 200 triggers :S

The 3 triggers i would use would be

Init
Spawn
Move

with just database and integer every 30 second, so like 1+ every single 30 second and that will spawn the next unit in the database :S
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
hmm, its possible to make with 3 triggers in total, and if ppl follow this tut it will be like, the normal amount of players is 10, 200 triggers :S

The 3 triggers i would use would be

Init
Spawn
Move

with just database and integer every 30 second, so like 1+ every single 30 second and that will spawn the next unit in the database :S

Yeah, but on top of that I've got a few utilities to make life easier xD
(such as a timer, set up creeps, etc...).

Things you usually combine, but I didn't because it's meant to be a sample and it would be unreadable when combined.

200 leaky triggers is just way too much, imagine there were more checkpoints, or even more players O_O
It also pains me because it's 200 triggers with just 1 action... I like 1 trigger with 200 actions a lot more xD
 
Top