How to make "TD"(Tower Defense) For dummies!

Moocow1569

New Member
Reaction score
0
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: 241

Tru_Power22

You can change this now in User CP.
Reaction score
144
1) You do not need regions to make a TD, you could simply use points if you know what your doing.

2) Indexing your regions in an array means you can order units with a few simple lines of code.

This example also leaks, a lot.

3) Waits are ugly, use timers instead.

Again this example leaks.

4) You could make your defeat more efficient by simply using a variable event. It wont run an if/then/else every time.

5) Show examples for special effects, and for that matter leader board trigger.

6) Colours do not make it more interesting to read. They annoy people.

7) There is a better tutorial for this.

http://world-editor-tutorials.thehelper.net/towerdef.php

8) Again, these triggers leak. Please learn to remove leaks before posting another tutorial.

http://world-editor-tutorials.thehelper.net/cat_usersubmit.php?view=27219

9) Use the [noparse]
Trigger:
[/noparse] tag to make triggers easier to read.

Sorry, I hate to be harsh, but it's true. This is not a helpful tutorial and will probably be graveyarded soon.

I can see you have the best of intentions, but you lack the experience to make a useful tutorial.

___________________

On a brighter note: Welcome to the helper.
 

gameman

It's been a long, long time.
Reaction score
96
You can compress your only example trigger.

Trigger:
  • Actions
    • Wait 1.00 seconds
    • Unit - Create 1 Level 1 for Player 12 (Brown) at (Center of Spawn &lt;gen&gt;) facing (Position of (Triggering unit)
    • Wait 1.00 seconds
    • Unit - Create 1 Level 1 for Player 12 (Brown) at (Center of Spawn &lt;gen&gt;) facing (Position of (Triggering unit)
    • Wait 1.00 seconds
    • Unit - Create 1 Level 1 for Player 12 (Brown) at (Center of Spawn &lt;gen&gt;)
    • (continue until half the page is taken up.)


To:

Trigger:
  • Actions
    • For each (Integer A) from 1 to 10, do (Actions)
      • Loop - Actions
        • Unit - Create 1 Level 1 for Player 12 (Brown) at (Center of Spawn &lt;gen&gt;) facing (Position of (Triggering unit)
        • Wait 1.00 seconds


9) Use the [ WC3 ][ /WC3 ] tag to make triggers easier to read (Don't put the spaces in).

You can use [noparse][noparse]
Trigger:
[/noparse][/noparse]
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top