• 🏆 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!

Hero Selection Help

Status
Not open for further replies.
Level 6
Joined
Nov 14, 2007
Messages
155
I learned how to create a hero selection trigger via http://www.hiveworkshop.com/forums/trigger-gui-editor-tutorials-279/hero-selection-systems-38699/
And i got this trigger:

  • Hero Selection
    • Events
      • Unit - A unit Sells a unit
    • Conditions
      • And - All (Conditions) are true
        • Conditions
          • ((Sold unit) is A Hero) Equal to True
          • Or - Any (Conditions) are true
            • Conditions
              • (Selling unit) Equal to Legend Tavern 0001 <gen>
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • HeroChosenByPlayer[(Player number of (Owner of (Sold unit)))] Equal to True
        • Then - Actions
          • Unit - Remove (Sold unit) from the game
          • Game - Display to (All players) the text: (((Name of (Owner of (Sold unit))) + has chosen) + (Name of (Sold unit)))
        • Else - Actions
          • Set HeroChosenByPlayer[(Player number of (Owner of (Sold unit)))] = True
          • Unit - Move (Sold unit) instantly to (Center of Hero <gen>)
          • Camera - Pan camera for (Owner of (Sold unit)) to (Center of Hero <gen>) over 0.00 seconds
          • Selection - Clear selection for (Owner of (Sold unit))
          • Selection - Select (Sold unit) for (Owner of (Sold unit))
          • Selection - Add (Sold unit) to selection for (Owner of (Sold unit))
The thing is I need a way to spawn a hero for both forces in different places.. but when i set it to this trigger:

I renamed Hero <gen> to Alliance <gen>

  • Hero Selection Alliance
    • Events
      • Unit - A unit Sells a unit
    • Conditions
      • And - All (Conditions) are true
        • Conditions
          • ((Sold unit) is A Hero) Equal to True
          • Or - Any (Conditions) are true
            • Conditions
              • (Selling unit) Equal to Legend Tavern 0001 <gen>
              • And - All (Conditions) are true
                • Conditions
                  • (Owner of (Sold unit)) Equal to Player 2 (Blue)
                  • (Owner of (Sold unit)) Equal to Player 3 (Teal)
                  • (Owner of (Sold unit)) Equal to Player 4 (Purple)
                  • (Owner of (Sold unit)) Equal to Player 5 (Yellow)
                  • (Owner of (Sold unit)) Equal to Player 6 (Orange)
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • HeroChosenByPlayer[(Player number of (Owner of (Sold unit)))] Equal to True
          • And - All (Conditions) are true
            • Conditions
              • (Owner of (Sold unit)) Equal to Player 2 (Blue)
              • (Owner of (Sold unit)) Equal to Player 3 (Teal)
              • (Owner of (Sold unit)) Equal to Player 4 (Purple)
              • (Owner of (Sold unit)) Equal to Player 5 (Yellow)
              • (Owner of (Sold unit)) Equal to Player 6 (Orange)
        • Then - Actions
          • Unit - Remove (Sold unit) from the game
          • Game - Display to (All players) the text: (((Name of (Owner of (Sold unit))) + has chosen) + (Name of (Sold unit)))
        • Else - Actions
          • Set HeroChosenByPlayer[(Player number of (Owner of (Sold unit)))] = True
          • Unit - Move (Sold unit) instantly to (Center of Alliance <gen>)
          • Camera - Pan camera for (Owner of (Sold unit)) to (Center of Alliance <gen>) over 0.00 seconds
          • Selection - Clear selection for (Owner of (Sold unit))
          • Selection - Select (Sold unit) for (Owner of (Sold unit))
          • Selection - Add (Sold unit) to selection for (Owner of (Sold unit))
The opposing team spawns at the exact same location, in which this is their trigger:

  • Hero Selection Scourge
    • Events
      • Unit - A unit Sells a unit
    • Conditions
      • And - All (Conditions) are true
        • Conditions
          • ((Sold unit) is A Hero) Equal to True
          • Or - Any (Conditions) are true
            • Conditions
              • (Selling unit) Equal to Legend Tavern 0001 <gen>
              • And - All (Conditions) are true
                • Conditions
                  • (Owner of (Sold unit)) Equal to Player 8 (Pink)
                  • (Owner of (Sold unit)) Equal to Player 9 (Gray)
                  • (Owner of (Sold unit)) Equal to Player 10 (Light Blue)
                  • (Owner of (Sold unit)) Equal to Player 11 (Dark Green)
                  • (Owner of (Sold unit)) Equal to Player 12 (Brown)
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • HeroChosenByPlayer[(Player number of (Owner of (Sold unit)))] Equal to True
          • And - All (Conditions) are true
            • Conditions
              • (Owner of (Sold unit)) Equal to Player 8 (Pink)
              • (Owner of (Sold unit)) Equal to Player 9 (Gray)
              • (Owner of (Sold unit)) Equal to Player 10 (Light Blue)
              • (Owner of (Sold unit)) Equal to Player 11 (Dark Green)
              • (Owner of (Sold unit)) Equal to Player 12 (Brown)
        • Then - Actions
          • Unit - Remove (Sold unit) from the game
          • Game - Display to (All players) the text: (((Name of (Owner of (Sold unit))) + has chosen) + (Name of (Sold unit)))
        • Else - Actions
          • Set HeroChosenByPlayer[(Player number of (Owner of (Sold unit)))] = True
          • Unit - Move (Sold unit) instantly to (Center of Scourge <gen>)
          • Camera - Pan camera for (Owner of (Sold unit)) to (Center of Scourge <gen>) over 0.00 seconds
          • Selection - Clear selection for (Owner of (Sold unit))
          • Selection - Select (Sold unit) for (Owner of (Sold unit))
          • Selection - Add (Sold unit) to selection for (Owner of (Sold unit))
Can anyone help please? is it a bug?
whenever i choose a hero it always go on the opposite team's base

+REP to those who can HELP
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
Your AND/OR thingies are messed up.

Example:

  • And - All (Conditions) are true
    • Conditions
      • (Owner of (Sold unit)) Equal to Player 2 (Blue)
      • (Owner of (Sold unit)) Equal to Player 3 (Teal)
^This can never return true. Unit can't be owned by player 2 and player 3 at the same time. You need to use OR there.

And in conditions where you use AND and OR, change OR -> AND and AND -> OR. I think it will work then.
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
I'm not sure what you're trying to to with the initial condition, Sold unit is a hero and it's sold from that tavern, and it belongs to player 2, 3, 4,5 or 6?

  • Hero Selection Alliance
    • Events
      • Unit - A unit Sells a unit
    • Conditions
      • ((Sold unit) is A Hero) Equal to True
      • (Selling unit) Equal to Legend Tavern 0001 <gen>
      • Or - Any (Conditions) are true
        • Conditions
          • (Owner of (Sold unit)) Equal to Player 2 (Blue)
          • (Owner of (Sold unit)) Equal to Player 3 (Teal)
          • (Owner of (Sold unit)) Equal to Player 4 (Purple)
          • (Owner of (Sold unit)) Equal to Player 5 (Yellow)
          • (Owner of (Sold unit)) Equal to Player 6 (Orange)
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • HeroChosenByPlayer[(Player number of (Owner of (Sold unit)))] Equal to True
          • Or - Any (Conditions) are true
            • Conditions
              • (Owner of (Sold unit)) Equal to Player 2 (Blue)
              • (Owner of (Sold unit)) Equal to Player 3 (Teal)
              • (Owner of (Sold unit)) Equal to Player 4 (Purple)
              • (Owner of (Sold unit)) Equal to Player 5 (Yellow)
              • (Owner of (Sold unit)) Equal to Player 6 (Orange)
        • Then - Actions
          • ...
 
Status
Not open for further replies.
Top