• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[Trigger] Hero Selection using DIALOGS

Status
Not open for further replies.
Level 3
Joined
May 16, 2009
Messages
11
Ok, I wasnt able to find any threads on this, so I will post my way of doing it up.

Now I got this idea from a map not created by me. It wasnt open source so i made my own way.. not sure if it's the same. credits don't go to me for the idea, but they do for the triggering!

Ok, First you want to create the dialog boxes for the heros. In this map I used 3 sections, each containing 3 heros.. each section was strength, agility, and intelligence heroes.. in their respective sections.


First you need the variables for this...
You will need to create the dialog Boxes and buttons.. boxes first:
attachment.php


*Note: None are array Initial Value should be at New Dialog(Default)*

Now you need the button Variables:
attachment.php

*Note: Again, no arrays, Initial Value needs to be none! The Agility_Button; Intelligence_Button; and Strength_Buton are used for the main dialog, to select which group of heros you would like to see.*

Now that all the needed variables are created; You will set-up the dialog buttons to the proper boxes.

  • Create dialog buttons
    • Events
      • Time - Elapsed game time is 0.10 seconds
    • Conditions
    • Actions
      • Dialog - Create a dialog button for main_Hero_Selection_Dialog labelled Strength Heros
      • Set Strength_Button = (Last created dialog Button)
      • Dialog - Create a dialog button for main_Hero_Selection_Dialog labelled Agility Heros
      • Set Agility_Button = (Last created dialog Button)
      • Dialog - Create a dialog button for main_Hero_Selection_Dialog labelled Intelligence Heros
      • Set Intelligence_Button = (Last created dialog Button)
This sets the buttons for each section into the starting dialog box, and links them to the correct box. Later on we will make each box open/close accordingly, for now, we will set the hero selection buttons into the proper section boxes.

Create dialog buttons
  • Events
    • Time - Elapsed game time is 0.10 seconds
    • Conditions
    • Actions
      • Dialog - Create a dialog button for Dialog_Intellect labelled Keeper of the Grove
      • Set Keeper_Button = (Last created dialog Button)
      • Dialog - Create a dialog button for Dialog_Intellect labelled Blood Mage
      • Set BloodMage_Button = (Last created dialog Button)
      • Dialog - Create a dialog button for Dialog_Intellect labelled Back to main menu
      • Set Main_Button_INT = (Last created dialog Button)
      • Dialog - Create a dialog button for Dialog_Strength labelled Paladin
      • Set Paladin_Button = (Last created dialog Button)
      • Dialog - Create a dialog button for Dialog_Strength labelled Magtheridon
      • Set Magtheridon_Button = (Last created dialog Button)
      • Dialog - Create a dialog button for Dialog_Strength labelled Death Knight
      • Set DeathKnight_Button = (Last created dialog Button)
      • Dialog - Create a dialog button for Dialog_Strength labelled Back to main menu
      • Set Main_Button_STR = (Last created dialog Button)
      • Dialog - Create a dialog button for Dialog_Agility labelled Blademaster
      • Set Blademaster_Button = (Last created dialog Button)
      • Dialog - Create a dialog button for Dialog_Agility labelled Priestess of the Mo...
      • Set Priestest_Button = (Last created dialog Button)
      • Dialog - Create a dialog button for Dialog_Agility labelled Dark Ranger
      • Set Sylvanas_Button = (Last created dialog Button)
      • Dialog - Create a dialog button for Dialog_Agility labelled Back to main menu
      • Set Main_Button_AGI = (Last created dialog Button)
This will set each hero selection button to the proper dialog box, for example, Sylvanas is an agility based Archer, this has set the Sylvanas selection button into the Agility dialog box.
*Note: The variable names in may be whatever you want them to be.. IE Sylvanas cna change to Archer, or Ranged Agility, or Arrows, or whatever you need it to be to remember what it is, but it is best to use part of the hero type/name, incase you forget what hero you have assigned to that variable(we will do in a sec) ALSO: Both the main dialog box set-up and the rest of the dialog-box set-ups may be in one trigger, or you may seperate each one into diffrent triggers.*

Now that the buttons for all the boxes are done, we will work on the individual boxes and hero selecting.

First we shoudl do the button_clicked triggers for the main dialog box.

  • Main Agi
    • Events
      • Dialog - A dialog button is clicked for main_Hero_Selection_Dialog
    • Conditions
      • (Clicked dialog button) Equal to Agility_Button
    • Actions
      • Dialog - Hide (Clicked dialog) for (Triggering player)
      • Wait 1.00 seconds
      • Dialog - Show Dialog_Agility for (Triggering player)
      • Dialog - Change the title of Dialog_Agility to Strength Heroes
This will close the main dialog box, then open the one for Agility heroes.
*Note: The 'Wait 1.00 seconds' may be as low as 0.01 seconds. however, it is recommended you have it at least 0.05 seconds or longer, or it may bug if it gets laggy.*

You would do the same set-up for Strength and Intelligence, however, you will need to change the variables accordingly.. like this:
  • Main Str
    • Events
      • Dialog - A dialog button is clicked for main_Hero_Selection_Dialog
    • Conditions
      • (Clicked dialog button) Equal to Strength_Button
    • Actions
      • Dialog - Hide (Clicked dialog) for (Triggering player)
      • Wait 1.00 seconds
      • Dialog - Show Dialog_Strength for (Triggering player)
      • Dialog - Change the title of Dialog_Strength to Strength Heroes
This will set-up and show the strength dialog box, and close the mian, just like the Agility box before.

You will then set-up the actual hero selection, when the button to select a hero is clicked, it will hide the box and create the hero at the point you want it to:

  • Sylvanas Windrunner
    • Events
      • Dialog - A dialog button is clicked for Dialog_Agility
    • Conditions
      • (Clicked dialog button) Equal to Sylvanas_Button
    • Actions
      • Dialog - Hide (Clicked dialog) for (Triggering player)
      • Wait 1.00 seconds
      • Unit - Create 1 Sylvanas for (Triggering player) at (Center of Select <gen>) facing Default building facing degrees
This will close the box and create the hero when the Sylvanas button is clicked, you would change the variable names accordingly for each other hero as needed.

*Note: Keep in mind the EVENTS variable when changing for other heroes, if you have it set to Strength and it gives Sylvanas, their will be no way to select her, as the button will show in Agility, but do nothing, while there is no button for her in Strenght box...*

Now we will set-up a 'Return' button incase the player decides he doesnt like the selection from that section.

  • Return to main
    • Events
      • Dialog - A dialog button is clicked for Dialog_Agility
    • Conditions
      • (Clicked dialog button) Equal to Main_Button_AGI
    • Actions
      • Dialog - Hide (Clicked dialog) for (Triggering player)
      • Wait 0.50 seconds
      • Dialog - Show main_Hero_Selection_Dialog for (Triggering player)
This will allow players to click the return button and return to the first dialog box to select a attribute.
*Note: You will change the EVENTS variable from Dialog_Agility to Dialog_Strength, etc. for each box, the CONDITION variable will change aswell, however, if you make a RETURN Dialog_Button, it can stay the same if you allow it to be an array with 3.*

Now we will make a simple -repick trigger if the user wants to change heroes.

  • Events
    • Player - Player 1 (Red) types a chat message containing -repick An exact match
  • Conditions
  • Actions
    • Unit Group - Pick every unit in (Units in (Playable map area) owned by (Triggering player)) and do (Unit - Remove (Picked unit) from the game)
    • Dialog - Show main_Hero_Selection_Dialog for (Triggering player)
This will remove all units owned by the played, and open the selection box.. if it is possible for players to own non-hero units. (IE Heroes and Empires, LoaP, etc.) Try this trigger:

  • Events
    • Player - Player 1 (Red) types a chat message containing -repick An exact match
  • Conditions
  • Actions
    • Unit Group - Pick every unit in (Units owned by (Triggering player) matching (((Triggering unit) is A Hero) Equal to True)) and do (Unit - Remove (Picked unit) from the game)
      • Dialog - Show main_Hero_Selection_Dialog for (Triggering player)
By folowing this tutorial you shoudl now be able to create a hero selection system using only dialog boxes. This can save up alot of room on a map, which can be very helpful.
*Note: There is a way to display ability and attribute info before selecting a hero. All you need to do, is create another dialog box(one for each hero) set the title of it to the info you want it to show, have the button in the section category(Agility/Strength etc) go to that dialog box. Then have two buttons int he box displaying info. they will be: Return to Main/Return to Previous and Select Hero. If you wish for the triggers for this PM me or Comment this tutorial.*


All credits for these triggers go to me. however, i did get the idea from another map. The map was not open source so i don't know if the triggers are the same or not.
 

Attachments

  • Dialog Boxes.PNG
    Dialog Boxes.PNG
    3 KB · Views: 206
  • Dialog Buttons.PNG
    Dialog Buttons.PNG
    7.4 KB · Views: 142
Status
Not open for further replies.
Top