chop_knife
New Member
- Reaction score
- 0
Hey!There i am going to show you how to create a simple and easy tower defense map
Trigger 1
Variables Used
Unit_Type(unit type variable)
Unit_Number(integer variable)
We used this trigger to set the number and type of the units you will be spawning for later.
Trigger 2
I will tell you why we used this trigger in the next trigger,and don't forget to set your peasant in the map
Trigger 3
Variable used here
Level_Amount (Integer variable\set the number for this variable to the number of levels you are going to make in your TD map)
Level (integer Variable)
Countdown Timer (Timer Variable)
We used trigger 2 so that when the peasant gets killed the amount of food of player2(blue) will turn zero triggering this trigger...
Trigger 4
Spawning
Variables used here
tmpPoint (point variable)
we used this trigger to spawn the units you set earlier
Trigger 5
Moving
Variable Used Here
TmpPoint (point variable)
Trigger
do this everytime a unit enters region
Trigger 6
variables used here
Lives 100
Variable Set
Leaderboard
Losing Lives...
Variables used here
Unit_Group(unit group variable)
this only happens when a unit enters a region where the the castle or anything you need to defend is.
that is all you have to do
if some of my triggers leak please notify me as early as possible so that i can provide the most accurate
Trigger 1
Variables Used
Unit_Type(unit type variable)
Unit_Number(integer variable)
Trigger:
- Events
- Map initialization
- Conditions
- Actions
- Set unit_type[1] = Footman
- Set unit_type[2] = Knight
- Set unit_type[3] = Rifleman
- Set unit_type[4] = Bandit
- Set unit_type[5] = Ghoul
- Set unit_type[6] = Timber Wolf
- Set unit_type[7] = Grunt
- -------- d --------
- Set Unit_Number[1] = 3
- Set Unit_Number[2] = 3
- Set Unit_Number[3] = 3
- Set Unit_Number[4] = 6
- Set Unit_Number[5] = 7
- Set Unit_Number[6] = 8
- Set Unit_Number[7] = 9
We used this trigger to set the number and type of the units you will be spawning for later.
Trigger 2
Trigger:
- Events
- Time - Elapsed game time is 1.00 seconds
- Conditions
- Actions
- Unit - Kill Footman 0007 <gen>
- Game - Display to (All players) the text: welcome to my game!...
I will tell you why we used this trigger in the next trigger,and don't forget to set your peasant in the map
Trigger 3
Variable used here
Level_Amount (Integer variable\set the number for this variable to the number of levels you are going to make in your TD map)
Level (integer Variable)
Countdown Timer (Timer Variable)
Trigger:
- Events
- Player - Player 2 (Blue)'s Food used becomes Equal to 0.00
- Conditions
- Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- level Equal to level_amount
- Then - Actions
- Player Group - Pick every player in (All players) and do (Actions)
- Loop - Actions
- Game - Display to (All players) for 3.00 seconds the text: <Empty String>
- Loop - Actions
- Player Group - Pick every player in (All players) and do (Actions)
- Else - Actions
- If - Conditions
- Set level = (level + 1)
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- level Equal to 1
- Then - Actions
- Countdown Timer - Start timer as a One-shot timer that will expire in 40.00 seconds
- Game - Display to (All players) the text: You will have an ex...
- Else - Actions
- Countdown Timer - Start timer as a One-shot timer that will expire in 25.00 seconds
- Game - Display to (All players) for 2.00 seconds the text: The Game will start...
- If - Conditions
- Countdown Timer - Create a timer window for timer with title Next Level...
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
We used trigger 2 so that when the peasant gets killed the amount of food of player2(blue) will turn zero triggering this trigger...
Trigger 4
Spawning
Variables used here
tmpPoint (point variable)
Trigger:
- Events
- Time - timer expires
- Conditions
- Actions
- Set Temp_Group = (All players matching ((((Matching player) controller) Equal to User) and (((Matching player) slot status) Equal to Is playing)))
- Player Group - Pick every player in Temp_Group and do (Actions)
- Loop - Actions
- Set tmpPoint = ((Picked player) start location)
- For each (Integer A) from 1 to Unit_Number[level], do (Actions)
- Loop - Actions
- Unit - Create (Integer A) unit_type[level] for Player 2 (Blue) at tmpPoint facing Default building facing degrees
- Loop - Actions
- Custom script: call RemoveLocation( udg_tmpPoint )
- Game - Display to (All players) the text: level has begun!!!
- Loop - Actions
we used this trigger to spawn the units you set earlier
Trigger 5
Moving
Variable Used Here
TmpPoint (point variable)
Trigger
Trigger:
- Events
- Unit - A unit enters Region 004 <gen>
- Conditions
- (Owner of (Entering unit)) Equal to Player 2 (Blue)
- Actions
- Set tmpPoint = (Center of Region 001 <gen>)
- Unit - Order (Entering unit) to Move To tmpPoint
- Custom script: call RemovLoaction (udg_tmpPoint)
do this everytime a unit enters region
Trigger 6
variables used here
Lives 100
Variable Set
Trigger:
- Events
- Map initialization
- Conditions
- Actions
- Set Lives = 100
Leaderboard
Trigger:
- Events
- Time - Elapsed game time is 5.00 seconds
- Conditions
- Actions
- Leaderboard - Create a leaderboard for (All players) titled <Empty String>
- Leaderboard - Add Player 2 (Blue) to (Last created leaderboard) with label Lives Left and value Lives
- Leaderboard - Show (Last created leaderboard)
Losing Lives...
Variables used here
Unit_Group(unit group variable)
Trigger:
- Events
- Unit - A unit enters Main Region <gen>
- Conditions
- (Owner of (Entering unit)) Equal to Player 2 (Blue)
- Actions
- Set unit_group = (Units in Main Region <gen> owned by Player 2 (Blue))
- Unit Group - Pick every unit in unit_group and do (Actions)
- Loop - Actions
- Unit - Remove (Picked unit) from the game
- Loop - Actions
- Leaderboard - Change the value for Player 2 (Blue) in (Last created leaderboard) to (Lives - 1)
- Set Lives = (Lives - 1)
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- Lives Equal to 0
- Then - Actions
- Set Temp_Group = (All players matching ((((Matching player) controller) Equal to User) and (((Matching player) slot status) Equal to Is playing)))
- Player Group - Pick every player in Temp_Group and do (Actions)
- Loop - Actions
- Game - Defeat (Picked player) with the message: Defeat!
- Loop - Actions
- Else - Actions
- If - Conditions
this only happens when a unit enters a region where the the castle or anything you need to defend is.
that is all you have to do
if some of my triggers leak please notify me as early as possible so that i can provide the most accurate