• 🏆 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] Help with Dialog and using abilities to trigger

Status
Not open for further replies.
Level 2
Joined
May 9, 2008
Messages
28
I'm on a project alone for a game, and I would like to have some help with my triggers. Ok, I have 4 planets, and you can build a Way Gate to use a ability (copy of war stomp with no damage or effects) I created to open a Dialog to choose which planet and entrance should this Way Gate go. The problem is that this system is only working for Player 1 (Red), I'm trying to make the way gate now for Player 2 (Blue). So, heres my triggers:
(It's all images)
This is all for Player 1 (Red), it works well, but I'm posting to see if it have some conflict with Player 2 (Blue) triggers.
(Hey! Sorry if it could be more simple, i'm not pro :bored:)
First of all, variables:
_________________________________________________________________
Variables.png

_________________________________________________________________

And Player 1 (Red) triggers:
_________________________________________________________________
Img1.png

_________________________________________________________________
Img2.png

_________________________________________________________________
Img3.png

_________________________________________________________________
Img4.png

_________________________________________________________________
Img5.png

_________________________________________________________________
Img6.png

_________________________________________________________________
Img7.png

_________________________________________________________________
Img8.png

_________________________________________________________________
Img9.png

_________________________________________________________________
Img10.png

_________________________________________________________________
Img11.png

_________________________________________________________________
Img12.png

_________________________________________________________________
Img13.png

_________________________________________________________________

Ok, now Player 2 (Blue), that, when he uses the abilty, the dialog opens for red (don't know why :hohum:):
_________________________________________________________________
Img14.png

_________________________________________________________________
Img15.png

_________________________________________________________________
Img16.png

_________________________________________________________________
Img17.png

_________________________________________________________________
Img18.png

_________________________________________________________________
Img19.png

_________________________________________________________________
Img20.png

_________________________________________________________________
Img21.png

_________________________________________________________________
Img22.png

_________________________________________________________________
Img23.png

_________________________________________________________________
Img24.png

_________________________________________________________________
Img25.png

_________________________________________________________________
Img26.png

_________________________________________________________________

So, I would like to know why when blue click on his ability it opens the Dialog for Player 1 (Red)? Other things with my triggers, how to make it more simple or other please tell me, would love to learn. :thumbs_up:

_________________________________________________________________
(guess I posted on the wrong section, the right would be Triggers & Scripts I guess, will someone move this?
 
Last edited:
Level 4
Joined
Apr 10, 2010
Messages
120
Did you ever get this solved? I just looked at your first picture and noticed you need higher arrays than just one for dialog-related variables. That might be your only problem :xxd: I don't know why, but dialogs are one of the few variables that actually need higher arrays in order to function correctly.
 
Level 2
Joined
May 9, 2008
Messages
28
Did you ever get this solved? I just looked at your first picture and noticed you need higher arrays than just one for dialog-related variables. That might be your only problem :xxd: I don't know why, but dialogs are one of the few variables that actually need higher arrays in order to function correctly.

I still need help with this, could anyone make some example or fix it with the map I uploaded?
 
Level 2
Joined
May 9, 2008
Messages
28
Hmm wait, what do you mean about "Create 1" :con: (sorry)

Edit1: Oh lol, how stupid I am, it's my trigger's name. Lol!

Edit2: I'm testing it with my friend, thanks!
 
Level 10
Joined
Jan 24, 2009
Messages
606
Ehm... I don't think thats the only problem with this system... I mean.. if it worked, then its strange...
Cause you use this function:
  • Dialog - Show DialogEntrance[1] for Player 1(Red)
When you should change the Player 1(Red) with this:
  • Dialog - Show DialogEntrance[1] for (Owner of Triggering Unit)
Ohh... and you should use Triggering Unit instead of Casting Unit...
 
Level 2
Joined
May 9, 2008
Messages
28
Ehm... I don't think thats the only problem with this system... I mean.. if it worked, then its strange...
Cause you use this function:
  • Dialog - Show DialogEntrance[1] for Player 1(Red)
When you should change the Player 1(Red) with this:
  • Dialog - Show DialogEntrance[1] for (Owner of Triggering Unit)
Ohh... and you should use Triggering Unit instead of Casting Unit...

Yes, but theres a dialog to each player, if I use "owner of triggering unit" guess that when two players use the ability the variables would probably collide. I'm trying it anyway, but I'm not sure. Thank you.

Edit: I tried it, also changed all the variables to be more specific and add a message saying where is the destination of Way Gate. But when I set some destination, all the messages shows up simultaneously. Theres obviously a problem in it.

(I can upload the map if needed)
 
Last edited:
Level 10
Joined
Jan 24, 2009
Messages
606
Yes please... upload the map...

Do you use an If/Then/Else function?
Like:
If:
Target Destination Equals to Bla Bla Bla
Then Do:
(Actions)
Else Do:


You can use a String Condition to check if the string is true.. Or use an Array Boolean Variable... Called Planet.
Then just check with a For Each Integer (Integer) From 1 to (Number of Planets) Do:
Then you just do the If/Then/Else functions.

But if you add the map here then I might be avable to do it for you...
 
Level 2
Joined
May 9, 2008
Messages
28
Yes, thanks you, I don't understand this: "For Each Integer (Integer) From 1 to (Number of Planets)". But after you do I'll see it and probably understand! :grin:
 

Attachments

  • 480x4801.w3x
    1.8 MB · Views: 48
Level 5
Joined
May 3, 2009
Messages
129
somthing like this ??
  • Create 1
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • And - All (Conditions) are true
        • Conditions
          • (Ability being cast) Equal to Set location [Z]
          • (Unit-type of (Triggering unit)) Equal to Way Gate
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Owner of (Casting unit)) Equal to Player 1 (Red)
        • Then - Actions
          • Set WayGateByTeam[1] = (Casting unit)
          • Dialog - Clear DialogLocation[1]
          • Dialog - Change the title of DialogLocation[1] to Set location to:
          • Dialog - Create a dialog button for DialogLocation[1] labelled Planet 1
          • Set DialogButtonsRED[1] = (Last created dialog Button)
          • Dialog - Create a dialog button for DialogLocation[1] labelled Planet 2
          • Set DialogButtonsRED[2] = (Last created dialog Button)
          • Dialog - Create a dialog button for DialogLocation[1] labelled Planet 3
          • Set DialogButtonsRED[3] = (Last created dialog Button)
          • Dialog - Create a dialog button for DialogLocation[1] labelled Planet 4
          • Set DialogButtonsRED[4] = (Last created dialog Button)
          • Dialog - Show DialogLocation[1] for Player 1 (Red)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Owner of (Casting unit)) Equal to Player 2 (Blue)
            • Then - Actions
              • Set WayGateByTeam[2] = (Casting unit)
              • Dialog - Clear DialogLocation[2]
              • Dialog - Change the title of DialogLocation[2] to Set location to:
              • Dialog - Create a dialog button for DialogLocation[2] labelled Planet 1
              • Set DialogButtonsBLUE[1] = (Last created dialog Button)
              • Dialog - Create a dialog button for DialogLocation[2] labelled Planet 2
              • Set DialogButtonsBLUE[2] = (Last created dialog Button)
              • Dialog - Create a dialog button for DialogLocation[2] labelled Planet 3
              • Set DialogButtonsBLUE[3] = (Last created dialog Button)
              • Dialog - Create a dialog button for DialogLocation[2] labelled Planet 4
              • Set DialogButtonsBLUE[4] = (Last created dialog Button)
              • Dialog - Show DialogLocation[1] for Player 2 (Blue)
            • Else - Actions
  • Planet 1
    • Events
      • Dialog - A dialog button is clicked for DialogLocation[1]
      • Dialog - A dialog button is clicked for DialogLocation[2]
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to DialogButtonsRED[1]
        • Then - Actions
          • Set plants[1] = 1
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Clicked dialog button) Equal to DialogButtonsRED[2]
            • Then - Actions
              • Set plants[1] = 2
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Clicked dialog button) Equal to DialogButtonsRED[3]
                • Then - Actions
                  • Set plants[1] = 3
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Clicked dialog button) Equal to DialogButtonsRED[4]
                    • Then - Actions
                      • Set plants[1] = 4
                    • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to DialogButtonsBLUE[1]
        • Then - Actions
          • Set plants[2] = 1
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Clicked dialog button) Equal to DialogButtonsBLUE[2]
            • Then - Actions
              • Set plants[2] = 2
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Clicked dialog button) Equal to DialogButtonsBLUE[3]
                • Then - Actions
                  • Set plants[2] = 3
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Clicked dialog button) Equal to DialogButtonsBLUE[4]
                    • Then - Actions
                      • Set plants[2] = 4
                    • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Triggering player) Equal to Player 1 (Red)
        • Then - Actions
          • Dialog - Clear DialogEntrance[1]
          • Dialog - Change the title of DialogEntrance[1] to Which entrance?
          • Dialog - Create a dialog button for DialogEntrance[1] labelled Up entrance
          • Set DialogBtnEntranceRED[1] = (Last created dialog Button)
          • Dialog - Create a dialog button for DialogEntrance[1] labelled Down entrance
          • Set DialogBtnEntranceRED[2] = (Last created dialog Button)
          • Dialog - Show DialogEntrance[1] for (Triggering player)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Triggering player) Equal to Player 2 (Blue)
            • Then - Actions
              • Dialog - Clear DialogEntrance[2]
              • Dialog - Change the title of DialogEntrance[2] to Which entrance?
              • Dialog - Create a dialog button for DialogEntrance[2] labelled Up entrance
              • Set DialogBtnEntranceBLUE[1] = (Last created dialog Button)
              • Dialog - Create a dialog button for DialogEntrance[2] labelled Down entrance
              • Set DialogBtnEntranceBLUE[2] = (Last created dialog Button)
              • Dialog - Show DialogEntrance[2] for (Triggering player)
            • Else - Actions
  • Entrance 1
    • Events
      • Dialog - A dialog button is clicked for DialogEntrance[1]
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • plants[1] Equal to 1
          • (Clicked dialog button) Equal to DialogBtnEntranceRED[1]
        • Then - Actions
          • Neutral Building - Set WayGateByTeam[1] destination to (Center of WayGate <gen>)
          • Neutral Building - Enable WayGateByTeam[1]
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • plants[1] Equal to 1
              • (Clicked dialog button) Equal to DialogBtnEntranceRED[2]
            • Then - Actions
              • Neutral Building - Set WayGateByTeam[1] destination to (Center of WayGate Copy <gen>)
              • Neutral Building - Enable WayGateByTeam[1]
            • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • plants[1] Equal to 2
          • (Clicked dialog button) Equal to DialogBtnEntranceRED[1]
        • Then - Actions
          • Neutral Building - Set WayGateByTeam[1] destination to (Center of WayGate Copy 7 <gen>)
          • Neutral Building - Enable WayGateByTeam[1]
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • plants[1] Equal to 2
              • (Clicked dialog button) Equal to DialogBtnEntranceRED[2]
            • Then - Actions
              • Neutral Building - Set WayGateByTeam[1] destination to (Center of WayGate Copy 6 <gen>)
              • Neutral Building - Enable WayGateByTeam[1]
            • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • plants[1] Equal to 3
          • (Clicked dialog button) Equal to DialogBtnEntranceRED[1]
        • Then - Actions
          • Neutral Building - Set WayGateByTeam[1] destination to (Center of WayGate Copy 2 <gen>)
          • Neutral Building - Enable WayGateByTeam[1]
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • plants[1] Equal to 3
              • (Clicked dialog button) Equal to DialogBtnEntranceRED[2]
            • Then - Actions
              • Neutral Building - Set WayGateByTeam[1] destination to (Center of WayGate Copy 3 <gen>)
              • Neutral Building - Enable WayGateByTeam[1]
            • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • plants[1] Equal to 4
          • (Clicked dialog button) Equal to DialogBtnEntranceRED[2]
        • Then - Actions
          • Neutral Building - Set WayGateByTeam[1] destination to (Center of WayGate Copy 4 <gen>)
          • Neutral Building - Enable WayGateByTeam[1]
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • plants[1] Equal to 4
              • (Clicked dialog button) Equal to DialogBtnEntranceRED[1]
            • Then - Actions
              • Neutral Building - Set WayGateByTeam[1] destination to (Center of WayGate Copy 5 <gen>)
              • Neutral Building - Enable WayGateByTeam[1]
            • Else - Actions
  • Entrance 2
    • Events
      • Dialog - A dialog button is clicked for DialogEntrance[2]
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • plants[2] Equal to 1
          • (Clicked dialog button) Equal to DialogBtnEntranceBLUE[1]
        • Then - Actions
          • Neutral Building - Set WayGateByTeam[2] destination to (Center of WayGate <gen>)
          • Neutral Building - Enable WayGateByTeam[2]
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • plants[2] Equal to 1
              • (Clicked dialog button) Equal to DialogBtnEntranceBLUE[2]
            • Then - Actions
              • Neutral Building - Set WayGateByTeam[2] destination to (Center of WayGate Copy <gen>)
              • Neutral Building - Enable WayGateByTeam[2]
            • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • plants[2] Equal to 2
          • (Clicked dialog button) Equal to DialogBtnEntranceBLUE[1]
        • Then - Actions
          • Neutral Building - Set WayGateByTeam[2] destination to (Center of WayGate Copy 7 <gen>)
          • Neutral Building - Enable WayGateByTeam[2]
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • plants[2] Equal to 2
              • (Clicked dialog button) Equal to DialogBtnEntranceBLUE[2]
            • Then - Actions
              • Neutral Building - Set WayGateByTeam[2] destination to (Center of WayGate Copy 6 <gen>)
              • Neutral Building - Enable WayGateByTeam[2]
            • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • plants[2] Equal to 3
          • (Clicked dialog button) Equal to DialogBtnEntranceBLUE[1]
        • Then - Actions
          • Neutral Building - Set WayGateByTeam[2] destination to (Center of WayGate Copy 2 <gen>)
          • Neutral Building - Enable WayGateByTeam[2]
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • plants[2] Equal to 3
              • (Clicked dialog button) Equal to DialogBtnEntranceBLUE[2]
            • Then - Actions
              • Neutral Building - Set WayGateByTeam[2] destination to (Center of WayGate Copy 3 <gen>)
              • Neutral Building - Enable WayGateByTeam[2]
            • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • plants[2] Equal to 4
          • (Clicked dialog button) Equal to DialogBtnEntranceBLUE[2]
        • Then - Actions
          • Neutral Building - Set WayGateByTeam[2] destination to (Center of WayGate Copy 4 <gen>)
          • Neutral Building - Enable WayGateByTeam[2]
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • plants[2] Equal to 4
              • (Clicked dialog button) Equal to DialogBtnEntranceBLUE[1]
            • Then - Actions
              • Neutral Building - Set WayGateByTeam[2] destination to (Center of WayGate Copy 5 <gen>)
              • Neutral Building - Enable WayGateByTeam[2]
            • Else - Actions
 
Status
Not open for further replies.
Top