• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] Selecting heroes through dialogs

Status
Not open for further replies.
Level 3
Joined
Feb 6, 2009
Messages
24
Hi, I've been working on a map that utilizes dialogs to select the hero type(intelligence, strength, agility), type of attack(ranged or melee), and finally the hero.

So, to be able to do this, I made this trigger:
  • Hero Choose
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Wait 2.00 seconds
      • Dialog - Change the title of Dialog to Select your Hero ty...
      • Dialog - Create a dialog button for Dialog labelled |c006600ccIntellige...
      • Set IntelligenceH = (Last created dialog Button)
      • Dialog - Create a dialog button for Dialog labelled |c00cc0000Strength ...
      • Set StrengthH = (Last created dialog Button)
      • Dialog - Create a dialog button for Dialog labelled |c00ffcc33Agility B...
      • Set AgilityH = (Last created dialog Button)
      • Dialog - Show Dialog for Player 1 (Red)
      • Dialog - Show Dialog for Player 2 (Blue)
      • Dialog - Show Dialog for Player 3 (Teal)
      • Dialog - Show Dialog for Player 4 (Purple)
      • Dialog - Show Dialog for Player 5 (Yellow)
      • Dialog - Show Dialog for Player 6 (Orange)
      • Dialog - Show Dialog for Player 7 (Green)
      • Dialog - Show Dialog for Player 8 (Pink)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to AgilityH
        • Then - Actions
          • Dialog - Hide Dialog for (Triggering player)
          • Dialog - Show AgilityHeroes for (Triggering player)
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to StrengthH
        • Then - Actions
          • Dialog - Hide Dialog for (Triggering player)
          • Dialog - Show StrengthHeroes for (Triggering player)
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Triggering player) Equal to Player 1 (Red)
          • (Clicked dialog button) Equal to IntelligenceH
        • Then - Actions
          • Dialog - Hide Dialog for (Triggering player)
          • Dialog - Show IntelligenceHeroes for (Triggering player)
        • Else - Actions
          • Do nothing
Something, however, is going wrong, since the next dialog(the one where you choose the type of attack) is not being shown.

Thus I am here now looking for help :pgrin:
 
Level 15
Joined
Jul 9, 2008
Messages
1,552
you need 3 triggers something like

use the one you already have and then when they are clicked

  • xxxxxxxxxxxxxxxxxxxxxx
    • Events
      • Dialog - A dialog button is clicked for (your dialog)
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to agility
        • Then - Actions
  • do triggers to show next dialog
    • Else - Actions
  • rest for other atributes
  • xxxxxxxxxxxxxxxxxxxxxx
    • Events
      • Dialog - A dialog button is clicked for (your dialog)
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to hero x
        • Then - Actions
  • do triggers to create hero for player
    • Else - Actions
 
Level 3
Joined
Feb 6, 2009
Messages
24
those if then else's will need to be in their own trigger with the action a button is pressed or whatever it says lol, they cant all be in same trig.

Allrighty, I didn't know about that. Thanks for the info! :pcon:

you need 3 triggers something like

use the one you already have and then when they are clicked

  • xxxxxxxxxxxxxxxxxxxxxx
  • Events
  • Dialog - A dialog button is clicked for (your dialog)
  • Conditions
  • Actions
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
  • If - Conditions
  • (Clicked dialog button) Equal to agility
  • Then - Actions
  • do triggers to show next dialog
  • Else - Actions
  • rest for other atributes
  • xxxxxxxxxxxxxxxxxxxxxx
  • Events
  • Dialog - A dialog button is clicked for (your dialog)
  • Conditions
  • Actions
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
  • If - Conditions
  • (Clicked dialog button) Equal to hero x
  • Then - Actions
do triggers to create hero for player
Else - Actions

Thanks man! I'll try what you've said later :pgrin:

I'm pretty sure this can help you out

Great tutorial defskull, thanks for sharing it :pcon:

EDIT: I have corrected and simplified the triggers, but they still seem to not work.

Here's what I have right now:

  • Hero Choose
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Wait 2.00 seconds
      • Dialog - Clear Stats
      • Dialog - Change the title of Stats to Select your Hero ty...
      • Dialog - Create a dialog button for Stats labelled |c006600ccIntellige...
      • Set IntStrAgi[1] = (Last created dialog Button)
      • Dialog - Create a dialog button for Stats labelled |c00cc0000Strength ...
      • Set IntStrAgi[2] = (Last created dialog Button)
      • Dialog - Create a dialog button for Stats labelled |c00ff9900Agility B...
      • Set IntStrAgi[3] = (Last created dialog Button)
      • Player Group - Pick every player in (All players controlled by a User player) and do (Dialog - Show Stats for (Picked player))
That's the trigger which shows the first dialog, where players select their prefered stat.

  • Strength
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Dialog - Clear OtherD[1]
      • Dialog - Create a dialog button for OtherD[1] labelled |c00ff3333Melee Att...
      • Dialog - Create a dialog button for OtherD[1] labelled |c00339900Ranged At...
This is the trigger that creates two buttons for the dialog OtherD[1], which is where players select their prefered attack type(melee/ranged). In this case, their hero has strength as a primary atribute.

And, finaly, there is this trigger:

  • StrengthDialog
    • Events
      • Dialog - A dialog button is clicked for Stats
    • Conditions
      • (Clicked dialog button) Equal to IntStrAgi[2]
    • Actions
      • Dialog - Hide Stats for (Triggering player)
      • Dialog - Show OtherD[1] for (Triggering player)
It's suposed to hide the first dialog (Something that it really does) and to show the next dialog. Instead of that happening, the screen goes a bit blackish as if the next dialog was being shown, but it's not actualy being shown :pshock: . The mouse also disapears.

EDIT 2: I've checked the map as per defskull's suggestion. It's now fixed :) , but I think I'll change the hero selection method to something simpler.
 
Last edited:
Status
Not open for further replies.
Top