This part of the tutorial covers hero selection...So that would imply you have some heroes to choose from...But since you already know how to make a hero, it should be no problem. :) You can make a new hero with the same techniques as we used before. Note that you can use the same level behavior, attributes, and learn ability for them.
Hero Picking
1- Open the trigger editor. Change that variable from tutorial 1 called spawning activated to start as false instead of true. Create a new trigger called "init spawning". Create an event for it "time elapsed" set it to 30 real time seconds. For events, just use 'set variable' and set spawning active to true. Also put in a message action like before that says something like "Minions are spawning" so the players know.
2- create 2 new player groups. Name one west team and the other east team. In your melee initialization trigger, use the 'add player to player group' action to add the east and west computer players to the respective player groups. This is so we can set up alliances later. (Remember, the AI's are actually still hostile to the players at this point. We'll fix this later)
3- Create a variable called 'dialog_hero_choose' of type dialog and another dialog variable called ''dialog_team_picker'. Finally create 2 variables of type dialog item called 'hero chooser buttons' and 'team picker' buttons. Make both of them arrays. Team picker buttons should be array size 2 and hero picker buttons should be however many heroes you want to have.
4- Create a new trigger called "set up dialogs". Don't give it any events. For actions, put in 'create dialog'.. Set the type to non-modal, size 1000x1000 at the center of the screen. Now put in the action set variable, and set 'dialog_hero_chooser' to 'last created dialog' (under the functions tab). This just assigns a variable to the dialog so we can reference it later.
5- Use the action 'create dialog item (button)' next. Set the dialog to the hero picker, dimensions to 200x250 anchored to top left with offset 25,25. Set the tooltip to whatever you want. Maybe some background story, general play style of the hero, stats, etc..Whatever you want. For button text. put something like this:
The "<img path="Assets\Textures\btn-unit-protoss-darktemplar.dds"/>" makes a picture of your hero show up on the button. It just looks nicer. :) To find the image path of your units, I create a new button and then hit icon+ and then hit browse. That way you can search through the different icons and when you find one you like, replace the "btn-unit-protoss-darktemplar.dds" from mine with your image path. I've noticed the unit icons starting with btn will be the best choice.
6- Set variable 'hero buttons [1]' to last created dialog item. Now you can copy those last 2 actions for each of your hero buttons. Make sure you increase the offset values so the buttons are not on top of each other.
7- Add show/hide dialog. Set it to show the hero dialog.
8- Use the create dialog action again but create a smaller dialog in the center of the screen and set the variable 'team picker dialog' to it. Like before, create 2 buttons and assign them to 'team buttons [1] and team buttons [2]. They don't need any pictures on then, just the words "join west team" and "join east team". Also make sure they are being created for the team dialog, NOT the hero dialog We only want the hero picker dialog to show up, so use the action 'show/hide dialog' again but this time, hide the team picker dialog. (I believe they are hidden by default but it could change in a future patch..better safe than sorry)
9- Go back to melee initialization and ad the action 'run trigger'. Set it to run the trigger "set up dialogs". Make sure your hero is off the map (we put him there during part 2 for testing but no longer need him) Test your map to make sure the dialog shows up like you want it.
10- Okay...Crete a variable called 'hero choices' of type 'unit type' Make it an array. Set the size to however many players you will have. So since my game is 5 vs 5, my array size is 10. Make a new trigger called "choose hero" with the event 'dialog item used' .. Go to actions and make a if/then/else. Under the if, put a condition to check if 'used dialog item' = hero button [1]. In 'then' put in set variable. Choose hero choices. Now click on the number in the brackets [ ] <<< these things and then click function, triggering player. hit ok, then set the value to your first hero.
11- Still inside the 'then' category, use 'show/hide dialog' and hide the hero dialog. click on 'all players'. Choose 'convert player to player group' and then choose 'triggering player'. Then duplicate that show/hide action, but make it show the team selection dialog for the triggering player. This makes it so when you press the button, it saves your choice as an integer in the array. So player 1's choice is saved in Hero_choices[1]. Player 2's choice is saved under Hero_choices[2]. Get it? Now duplicate the entire if/then and change the copy to trigger when the 2nd hero button is pressed. Make that one set the hero choice to your second hero. Repeat this for as many heroes as you have.
Example for me ( I only have 2 heroes)
Team Picking
Okay. Now the players need to be able to choose their teams. So we're going to create a new trigger very similar to the previous one. First we need to make these variables:
-West Team Slots: type integer, initial value = 5 (or 6 if you are going to make a 6v6 game type)
-East Team Slots: type integer, initial value = 5 (or 6 if you are going to make a 6v6 game type)
-Player Spawn Points: type point, array of size 10 (or 12 if you have 6v6) initial value = none
Okay...Now we can continue.
12-So for your new trigger, the event should be like before: dialog item used. In the actions, your going to have the same kind of if/then setup. In the first if/then, the condition should be if used dialog item = team_selection[1] and the condition for the 2nd if/then should be if used dialog item = team_selection[2]. For each of the conditions, you'll also need to check that their is available room on the team. So check if west team spots > or + to 1. (For the 2nd button you'll want to check and make sure that the east team has at least 1 spot available).
13- In the first if/then, under 'then' you'll want to put 'add player to play group' and for the player put triggering player. The player group should whatever the team button 1 says in your dialog. For me, that would be the west team. Then add in an event to hide the dialog for triggering player. Use another set variable action and set the variable player spawn points [triggering player] to the western spawn point. (or east if button 1 was the east team button). This is so we can spawn the heroes later in the game if they die. Next add in the event create unit wit default facing. Set the unit to 'hero choices [triggering player], the owner to triggering player, and the point to 'player spawn points [triggering player]. Finally, put in the action 'set alliance for player group' and set the player group to the west team (or the east team if that was what your first button said). Add the action 'modify variable (integer)' (NOT set variable) and set the variable 'west team slots' to -1. This means it adds the player into the group for his or her team of choice, and then makes them all become allies. Again, you will need the same basic events for both button choices but changed to work for the opposite team. My example:
Well...Thats about it for this part of the tutorial. You now have the basis of a solid DOTA map. You know how to make hero attributes, levels, and abilities. You know how to let the player choose a hero and his team. You know how to make minions spawn over time. Whats left? The final (probably final) tutorial will teach you how to make heroes respawn and retrain their levels and items (items will not be covered in this series..probably). The final tutorial will also contain a few extra things to add to your map to 'spice it up', as well as some polishing up of minor details. Dont forget to rate the review by voting at the top and send me PM's or post here with any questions, comments, or tutorial advice you have.
Hmmm...I wasn't planning on it but I might if I have some free time tomorrow. In the meantime if you need to know how to do items, OneTwo SC did a video tutorial for items here.
Part 4 is done :D Well done is a loose term. You can now finish up the map. But it's not done in the fact that I'll be adding more to it as time goes on and people ask for more stuff. It will all be 'extras' stuff- stuff that you dont need but might be cool to add in to the map.
Rollback Post to RevisionRollBack
Feel free to Send me a PM if you have any questions/concerns!
Hi, somewhy I can't get past the 10th point, specifically this part: ''Go to actions and make a if/then/else. Under the if, put a condition to check if 'used dialog item' = hero button [1].''
Problem is, when I create 'used dialog item' and press 'value' to choose 'hero button [1]' it shows nothing in variables tab. I tried writing that manually, but that doesn't seem to work :( what should I do?
I hope you reply :) All in all, very amazing tut for a noob like me :) Thanks!
Oh, and in case I broke a rule for posting in an old topic - I'm very sorry, couldn't find any results by searching for my problem :(
Welcome to sc2mapster! Feel free to send me a PM if you have any questions.
As for your problem. This sounds like you mixed up your variable types.
Make sure your hero button variable is a Dialog Item . It's different from s dialog. If you have it set to dialog, then that is your problem. I'd this is not the problem, send me a PM ;)
Rollback Post to RevisionRollBack
Feel free to Send me a PM if you have any questions/concerns!
Sorry if I've missed something. But where do you assign the buttons (dialog items used) to create unit (heroes) for the specified player?
Because right now I just have an empty dialog with buttons that don't do much.
This is where I got lost :O
.6 says about saving buttons and second picture shows how they connect (also it's written in 10 11)
Yes, how they connect but not which unit that will spawn. This is written in .13 correct?
Like:
Unit - Create 1 Hero Choices [(triggering player)] etc.
All I can make is:
If:
(Used dialog item) == hero_buttons[1]
Unit - Create hero_choice[1] Legend (Chaingun) for player (triggering player) at Spawn using default facing (no options)
Is this one correct?
Because all I can do is to spawn the first hero, hero number 1, and the other 2,3 and 4 fails.
Please see attached image of choose_hero trigger and the spawn hero trigger.
well it's done wrong :p
they fire at the same time so potentially your "hero choice" stays at 0 or 1 also you typed it into amount of units.
Do it like this:
(all those) if Used dialog item = button [x] -> Set hero_choice[triggering player] = x
Under those in same trigger do dialog hide
under dialog hide do, if hero_choice[triggering player] = x -> create 1 unit of type (your hero type) and like this for each possible hero type like if 1 if 2 etc
(you don't need hero spawn trigger because it happens at same time)
i'm sorry if i don't follow this tutorial but hey, is also simple :P
as you can see (or maybe not) you could skip entire "hero_choice[triggering player]" and directly do
if used dialog item = button[1] -> create 1 unit of type (something)
if used dialog item = button[2] -> create 1 unit of type (something else)
the difference is: do you want it to spawn directly after button click or save the choice for later
Thank you for that. Now the buttons work and all. But I still have this problem:
When we are e.g two players testing it, and one of the players clicks a hero, the dialog is hidden for all players, so the other player can't choose a hero.
How do I fix this? Shouldn't there be a Hide Dialog - (Triggering player) ? Instead of (All players)
Complete Noob's Guide to DOTA-style maps [part 3]
1-Automatic Waves with lanes [http://forums.sc2mapster.com/resources/tutorials/16045-complete-noobs-guide-to-dota-style-maps-part-1/#p2]
2- Hero abilities/levels [http://forums.sc2mapster.com/resources/tutorials/16087-complete-noobs-guide-to-dota-style-maps-part-2/]
3- Hero Selection/Team Selection <<< That would be this one
4- Respawning/Polishing up [http://forums.sc2mapster.com/resources/tutorials/17011-complete-noobs-guide-to-dota-style-maps-part-4/#p2]
Quick Heads Up
This part of the tutorial covers hero selection...So that would imply you have some heroes to choose from...But since you already know how to make a hero, it should be no problem. :) You can make a new hero with the same techniques as we used before. Note that you can use the same level behavior, attributes, and learn ability for them.
Hero Picking
1- Open the trigger editor. Change that variable from tutorial 1 called spawning activated to start as false instead of true. Create a new trigger called "init spawning". Create an event for it "time elapsed" set it to 30 real time seconds. For events, just use 'set variable' and set spawning active to true. Also put in a message action like before that says something like "Minions are spawning" so the players know.
2- create 2 new player groups. Name one west team and the other east team. In your melee initialization trigger, use the 'add player to player group' action to add the east and west computer players to the respective player groups. This is so we can set up alliances later. (Remember, the AI's are actually still hostile to the players at this point. We'll fix this later)
3- Create a variable called 'dialog_hero_choose' of type dialog and another dialog variable called ''dialog_team_picker'. Finally create 2 variables of type dialog item called 'hero chooser buttons' and 'team picker' buttons. Make both of them arrays. Team picker buttons should be array size 2 and hero picker buttons should be however many heroes you want to have.
4- Create a new trigger called "set up dialogs". Don't give it any events. For actions, put in 'create dialog'.. Set the type to non-modal, size 1000x1000 at the center of the screen. Now put in the action set variable, and set 'dialog_hero_chooser' to 'last created dialog' (under the functions tab). This just assigns a variable to the dialog so we can reference it later.
5- Use the action 'create dialog item (button)' next. Set the dialog to the hero picker, dimensions to 200x250 anchored to top left with offset 25,25. Set the tooltip to whatever you want. Maybe some background story, general play style of the hero, stats, etc..Whatever you want. For button text. put something like this:
<img path="Assets\Textures\btn-unit-protoss-darktemplar.dds"/>
Hero Name Here
The "<img path="Assets\Textures\btn-unit-protoss-darktemplar.dds"/>" makes a picture of your hero show up on the button. It just looks nicer. :) To find the image path of your units, I create a new button and then hit icon+ and then hit browse. That way you can search through the different icons and when you find one you like, replace the "btn-unit-protoss-darktemplar.dds" from mine with your image path. I've noticed the unit icons starting with btn will be the best choice.
6- Set variable 'hero buttons [1]' to last created dialog item. Now you can copy those last 2 actions for each of your hero buttons. Make sure you increase the offset values so the buttons are not on top of each other.
7- Add show/hide dialog. Set it to show the hero dialog.
8- Use the create dialog action again but create a smaller dialog in the center of the screen and set the variable 'team picker dialog' to it. Like before, create 2 buttons and assign them to 'team buttons [1] and team buttons [2]. They don't need any pictures on then, just the words "join west team" and "join east team". Also make sure they are being created for the team dialog, NOT the hero dialog We only want the hero picker dialog to show up, so use the action 'show/hide dialog' again but this time, hide the team picker dialog. (I believe they are hidden by default but it could change in a future patch..better safe than sorry)
9- Go back to melee initialization and ad the action 'run trigger'. Set it to run the trigger "set up dialogs". Make sure your hero is off the map (we put him there during part 2 for testing but no longer need him) Test your map to make sure the dialog shows up like you want it.
10- Okay...Crete a variable called 'hero choices' of type 'unit type' Make it an array. Set the size to however many players you will have. So since my game is 5 vs 5, my array size is 10. Make a new trigger called "choose hero" with the event 'dialog item used' .. Go to actions and make a if/then/else. Under the if, put a condition to check if 'used dialog item' = hero button [1]. In 'then' put in set variable. Choose hero choices. Now click on the number in the brackets [ ] <<< these things and then click function, triggering player. hit ok, then set the value to your first hero.
11- Still inside the 'then' category, use 'show/hide dialog' and hide the hero dialog. click on 'all players'. Choose 'convert player to player group' and then choose 'triggering player'. Then duplicate that show/hide action, but make it show the team selection dialog for the triggering player. This makes it so when you press the button, it saves your choice as an integer in the array. So player 1's choice is saved in Hero_choices[1]. Player 2's choice is saved under Hero_choices[2]. Get it? Now duplicate the entire if/then and change the copy to trigger when the 2nd hero button is pressed. Make that one set the hero choice to your second hero. Repeat this for as many heroes as you have.
Example for me ( I only have 2 heroes)
Team Picking
Okay. Now the players need to be able to choose their teams. So we're going to create a new trigger very similar to the previous one. First we need to make these variables:
-West Team Slots: type integer, initial value = 5 (or 6 if you are going to make a 6v6 game type)
-East Team Slots: type integer, initial value = 5 (or 6 if you are going to make a 6v6 game type)
-Player Spawn Points: type point, array of size 10 (or 12 if you have 6v6) initial value = none
Okay...Now we can continue.
12-So for your new trigger, the event should be like before: dialog item used. In the actions, your going to have the same kind of if/then setup. In the first if/then, the condition should be if used dialog item = team_selection[1] and the condition for the 2nd if/then should be if used dialog item = team_selection[2]. For each of the conditions, you'll also need to check that their is available room on the team. So check if west team spots > or + to 1. (For the 2nd button you'll want to check and make sure that the east team has at least 1 spot available).
13- In the first if/then, under 'then' you'll want to put 'add player to play group' and for the player put triggering player. The player group should whatever the team button 1 says in your dialog. For me, that would be the west team. Then add in an event to hide the dialog for triggering player. Use another set variable action and set the variable player spawn points [triggering player] to the western spawn point. (or east if button 1 was the east team button). This is so we can spawn the heroes later in the game if they die. Next add in the event create unit wit default facing. Set the unit to 'hero choices [triggering player], the owner to triggering player, and the point to 'player spawn points [triggering player]. Finally, put in the action 'set alliance for player group' and set the player group to the west team (or the east team if that was what your first button said). Add the action 'modify variable (integer)' (NOT set variable) and set the variable 'west team slots' to -1. This means it adds the player into the group for his or her team of choice, and then makes them all become allies. Again, you will need the same basic events for both button choices but changed to work for the opposite team. My example:
Well...Thats about it for this part of the tutorial. You now have the basis of a solid DOTA map. You know how to make hero attributes, levels, and abilities. You know how to let the player choose a hero and his team. You know how to make minions spawn over time. Whats left? The final (probably final) tutorial will teach you how to make heroes respawn and retrain their levels and items (items will not be covered in this series..probably). The final tutorial will also contain a few extra things to add to your map to 'spice it up', as well as some polishing up of minor details. Dont forget to rate the review by voting at the top and send me PM's or post here with any questions, comments, or tutorial advice you have.
Reserved for space....
Comments questions advice, etc?
Are you going to make a tut on how to create items quick;y?
Hi, I am having trouble with choosing the texture for the button, i keep getting an error. please write in more detail, thanks
-LockonS
@StatusQ3: Go
Hmmm...I wasn't planning on it but I might if I have some free time tomorrow. In the meantime if you need to know how to do items, OneTwo SC did a video tutorial for items here.
@LockonS: Go
I sent you a PM, check your inbox. I attached my version of the map for reference.
Part 4 is done :D Well done is a loose term. You can now finish up the map. But it's not done in the fact that I'll be adding more to it as time goes on and people ask for more stuff. It will all be 'extras' stuff- stuff that you dont need but might be cool to add in to the map.
Hi, somewhy I can't get past the 10th point, specifically this part: ''Go to actions and make a if/then/else. Under the if, put a condition to check if 'used dialog item' = hero button [1].''
Problem is, when I create 'used dialog item' and press 'value' to choose 'hero button [1]' it shows nothing in variables tab. I tried writing that manually, but that doesn't seem to work :( what should I do?
I hope you reply :) All in all, very amazing tut for a noob like me :) Thanks!
Oh, and in case I broke a rule for posting in an old topic - I'm very sorry, couldn't find any results by searching for my problem :(
@Simoneon: Go
Welcome to sc2mapster! Feel free to send me a PM if you have any questions.
As for your problem. This sounds like you mixed up your variable types.
Make sure your hero button variable is a Dialog Item . It's different from s dialog. If you have it set to dialog, then that is your problem. I'd this is not the problem, send me a PM ;)
Sorry if I've missed something. But where do you assign the buttons (dialog items used) to create unit (heroes) for the specified player? Because right now I just have an empty dialog with buttons that don't do much. This is where I got lost :O
.6 says about saving buttons and second picture shows how they connect (also it's written in 10 11)
Yes, how they connect but not which unit that will spawn. This is written in .13 correct?
Like: Unit - Create 1 Hero Choices [(triggering player)] etc.
All I can make is: If: (Used dialog item) == hero_buttons[1] Unit - Create hero_choice[1] Legend (Chaingun) for player (triggering player) at Spawn using default facing (no options)
Is this one correct? Because all I can do is to spawn the first hero, hero number 1, and the other 2,3 and 4 fails.
Please see attached image of choose_hero trigger and the spawn hero trigger.
well it's done wrong :p
they fire at the same time so potentially your "hero choice" stays at 0 or 1 also you typed it into amount of units.
Do it like this:
i'm sorry if i don't follow this tutorial but hey, is also simple :P
as you can see (or maybe not) you could skip entire "hero_choice[triggering player]" and directly do
the difference is: do you want it to spawn directly after button click or save the choice for later
@Nerfpl: Go
Thank you for that. Now the buttons work and all. But I still have this problem:
When we are e.g two players testing it, and one of the players clicks a hero, the dialog is hidden for all players, so the other player can't choose a hero.
How do I fix this? Shouldn't there be a Hide Dialog - (Triggering player) ? Instead of (All players)
yes it should. You can use 'convert player to player group'