![]() | |
| | #1 |
![]() Join Date: Oct 2007
Posts: 1,089
![]() ![]() | [Tutorial] Spawning Systems This Tutorial is for all those people who want to learn how to make a spawn system. Tutorial will be in 5 chapters
Color Code: Red = Variable Blue = Unit on the map Green = Unit type Chapter 1: Making a Timer A timer is key in most spawning maps because it tells the troops when to spawn. Below is a trigger that makes a timer that last 90 seconds, repeats, and is show to all players. Code: setting a timer
Events
Time - Elapsed game time is 5.00 seconds
Conditions
Actions
Countdown Timer - Start timer as a Repeating timer that will expire in 90.00 seconds
Countdown Timer - Create a timer window for timer with title Spawn Time
Countdown Timer - Show (Last created timer window) Code: Time - Elapsed game time is 5.00 seconds Code: Countdown Timer - Start timer as a Repeating timer that will expire in 90.00 seconds Varaible "timer" is a Timer type varaible Code: Countdown Timer - Create a timer window for timer with title Spawn Time Code: Countdown Timer - Show (Last created timer window) Chapter 2: Spawning Armys This is for when you train 1 troop many troops are made. A map example would be Rise of Empires. The trigger show is for when a troop named army is trained 9 footment and 3 rifleman are made at the owners base. Code: army spawns
Events
Unit - A unit Finishes training a unit
Conditions
(Owner of (Trained unit)) Equal to (Owner of Town Hall 0002 <gen>)
(Unit-type of (Trained unit)) Equal to Army
Actions
Set A_temp_point = (Center of Region 000 <gen>)
Unit - Create 9 Footman for (Owner of Town Hall 0002 <gen>) at A_temp_point facing Default building facing degrees
Unit - Create 3 Rifleman for (Owner of Town Hall 0002 <gen>) at A_temp_point facing Default building facing degrees
Unit - Remove (Trained unit) from the game
Custom script: call RemoveLocation (udg_A_temp_point) Code: Unit - A unit Finishes training a unit Code: (Owner of (Trained unit)) Equal to (Owner of Town Hall 0002 <gen>) Code: (Unit-type of (Trained unit)) Equal to Army Code: Set A_temp_point = (Center of Region 000 <gen>) Code: Unit - Create 9 Footman for (Owner of Town Hall 0002 <gen>) at A_temp_point facing Default building facing degrees
Unit - Create 3 Rifleman for (Owner of Town Hall 0002 <gen>) at A_temp_point facing Default building facing degrees Code: Unit - Remove (Trained unit) from the game Code: Custom script: call RemoveLocation (udg_A_temp_point) Chapter 3: Base Upgrading Spawning In this chapture it tells how to make you spawn mroe when you biuld something like a barrack and spawn less if the barrack dies. e.x. Lost kingdoms, 12 kingdoms, and most basic spawn system maps. trigger 1: add spawns Code: adding base lvl
Events
Unit - A unit owned by (Owner of Town Hall 0002 <gen>) Finishes training a unit
Conditions
(Owner of (Trained unit)) Equal to (Owner of Town Hall 0002 <gen>)
(Unit-type of (Trained unit)) Equal to Barracks
Actions
Set base_lvl = (base_lvl + 1) Code: Unit - A unit owned by (Owner of Town Hall 0002 <gen>) Finishes training a unit Code: (Owner of (Trained unit)) Equal to (Owner of Town Hall 0002 <gen>)
(Unit-type of (Trained unit)) Equal to Barracks Code: Set base_lvl = (base_lvl + 1) Varaible "base_lvl" is a intager type varaible starting at value 0 Trigger Two trigger 2:spawning troops based on lvl Code: spawning
Events
Time - timer expires
Conditions
(Owner of Town Hall 0002 <gen>) Not equal to Neutral Passive
Actions
Set A_temp_point = (Center of Region 000 <gen>)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
base_lvl Equal to 0
Then - Actions
Unit - Create 2 Footman for (Owner of Town Hall 0002 <gen>) at A_temp_point facing Default building facing degrees
Unit - Create 1 Rifleman for (Owner of Town Hall 0002 <gen>) at A_temp_point facing Default building facing degrees
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
base_lvl Equal to 1
Then - Actions
Unit - Create 7 Footman for (Owner of Town Hall 0002 <gen>) at A_temp_point facing Default building facing degrees
Unit - Create 3 Rifleman for (Owner of Town Hall 0002 <gen>) at A_temp_point facing Default building facing degrees
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
base_lvl Equal to 2
Then - Actions
Unit - Create 10 Footman for (Owner of Town Hall 0002 <gen>) at A_temp_point facing Default building facing degrees
Unit - Create 5 Rifleman for (Owner of Town Hall 0002 <gen>) at A_temp_point facing Default building facing degrees
Unit - Create 3 Knight for (Owner of Town Hall 0002 <gen>) at A_temp_point facing Default building facing degrees
Else - Actions
Custom script: call RemoveLocation (udg_A_temp_point) Code: Time - timer expires Code: (Owner of Town Hall 0002 <gen>) Not equal to Neutral Passive Code: Set A_temp_point = (Center of Region 000 <gen>) Code: base_lvl Equal to 0 Code: Unit - Create 2 Footman for (Owner of Town Hall 0002 <gen>) at A_temp_point facing Default building facing degrees
Unit - Create 1 Rifleman for (Owner of Town Hall 0002 <gen>) at A_temp_point facing Default building facing degrees Code: If - Conditions
base_lvl Equal to 1
Then - Actions
Unit - Create 7 Footman for (Owner of Town Hall 0002 <gen>) at A_temp_point facing Default building facing degrees
Unit - Create 3 Rifleman for (Owner of Town Hall 0002 <gen>) at A_temp_point facing Default building facing degrees Code: If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
base_lvl Equal to 2
Then - Actions
Unit - Create 10 Footman for (Owner of Town Hall 0002 <gen>) at A_temp_point facing Default building facing degrees
Unit - Create 5 Rifleman for (Owner of Town Hall 0002 <gen>) at A_temp_point facing Default building facing degrees
Unit - Create 3 Knight for (Owner of Town Hall 0002 <gen>) at A_temp_point facing Default building facing degrees Code: Custom script: call RemoveLocation (udg_A_temp_point) Trigger Three trigger three: lowering level when barrack is destroyed Code: lower base lvl
Events
Unit - A unit Dies
Conditions
(Unit-type of (Dying unit)) Equal to Barracks
Actions
Set base_lvl = (base_lvl - 1) Code: Unit - A unit Dies Code: (Unit-type of (Dying unit)) Equal to Barracks Code: Set base_lvl = (base_lvl - 1) Trigger Four trigger four:sets max amount of barracks Code: setting max amout of base upgrades
Events
Unit - Town Hall 0002 <gen> Changes owner
Conditions
Actions
Player - Limit training of Barracks to 2 for (Owner of Town Hall 0002 <gen>) Code: Unit - Town Hall 0002 <gen> Changes owner Code: Player - Limit training of Barracks to 2 for (Owner of Town Hall 0002 <gen>) Chapter 4: Single Troop Spawning In this Chapter it tells you how to add spawns by biulding troops like in broken alliances trigger 1: add spawns Code: adding single troops 2 spawn
Events
Unit - A unit owned by (Owner of Town Hall 0002 <gen>) Finishes training a unit
Conditions
(Owner of (Trained unit)) Equal to (Owner of Town Hall 0002 <gen>)
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Unit-type of (Trained unit)) Equal to Footman
Then - Actions
Set footmen = (footmen + 1)
Unit - Remove (Trained unit) from the game
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Unit-type of (Trained unit)) Equal to Rifleman
Then - Actions
Set rifleman = (rifleman + 1)
Unit - Remove (Trained unit) from the game
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Unit-type of (Trained unit)) Equal to Knight
Then - Actions
Set knight = (knight + 1)
Unit - Remove (Trained unit) from the game
Else - Actions Code: Unit - A unit owned by (Owner of Town Hall 0002 <gen>) Finishes training a unit Code: (Owner of (Trained unit)) Equal to (Owner of Town Hall 0002 <gen>) Code: (Unit-type of (Trained unit)) Equal to Footman Code: Set footmen = (footmen + 1) Varaible "footmen" is a intager type varaible starting at value 0 Code: Unit - Remove (Trained unit) from the game Code: If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Unit-type of (Trained unit)) Equal to Rifleman
Then - Actions
Set rifleman = (rifleman + 1)
Unit - Remove (Trained unit) from the game
Else - Actions Code: If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Unit-type of (Trained unit)) Equal to Knight
Then - Actions
Set knight = (knight + 1)
Unit - Remove (Trained unit) from the game
Else - Actions Trigger Two trigger 2:spawning the troops Code: spawning single added troops
Events
Time - timer expires
Conditions
(Owner of Town Hall 0002 <gen>) Not equal to Neutral Passive
Actions
Set A_temp_point = (Center of Region 000 <gen>)
Unit - Create footmen Footman for (Owner of Town Hall 0002 <gen>) at A_temp_point facing Default building facing degrees
Unit - Create rifleman Rifleman for (Owner of Town Hall 0002 <gen>) at A_temp_point facing Default building facing degrees
Unit - Create knight Knight for (Owner of Town Hall 0002 <gen>) at A_temp_point facing Default building facing degrees
Custom script: call RemoveLocation (udg_A_temp_point) Code: Time - timer expires Code: (Owner of Town Hall 0002 <gen>) Not equal to Neutral Passive Code: Unit - Create footmen Footman for (Owner of Town Hall 0002 <gen>) at A_temp_point facing Default building facing degrees Code: Unit - Create rifleman Rifleman for (Owner of Town Hall 0002 <gen>) at A_temp_point facing Default building facing degrees Code: Unit - Create knight Knight for (Owner of Town Hall 0002 <gen>) at A_temp_point facing Default building facing degrees Code: Custom script: call RemoveLocation (udg_A_temp_point) Chapter 5: Buying/Changing controll of a Base In this Chapter it tells you how to make a base buy-able and how to change ownership like if the base is captured. trigger 1: buying a base Code: buying a base
Events
Unit - Peasant 0001 <gen> Sells a unit
Conditions
Actions
Unit - Change ownership of Town Hall 0002 <gen> to (Owner of (Buying unit)) and Change color
Unit - Change ownership of Guard Tower 0004 <gen> to (Owner of (Buying unit)) and Change color
Unit - Change ownership of Guard Tower 0003 <gen> to (Owner of (Buying unit)) and Change color
Unit - Change ownership of Guard Tower 0005 <gen> to (Owner of (Buying unit)) and Change color
Unit - Change ownership of Guard Tower 0006 <gen> to (Owner of (Buying unit)) and Change color
Unit - Remove (Sold unit) from the game
Unit - Remove (Selling unit) from the game Code: Unit - Peasant 0001 <gen> Sells a unit Code: Unit - Change ownership of Town Hall 0002 <gen> to (Owner of (Buying unit)) and Change color
Unit - Change ownership of Guard Tower 0004 <gen> to (Owner of (Buying unit)) and Change color
Unit - Change ownership of Guard Tower 0003 <gen> to (Owner of (Buying unit)) and Change color
Unit - Change ownership of Guard Tower 0005 <gen> to (Owner of (Buying unit)) and Change color
Unit - Change ownership of Guard Tower 0006 <gen> to (Owner of (Buying unit)) and Change color Code: Unit - Remove (Sold unit) from the game
Unit - Remove (Selling unit) from the game Trigger Two trigger 2:hange base ownership when low hp Code: changing base ownership adv
Events
Unit - Town Hall 0002 <gen> Is attacked
Conditions
(Life of (Triggering unit)) Less than or equal to 500.00
Actions
Unit - Change ownership of Town Hall 0002 <gen> to (Owner of (Attacking unit)) and Change color
Unit - Set life of (Triggering unit) to 100.00%
Set footmen = 0
Set rifleman = 0
Set knight = 0 Code: Unit - Town Hall 0002 <gen> Is attacked Code: (Life of (Triggering unit)) Less than or equal to 500.00 Code: Unit - Change ownership of Town Hall 0002 <gen> to (Owner of (Attacking unit)) and Change color Code: Unit - Set life of (Triggering unit) to 100.00% Code: Set footmen = 0
Set rifleman = 0
Set knight = 0 removes all spawns added to the base Last edited by shocker; 08-18-2008 at 11:09 PM. |
| | |
| | #2 |
![]() Join Date: Oct 2007
Posts: 1,089
![]() ![]() | Re: [Tutorial] Spawning Systems ok its finaly done! |
| | |
| | #3 |
![]() Join Date: Apr 2007
Posts: 2,436
![]() ![]() ![]() | Re: [Tutorial] Spawning Systems nice tutorial on the basics of spawning |
| | |
| | #4 |
![]() Join Date: Jan 2008 Location: Los Angeles, California
Posts: 226
![]() ![]() ![]() | Re: [Tutorial] Spawning Systems hey can u guys show me how to grant control units automaticly to his allies if a player leaves?... example: player red leaves, control is given to all his allies AUTOMATICALLY i know its not a very smart question coming from me... |
| | |
| | #5 |
![]() Join Date: Oct 2007
Posts: 1,089
![]() ![]() | Re: [Tutorial] Spawning Systems jsut look in the triggers it a realy simple one to do but y are u asking here? |
| | |
| | #6 |
![]() Join Date: Jan 2008 Location: Los Angeles, California
Posts: 226
![]() ![]() ![]() | Re: [Tutorial] Spawning Systems cuz i feel like i make too many threads... I am a King ![]() I am a warrior ![]() I am a honest and fair man ![]() I am the future ![]() I am JuniorXpd |
| | |
| | #7 |
![]() Join Date: Oct 2007
Posts: 1,089
![]() ![]() | Re: [Tutorial] Spawning Systems well this is not even close 2 the right spot 2 even ask that question.... |
| | |
| | #8 |
![]() Join Date: Oct 2007
Posts: 1,089
![]() ![]() | Re: [Tutorial] Spawning Systems so how do i get the tutorial apoved? |
| | |
| | #9 |
![]() Join Date: Jul 2008 Location: Labrador City , NL , Canada
Posts: 12
![]() | Re: [Tutorial] Spawning Systems Nice tutorial. ----------------------------------------------------- ZOMG!>!@?!@! |
| | |
| | #10 |
![]() Join Date: Oct 2007
Posts: 1,089
![]() ![]() | Re: [Tutorial] Spawning Systems WOOT at lest some one thinks so! |
| | |
| | #11 |
![]() Join Date: Aug 2008
Posts: 257
![]() | Re: [Tutorial] Spawning Systems Im gunna try to make a small map using this spawning system just for fun. If it works it should get approved. Aussie Hip Hop, whilst there isnt much of it, Bliss n Eso hold us down.... So check them out. |
| | |
![]() |
| Tags |
| None |
| Thread Tools | |
| Rate This Thread | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [Tutorial] King's General Guide to (spawn-based) Map-Making. | King_Leopold | Submit a Tutorial [World Editor] | 4 | 08-10-2008 01:14 AM |
| Shockers spawning map (still needs name) | shocker | Members Projects | 4 | 02-13-2008 06:49 PM |
| [Tutorial] Map Protection/Optimization | tylord | Submit a Tutorial [World Editor] | 6 | 06-13-2007 09:24 PM |
| [TUTORIAL] Background Coloring. | state-property | Graphics and Art | 2 | 06-08-2007 02:57 PM |
| [Tutorial] Quickmask | MrOrange | Graphics and Art | 2 | 05-26-2007 05:36 PM |