This tutorial will ONLY be covering #1. Automatically spawning waves that go kill each other. The next parts will come in the near future.
Deep Breath...Here we go..
Fire up the galaxy editor and create a new map. Make sure to use campagin dependencies so we have access to all the new units.
1- Do the terrain first. You'll need it so you can place points and regions later on. I'm going to be using 2 lanes in my map. I'm not going to cover this part because all you really need is some sort of base for both teams and a cliff to divide the lanes.
2- Starcraft 2 supports 14 players (not including neutral and hostile). We need to use 2 of those slots for the computers, leaving 12 spots for players. This means the max number of players is 6 on each team. I'll be using only 5 per team for my relatively small map. Go to map >> Player properties.Set player's 1 through 10 to 'user controlled' and set player 11 and 12 to computers.
3- Hit Ok. Plop in some photon cannons in each base for some defense and throw in a nexus at each one also. Set their owners to players 11 and 12. Its also important to make sure you have some sort of sturdy tower/cannon in each lane to take care of any lucky computer units that survive.
Getting to the good stuff
Now we need to use the trigger editor to set up our automatic spawning. Press F6 to open the trigger editor.
4- Delete the actions in the default trigger. Add in the action "text message" and type in something like "Welcome to my awesome DOTA map. Game starts in 30 seconds". We'll add more to this trigger later. For now, right click in the left side of the editor and choose "new variable". Name it "Spawning_Active" and set it to a boolean with the default value as true. We use this to turn spawning off if we want. Most DOTA maps give the players 30 seconds or so to prepare before the spawning starts.
5- Create a new trigger called "Periodic Spawn". Create the event "periodic event" and set the time to whatever you want. Remember to choose game time so faster games aren't messed up. For conditions, press 'new condition' and hit OK. Click on the "(" symbol on the far left of the bottom part of the trigger window. Click the 'variable' button and then choose our "Spawning Active" variable. Hit ok, and then press 'value 2' (it shows up in the trigger window after you hit ok). Check off true and then hit ok. Basically what this does is every X amount of seconds, our actions will happen ONLY IF spawning active is set to true.
6- Before we continue jump back to the terrain editor, press P for points, and then create 2 points where you want the units to spawn for each side. Also create 2 points, one in the middle of each lane connecting the bases. We'll see why later.
7- Now we can go back to our trigger and add the action 'create units with default facing'. click 'unit' and set it to whatever you feel like (its got to be a ground unit or it will bypass the lanes). I picked the zealot since its a relatively weak unit. Change the player to whatever player is your "west side" player (remember map properties? We're creating these units for the computers). Then set the point to the west spawn point. You can set the number of units spawned to something like 3 if you want.
8- Add the action "issue order to unit group", click on 'unit group', press the the 'function bubble' to select it, and set the unit group to last create units. Click the "(" before 'ability command' and choose order targeting point. Then set the order to attack, and the either of the points in the middle of the lanes.
9- Copy those 2 actions and change the new issue order to unit group to send the units to the other point in the middle of the lanes. What we did is make it so it spawns a squad of units and sends them to one lane, creates a second squad, and then sends them to the bottom lane.
10- Copy all 4 of those actions. Then change the players and points in the spawning actions to work for the East side.
11- Take a quick break and test the map to make sure everything is working. The 2 sides should spawn 2 squads of units and send them out evenly in each lane. (don't forget you will need to place some observers for player 1 so you can see whats going on)
12- Make 2 large regions around each of the points in the middle of the lanes. Create a trigger called "direct lane 1 units". For event, put unit enters region, set the region to the one you just made for the first lane. Then for actions, put in the action "if then else". Under If, put in 'owner of unit = 11'. Under then, put 'issue order to unit'. set the unit to 'triggering unit', the order to attack, and the point to the enemy spawn location. Copy the entire If/then action and in the duplicate, change player 11 to 12 and switch the points.
13- Now copy that entire trigger. In the duplicate trigger, name it 'direct lane 2' and change the region in the event to your 2nd region.
Wait..What the heck did I just do
Units are ordered to attack the middle of either lane. When they get there, they are ordered to attack the enemy base. If we just ordered them to attack the base from the start, they would all use the same lane to attack.
Thats it for now!
That concludes part 1 of the tutorial. Its the simple yet very important basis for all tug of war and DOTA maps. The next tutorial will cover how to actually build your heroes with abilities and levels. Dont't forget to go rate the review at the top of the thread to let me know How I'm doing.
Annnd...If you feel like it, I have a totally un-related 5 part beginners guide to the starcraft 2 galaxy editor. Look in my signature right below this.
random fact for this tutorial- Didja know that when snakes are born with two heads, they fight each other for food....talk about sibling rivalry. Heh...sort of ....I should stop typing now....
Lol....I used to have a zealot but now I got photoshop so I made that for myself lol...
I added in a quick note about placing towers in the tutorial (I might add something later to make towers go for creeps first and extra damage to heroes or something. No matter what one side will always start to win just because of whoever randomly wins the first fight. Thats what the towers are for- to clean up any extra enemies that should be dead. :)
Anyway...The bit about heroes should be out in a few days (I have final exams to study for..In fact, I should probably be doing that instead posting on sc2mapster lol)
Hey, I've followed your tutorial and it works perfectly, just one thing. I have a siege tank above a ramp, but the AI doesn't seem smart enough to go up the ramp to attack the siege tank. They just bypass it and go straight towards the opponents CC.
I tried using pointers but this will just make the AI go up the ramp unnecessary, even when there's no units.
Is there anyway that points and regions can solve this? Making the AI go up the ramp only when there are units attacking them from the ramp
Edit: Found out how to do it. Used Damage source
But now the units just stay on the ramp and not move.