HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

The Ultimate Guide to Making a TD

02-10-2004, 10:17 PM#1
Shad0wFuRy
NOTE: I did not write this. I got this from a web site.
Since so many people seem to be wanting to make TDs and there is a ton of them on bnet, here is some basic TD stuff.

Creating A Dialog

You will need to make a couple of variables. Here are the ones we will be using for our example.

Name: EasyDiff
Type: Dialog Button
Initial Value: -None-

Name: MediumDiff
Type: Dialog Button
Initial Value: -None-

Name: HardDiff
Type: Dialog Button
Initial Value: -None-

Name: Lives
Type: Integer
Initial Value: 0

Name: DiffChooser
Type: Dialog
Initial Value: Default

Next you will need to execute a trigger to set-up the Dialog

Events
Map Initilization

Coniditions
Player Slot Status Comparison- Player 1(Red) Slot Status Equal To Is Playing
( ^ Completely Optional)

Actions
Dialog-Create Dialog Button- Create a dialog button for DiffChooser Labeled Easy
Set Variable - Set EasyDiff to (Last Created Dialog Button)
Dialog-Create Dialog Button-Create a dialog button for DiffChooser Labeled Medium
Set Variable - Set MediumDiff to (Last Created Dialog Button)
Dialog-Create Dialog Button-Create a dialog button for DiffChooser Labeled Hard
Set Variable - Set HardDiff to (Last Created Dialog Button)
Dialog-Show/Hide- Show DiffChooser for Player1(Red)

Here is how you set lives after a button is clicked. Let's say Easy is 40 lives. Use this trigger.

Events
Dialog-Dialog Button Click- A dialog button is clicked for DiffChooser

Conditions
Dialog Button Comparison- (Clicked Dialog Button) Is Equal To EasyDiff

Actions
Set Variable- Set Lives to 40
Dialog- Show/Hide- Hide DiffChooser for Player1(red)

Use that same trigger for different difficulties, substituting the number of lives corresponding to how many you wish to have for that difficulty.

Creating Units and Having Them Move

This is essential for any TD. This is how you will get your units to move. You will need to create a couple regions. Here are ours, for this example.

'Spawn1'
'Move1'
'Move2'
'Lives'

You also need to create a timer, and set it.
Correspondeing to the above trigger, a good way to do this is, after the lives are set, add

Trigger-Run (Checking Conditions) Enemy Spawn 1

Then you must create a couple variables. Here are ours for the example.

Name: LvlTimer
Type: Timer
Initial Value: -None-

Name: MonsterType
Type: Unit-Type
Initial Value: -None-

Name: MonsterAmount
Type: Integer
Initial Value: -None-

Name: LvlNumber
Type: Integer
Initial Value: 1

Now we must set our timer. Here is our basic trigger to do that. We can set a couple of actions, but I usually leave this trigger as named 'Beggening Timer' and have it run using the previous dialog triggers. This will be done as such.

Events
None

Coniditions
None

Actions
Countdown Timer- Set LvlTimer as a Repeating timer that will expire in 45.00 seconds
Game-Text Message (Explicitly Timed)- Display to (All Players) for 20.00 seconds the text: 1st level will start in 45 seconds

Now we need to actually start the levels, there are a couple of things we need to do. First we need to set all the levels. This trigger is set to 'Initially Off', which means you need to uncheck the box that says intially on. This can be done as follows. There will be no actions or conditions, as you will find out a little later in this section of our lesson, we will call on this trigger using another trigger. I will be using just fake units. anything inside the trigger in Italics is a fake name, and can be replaced with whatever you choose. Ok, here it is:

Events
None

Coniditions
None

Actions
If/Then/Else- If LvlNumber Is Equal To 1, Then Set Variable(Set MonsterType = Scouts), Else (Do Nothing)
If/Then/Else-If LvlNumber Is Equal To 1, Then Set Variable(Set MonsterAmount = 30), Else (Do Nothing)

What you then do is repeat that trigger above, replacing the LvlNumber by one each time and replacing MonsterType. MonsterAmount is fine, unless you are doing bosses or something, and wish to change it.

Before we get the units moving, we need to set move triggers.

Events
Unit-Unit Enters Region-Unit Enters Enemy Spawn 1

Conditions
Player Comparison- (Owner Of (Entering Unit) Equal To Player 12

Actions
Unit-Issue Order Targetting A Point-Order (Event Response-Entering region) to Move To (Center Of (Move 1))

Now, you need to copy + paste that trigger, and change 'Enemy Spawn 1' and 'Move 1' To 'Move 1' and 'Move 2' (Or whatever your next move is.

Next we need to show what to do after the timer runs out.

Events
Time- Timer Expires- LvlTimer expires.

Coniditions
None

Actions
Countdown Timer- Pause Timer- Pause (Event Response-Expiring Timer)
Trigger- Run (Checking Conditions)-Run Set Levels Our previous trigger where we set all the levels
Unit-Create Units Facing Angle- Create MonsterAmount MonsterType at (Center Of(Enemy Spawn 1) facing Default Building Facing Degrees
Unit Group- Pick Every Unit In Unit Group And Do Action- Pick Every Unit In (Units In (Enemy Spawn 1)) And do Unit Group- Issue Order Targetting A Point-Order (Units In (Enemy Spawn 1)) to Move To (Center Of (Move 1))
Game-Text Message (explicitly Timed)-Display to (All Players) for 20.00 seconds the message: Level 1- Scouts
Set Variable- Set LvlNumber = (Aritchmetic- LvlNumber+1)

Next we need to reset the timer.

Events
Player-Properties- Player 12's Food Used Becomes Less Than or Equal To 0.00

Conditions
None

Actions
Countdown Timer- Set LvlTimer As A Repeating Timer set to expire in 30.00 seconds.

Finally we need to set the losing a lives trigger.

Events
Unit-Unit Enters Region-A Unit Enters Lives

Conidtions
Player Comparison-Owner of (Entering Unit) Equal To Player 12

Actions
Set Variable- Set Lives = (Lives - 1)

Here is the final losing trigger.

Events
None

Coniditions
None

Actions
If/Then/Else- If (Integer Comparison-LvlNumber Equal To 0) Then (Game-Defeat-Defeat Player 1(Red) With message You lose!), Else (Do Nothing)

Copy + Paste that trigger and substitute Player 1(Red) with all your defenders.

Setting Up A Leaderboard

Ok, phew, now that we have moving triggers out of the way, lets move onto Leaderboards. Yes, those fancy leaderboards. Here is how you make them.

Events
Map Initilization

Conditions
None

Actions\
Leaderboard-Create-Creat a leaderboard for (All Players) titled Kills.
If/Then/Else- If (Player Slot Status Comparison- Player 1 (Red) Slot Status Equal To Is Playing) Then (Leaderboard- Add Player-Add Player 1(Red) to (Last Created Leaderboard) with label 'Name Of Player 1(Red)' and value of 0, Else (Do Nothing)

You need to copy + paste the 'If/Then/Else' trigger and subsitute Player 1 with player 2, Player 3, Player 4, and so on.

Here is how u add kills to your leaderboard. A bit complicated but not too hard to figure out.

You need to add a variable though.

Name: Kills
Type: Integer Array
Initial Value: 0

Events
Unit-Unit Dies- A unit owned by Player 12 dies

Conditions
Integer Comparison- Lives Is Not Equal To 0

Actions
Set Kills[Player Number Of(Owner of Killing Unit)))] = Kills[Player Number of(Oner of Killing Unit)))] + 1
Leaderboard- Change the value for (Owner of(Killing Unit)) in (Last Created Leaderboard) to Kills[Player Number Of(Owner Of(Killing Unit)))]
Leaderboard-Sort-Sort (Last Created Leaderboard) By Value In Descending Order

If a player leaves this is the trigger you need to run.

Events
Time-Periodic Event- Every 5.00 seconds of game time

Conditions
None

Actions
If/Then/Else- If (Player Slot Status Comparison Player 1(Red) Slot Status Equal To Has Left The Game), Then (Leaderboard-Change Player Label- Change the lable for Player 1(Red) in (Last Created Leaderboard) to <Quit the game> ), Else (Do Nothing)

Well there u go. enjoy!:D
02-11-2004, 03:32 AM#2
DrUnKeN_cOw
Great job man I was looking on how to do some of those you posted... thx :)
02-11-2004, 11:37 AM#3
johnfn
which website was it from? you should give credit to the author (although you did mention you didnt make it yourself)

nice tutorial by the way
02-11-2004, 02:15 PM#4
chemo
with those triggers u just have a normal td.. nothing special at all... nut its a good guide though
02-11-2004, 08:25 PM#5
AtomicDragon666
Yes, this is a good tutorial but most TD Suxxor like wintermaul and blixxels...

Yes, this is a good tutorial but most TD Suxxor like wintermaul and blixxels...
02-11-2004, 09:05 PM#6
LegolasArcher
Just what we need- a step by step guide to make a maul clone XD. Although I understand people want to be popular with there first map, its not worth making us all suffer for that.

Also, good guide- if it didnt encourage more maul like games :D :////
02-11-2004, 09:53 PM#7
Shad0wFuRy
Quote:
Originally posted by DrUnKeN_cOw
Great job man I was looking on how to do some of those you posted... thx :)

Im glad it helped:D Well i know sum people think TD's suck, but i just wanted to post it to show how to make sum triggers for one. I got it from BattleForums. The author is Darimus
02-11-2004, 10:03 PM#8
LegolasArcher
Also, TDs dont suck, certain ones do.
02-12-2004, 01:39 AM#9
Shad0wFuRy
Wintermaul TD was a good one when it first came out. now there is over 50 different kinds of mauls.
02-12-2004, 04:09 AM#10
Earth-Fury
maps like island td are awsome, because they are original. dont make another TD clone, make you own with yor own ideas
02-12-2004, 04:17 AM#11
Narwanza
I am sorry to say that a TD made with some of those trigger above will be absolutely unplayable after 20 mins. That leaks more memory than my grandma with alzheimer. I am not criticizing you Shad0wFuRy because you didn't write it, but I would encourage you to look into memory leaks and edit your first post so that we won't end up with any more leaky maps. Anyways, good stuff. Why do beginners think that TD's are easy? They have some of the most labor intensive triggers out there, and if it is going to be anything worth playing it is going to need extremely complex triggers. Right now mine is in beta testing (Please help test it, you can find a link to it in my sig) but it took me 6 mo. off and on work to get it that far. I am still working on it 2-4 hours a day trying to make it into a final version.

Good outline of how to do basics though, sorry if I sound negative, it is still good information.
02-12-2004, 03:13 PM#12
luke skywalker
Heres a better that doesnt cause memory lack at all

http://maps.worldofwar.net/tutorials?id=48

Respect D'vorjakque