Warcraft III resources & community, 2003–2006 · archived

Basics of a TD

22 posts
#1

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)

http://img48.imageshack.us/img48/8416/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.


http://img209.imageshack.us/img209/6886/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! :)
#2
If you have any improvement ideas or questions concerning this tutorial PM me either here or @ www.wc3anvil.net :)
#3
GREAT!!

Now I need to wait as I ajust my basics of map making tutorial and get it posted.
#4
Nicely laid out. Very basic, but could prove very useful to beginners.
#5
And because of that named The BASICS of a TD :wink:

It is meant as a new beginners tutorial.
#6
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.
#7
Yes the regions should be smaller, I only did them large on the screenshot to easier make it out for people how it should be placed.
#8
Awesome tutorial, I can really use this for my Star Wars TD I'm working on.

but shouldn't there be a condition in the move to region triggers, so that only the wave units go to those regions
#9
Oh, yeah, that is true, I forgot that. I guess the condition should just be that it is units owned by player xx that gets told to move.

I will edit it sometime soon. Thanks for the notice :)
#10
I tried the sell tower, spawn and move triggers, but the spawned units won't move and I can't find a good base for the sell ability.
#11
The trigger should work, I dont know why it doesent, hmm. Odd, because for me it works.

About the sell ability I dont know what you should base it on. Use any non targetable spell and jsut delete anything the spell does so it is basicly just a button which activates the trigger :P
#12
I got the sell trigger to work, now for the walking trigger...
and btw, when I copy your spawning trigger EXACLTY the same as you made it, then all those 40 units get spawned at once, not after each other.
#13
If you want them to spawn 1 after another you got to make it like this:

Spawn 1 footman
wait 1 sec
Spawn 1 footman
wait 1 sec
Spawn 1 footman
wait 1 sec
Spawn 1 footman etc etc.
#14

Where you get the leaderboard?

Where do you clik for the leaderboard?Nice layout
#15
It works now, and I even got alternative paths for other types of units.