• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Basics of a TD

Note: This tutorial will explain you the very basics of making a TD. This is in no way geared towards experienced modders but is made for the beginners within Warcraft III modding.


What is a TD?

TD stands for Tower Defense and is a genre of maps developed for the Warcraft III engine. In a TD your goal is to build towers to prevent creeps of reaching a certain destination.


So.. How do I create one?

A good way of starting on a TD is to firstly make the terrain you find fitting for your map and then determine the lanes and setting up the pathing system (the creeps movement).


Uhh right, so how do I do that?

To get the creeps to move from 1 place to another you will need to make regions at the desired locations and then trigger the movement like this (the Trigger Editor is located inbetween the Terrain Editor and the Sound Editor):


Movement Region 1
Events
Unit - A unit enters Spawn Region
Conditions
None
Actions
Unit - Order (Entering unit) to Move To (Center of Region1)

Movement Region 2
Events
Unit - A unit enters Region1
Conditions
None
Actions
Unit - Order (Entering unit) to Move To (Center of Region2)

Movement Region 3
Events
Unit - A unit enters Region2
Conditions
None
Actions
Unit - Order (Entering unit) to Move To (Center of Region3)

Movement Region 4
Events
Unit - A unit enters Region3
Conditions
None
Actions
Unit - Order (Entering unit) to Move To (Center of Region4)

Movement Region 5
Events
Unit - A unit enters Region4
Conditions
None
Actions
Unit - Order (Entering unit) to Move To (Center of End Region)

pathing3gp.jpg


Ok done, now what?

Next is the actual trigger that spawns the "waves" as the levels of units is often called. It can be done like this:


Wave 1
Events
Time - Elapsed game time is 30.00 seconds
Conditions
None
Actions
Unit - Create 40 Footman for Player 12 (Brown) at (Center of Spawn Region) facing 0.00 degrees



Right, so the regions and spawning is made, now what's next?

Next on the list should be finding out what to make of builders, towers and making the creeps, this is done within the Object Editor which is located inbetwen the Sound Editor and the Campaign Editor. You can also make triggered abilities for the towers but if you need help from this tutorial I suggest you wait with that untill a later time.


Right-o, I have made some towers, a builder and all the creeps, now what?

Adding the "lives" function is something that almost every td has, atleast it is only a few which doesent, so that is also included in here. Now I will show how you create the basic Leaderboard and putting in the lives function. Before you make the actual Leaderboard you have to make a variable like this one shown below to set the lives initial value.


lives8vi.jpg


Now when that is done you can move on to creating the Leaderboard and setting up everything that has to with lives and updating the Leaderboard.


Setup Leaderboard
Events
Time - Elapsed game time is 0.10 seconds
Conditions
None
Actions
Leaderboard - Create a leaderboard for (All players) titled Lives
Leaderboard - Add Player 1 (Red) to (Last created leaderboard) with label Lives and value Lives
Leaderboard - Change the color of all labels for (Last created leaderboard) to (0.00%, 100.00%, 0.00%) with 0.00% transparency
Leaderboard - Show (Last created leaderboard)

Life Lost
Events
Unit - A unit enters End Region
Conditions
(Owner of (Entering unit)) Equal to Player 12 (Brown)
Actions
Set Lives = (Lives - 1)
Unit - Remove (Entering unit) from the game Leaderboard - Change the value for Player 1 (Red) in (Last created leaderboard) to Lives
Game - Display to Lives the text: (( + ((Name of (Entering unit)) + has reached the end! )) + ((String(Lives)) + chances left))
Trigger - Run Defeat (checking conditions)

Defeat Trigger
Events
None (it is a trigger that is run by the 'Life Lost' trigger)
Conditions
None
Lives Less than or equal to 0
Actions
Unit Group - Pick every unit in (Units in (Playable map area)) and do (Unit - Remove (Picked unit) from the game)
Game - Defeat Player 1 (Red) with the message: Defeat!


Leaderboard made, is there anything more?

Most td maps (atleast the decent ones) has it so you are able to sell your towers so here I will show a way it can be done.


Tower Selling
Events
Unit - A unit Begins casting an ability
Conditions
(Ability being cast) Equal to Sell Tower
Actions
Player - Add ((Point-value of (Casting unit)) / xxx) to (Owner of (Casting unit)) Current gold
Unit - Remove (Casting unit) from the game


Ability done, what's next?

Once you have succesfully made the Tower Selling ability I think you are covered in with the basic triggers, now you only need to make so you win once last wave of units have been defeated. Good luck with your td map! :)
 

Ki

Ki

Level 7
Joined
Aug 20, 2005
Messages
258
Yeah, I guess it makes more sense once you actually read the title.

One question though: if you tell the creep to start moving to region 2 right after the unit enters the region 1, wouldn't the creep's path be a little crooked? It's not really too important, but it could be easily fixed by making smaller regions.
 
Level 2
Joined
Nov 14, 2005
Messages
10
hi, im making a td called race td. you can choose 4 races (human, orc etc.). i have everything set at the beggining EXCEPT a multiboard. i have no clue how to make one. i want a multiboard at top left and a board under it that says the level you are on to look like this
screeny7et.png


can anyone please post the triggers for this? ive read the whole topic, havent found anything
 
Level 1
Joined
May 10, 2006
Messages
1
But... you forgot the most important part of any TD - Waves. You can't argue about the fact that all TD's must have succeding waves for it to actually look good, or to be called a TD in the first place.

So, help?
 
Update the tutorial, since I cannot edit my first post I guess I have to repost the whole thing:


Note: This tutorial will explain you the very basics of making a TD. This is in no way geared towards experienced modders but is made for the beginners within Warcraft III modding.


What is a TD?

TD stands for Tower Defense and is a genre of maps developed for the Warcraft III engine. In a TD your goal is to build towers to prevent creeps of reaching a certain destination.


So.. How do I create one?

A good way of starting on a TD is to firstly make the terrain you find fitting for your map and then determine the lanes and setting up the pathing system (the creeps movement).


Uhh right, so how do I do that?

To get the creeps to move from 1 place to another you will need to make regions at the desired locations and then trigger the movement like this (the Trigger Editor is located inbetween the Terrain Editor and the Sound Editor):


Note: I will use Player 12 (Brown) as the "bad guys".

Movement Region 1
Events
Unit - A unit enters Spawn Region
Conditions
(Owner of (Triggering unit)) Equal to Player 12 (Brown)
Actions
Unit - Order (Entering unit) to Move To (Center of Region1)

Movement Region 2
Events
Unit - A unit enters Region1
Conditions
(Owner of (Triggering unit)) Equal to Player 12 (Brown)
Actions
Unit - Order (Entering unit) to Move To (Center of Region2)

Movement Region 3
Events
Unit - A unit enters Region2
Conditions
(Owner of (Triggering unit)) Equal to Player 12 (Brown)
Actions
Unit - Order (Entering unit) to Move To (Center of Region3)

Movement Region 4
Events
Unit - A unit enters Region3
Conditions
(Owner of (Triggering unit)) Equal to Player 12 (Brown)
Actions
Unit - Order (Entering unit) to Move To (Center of Region4)

Movement Region 5
Events
Unit - A unit enters Region4
Conditions
(Owner of (Triggering unit)) Equal to Player 12 (Brown)
Actions
Unit - Order (Entering unit) to Move To (Center of End Region)

pathing3gp.jpg




Note: This tutorial is mostly counting for none-mazing TD's. If you try to do a mazing TD with the same pathing system that I have done in the screenshot above this then the creeps will simply run past the towers, to prevent this from happening have the area being walled in or raised.


Ok done, now what?

Next is the actual trigger that spawns the "waves" as the levels of units is often called. It can be done like this:


Wave 1
Events
Time - Elapsed game time is 30.00 seconds
Conditions
None
Actions
Unit - Create 40 Footman for Player 12 (Brown) at (Center of Spawn Region) facing 0.00 degrees


In the above trigger it will spawn 40 Footmen instantly, if you do not want this to happen but want them spawning 1 at a time you can do it like this:


Wave 1
Events
Time - Elapsed game time is 30.00 seconds
Conditions
None
Actions
Unit - Create 1 Footman for Player 12 (Brown) at (Center of Spawn Region) facing 0.00 degrees
Wait 1.00 seconds
Unit - Create 1 Footman for Player 12 (Brown) at (Center of Spawn Region) facing 0.00 degrees
Wait 1.00 seconds
Unit - Create 1 Footman for Player 12 (Brown) at (Center of Spawn Region) facing 0.00 degrees
Wait 1.00 seconds
Unit - Create 1 Footman for Player 12 (Brown) at (Center of Spawn Region) facing 0.00 degrees
etc...


Right, so the regions and spawning is made, now what's next?

Next on the list should be finding out what to make of builders, towers and making the creeps, this is done within the Object Editor which is located inbetwen the Sound Editor and the Campaign Editor. You can also make triggered abilities for the towers but if you need help from this tutorial I suggest you wait with that untill a later time.


Right-o, I have made some towers, a builder and all the creeps, now what?

Adding the "lives" function is something that almost every TD has, atleast it is only a few which does not, so that is also included in here. Now I will show how you create the basic Leaderboard and putting in the lives function. Before you make the actual Leaderboard you have to make a variable like this one shown below to set the lives initial value.


lives8vi.jpg



Now when that is done you can move on to creating the Leaderboard and setting up everything that has to with lives and updating the Leaderboard.


Note: The below triggers is for a Solo TD life system and is only setted up for Player 1 (Red).

Setup Leaderboard
Events
Time - Elapsed game time is 0.10 seconds
Conditions
None
Actions
Leaderboard - Create a leaderboard for (All players) titled Lives
Leaderboard - Add Player 1 (Red) to (Last created leaderboard) with label Lives and value Lives
Leaderboard - Change the color of all labels for (Last created leaderboard) to (0.00%, 100.00%, 0.00%) with 0.00% transparency
Leaderboard - Show (Last created leaderboard)

Life Lost
Events
Unit - A unit enters End Region
Conditions
(Owner of (Entering unit)) Equal to Player 12 (Brown)
Actions
Set Lives = (Lives - 1)
Unit - Remove (Entering unit) from the game Leaderboard - Change the value for Player 1 (Red) in (Last created leaderboard) to Lives
Game - Display to Lives the text: (( + ((Name of (Entering unit)) + has reached the end! )) + ((String(Lives)) + chances left))
Trigger - Run Defeat (checking conditions)

Defeat Trigger
Events
None (it is a trigger that is run by the 'Life Lost' trigger)
Conditions
Lives Less than or equal to 0
Actions
Unit Group - Pick every unit in (Units in (Playable map area) owned by Player 1 (Red)) and do (Unit - Remove (Picked unit) from the game)
Game - Defeat Player 1 (Red) with the message: Defeat!


Leaderboard made, is there anything more?

Most TD maps (atleast the decent ones) has it so you are able to sell your towers so here I will show a way it can be done.


Tower Selling
Events
Unit - A unit Begins casting an ability
Conditions
(Ability being cast) Equal to Sell Tower
Actions
Player - Add ((Point-value of (Casting unit)) / xxx) to (Owner of (Casting unit)) Current gold
Unit - Remove (Casting unit) from the game


Ability done, what's next?

Once you have succesfully made the Tower Selling ability I think you are covered in with the basic triggers, now you only need to make it so you win once last wave of units have been defeated. Good luck with your TD map! :)
 
Top