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

[Solved] Hero Choose Taverns Hero Disable

Status
Not open for further replies.
Level 9
Joined
Dec 16, 2017
Messages
343
Hello guys, i have a hero choose system from taverns and i need to edit it to make it disable 2 more heroes when you choose
To make it clearer, in my map i have more classes from wow, each class have 3 specs,let's take for example the mage class, he has specs like fire mage,frost mage,arcane mage, and i want to make it that when a hero is choosed, to make the others 2 dissappear like they were chosed, for example i choose fire mage, and the frost and arcane mages are deleted too. How can i do that? I was thinking of something with integers and do like integer 1 = arcane, 2 = fire , 3 = frost , and so on for each character, but i can't figure out how to do it with triggers..this is what i have now that is to delete just the selected hero from tavern..
Thanks a lot and Merry Christmas to everyone arround here , bless!
  • Hero Selection
    • Events
      • Unit - A unit Sells a unit
    • Conditions
      • (Selling unit) Equal to Hero Tavern #1 0213 <gen>
    • Actions
      • Unit - Explode (Buying unit)
      • Set HeroSpawn = (Center of RegionHeroSpawn <gen>)
      • Unit - Move (Sold unit) instantly to HeroSpawn
      • Camera - Pan camera for (Owner of (Sold unit)) to HeroSpawn over 0.05 seconds
      • Selection - Select (Sold unit) for (Owner of (Sold unit))
      • Unit - Make (Sold unit) face 270.00 over 0.00 seconds
      • Special Effect - Create a special effect at Pos[60] using Abilities\Spells\Human\Resurrect\ResurrectTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Player - Make (Unit-type of (Sold unit)) Unavailable for training/construction by (Picked player)
      • Custom script: call RemoveLocation( udg_HeroSpawn)
      • Game - Display to (All players) the text: ((|c00006699 + (Name of (Owner of (Sold unit)))) + ( Has chosen:|r + (Name of (Sold unit))))
 
Level 9
Joined
Dec 16, 2017
Messages
343
I'll attach a test map, check it out.
Thanks a lot mate, it works !
I will add it in the map in a few hours and will try it at that time too,hoping it will work with more heroes,thanks a lot ! + rep

LATER EDIT:
With more heroes it doesn't work, how can i make it?
  • HeroesSpecs
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- Hero Types --------
      • Set HeroTypes[1] = Hunter BEAST MASTERY
      • Set HeroTypes[2] = Hunter MAKRSMANSHIP
      • Set HeroTypes[3] = Hunter SURVIVAL
      • Set HeroTypes[4] = Death Knight BLOOD
      • Set HeroTypes[5] = Death Knight FROST
      • Set HeroTypes[6] = Death Knight UNHOLY
      • Set HeroTypes[7] = Druid FERAL
      • Set HeroTypes[8] = Druid GUARDIAN
      • Set HeroTypes[9] = Druid RESTORATION
      • Set HeroTypes[10] = Paladin HOLY
      • Set HeroTypes[11] = Paladin PROTECTION
      • Set HeroTypes[12] = Paladin RETRIBUTION
      • Set HeroTypes[13] = Rogue ASSASSINATION
      • Set HeroTypes[14] = Rogue OUTLAW
      • Set HeroTypes[15] = Rogue SUBTLETY
      • Set HeroTypes[16] = Spellblade MAGIC
      • Set HeroTypes[17] = Warrior ARMS
      • Set HeroTypes[18] = Warrior FURY
      • Set HeroTypes[19] = Warrior PROTECTION
      • Set HeroTypes[20] = Chronomancer TIMER
      • Set HeroTypes[21] = Engineer CASTER
      • Set HeroTypes[22] = Mage ARCANE
      • Set HeroTypes[23] = Mage FIRE
      • Set HeroTypes[24] = Mage FROST
      • Set HeroTypes[25] = Priest DISCIPLINE
      • Set HeroTypes[26] = Priest HOLY
      • Set HeroTypes[27] = Priest SHADOW
      • Set HeroTypes[28] = Shaman EARTHFURY
      • Set HeroTypes[29] = Shaman ELEMENTAL
      • Set HeroTypes[30] = Shaman RESTORATION
      • Set HeroTypes[31] = Warlock AFFLICTION
      • Set HeroTypes[32] = Warlock DEMONOLOGY
      • Set HeroTypes[33] = Warlock DESTRUCTION
      • Set HeroTypes[34] = Necromancer CHAOS
      • Set HeroTypes[35] = Necromancer DARK
      • Set HeroTypes[36] = Necromancer UNHOLY
      • Set HeroTypes[37] = Demon Hunter HAVOC
      • Set HeroTypes[38] = Demon Hunter TORMENTOR
      • Set HeroTypes[39] = Demon Hunter VENGEANCE
      • -------- Hero Names --------
      • Set HeroSpecializations[1] = Hunter Beast Mastery
      • Set HeroSpecializations[2] = Hunter Marksmanship
      • Set HeroSpecializations[3] = Hunter Survival
      • Set HeroSpecializations[4] = Death Knight Blood
      • Set HeroSpecializations[5] = Death Knight Frost
      • Set HeroSpecializations[6] = Death Knight Unholy
      • Set HeroSpecializations[7] = Druid Feral
      • Set HeroSpecializations[8] = Druid Guardian
      • Set HeroSpecializations[9] = Druid Restoration
      • Set HeroSpecializations[10] = Paladin Holy
      • Set HeroSpecializations[11] = Paladin Protection
      • Set HeroSpecializations[12] = Paladin Retribution
      • Set HeroSpecializations[13] = Rogue Assassination
      • Set HeroSpecializations[14] = Rogue Outlaw
      • Set HeroSpecializations[15] = Rogue Subtlety
      • Set HeroSpecializations[16] = Spellblade Magic
      • Set HeroSpecializations[17] = Warrior Arms
      • Set HeroSpecializations[18] = Warrior Fury
      • Set HeroSpecializations[19] = Warrior Protection
      • Set HeroSpecializations[20] = Chronomancer Timer
      • Set HeroSpecializations[21] = Engineer Caster
      • Set HeroSpecializations[22] = Mage Arcane
      • Set HeroSpecializations[23] = Mage Fire
      • Set HeroSpecializations[24] = Mage Frost
      • Set HeroSpecializations[25] = Priest Discipline
      • Set HeroSpecializations[26] = Priest Holy
      • Set HeroSpecializations[27] = Priest Shadow
      • Set HeroSpecializations[28] = Shaman Earthfury
      • Set HeroSpecializations[29] = Shaman Elemental
      • Set HeroSpecializations[30] = Shaman Restoration
      • Set HeroSpecializations[31] = Warlock Affliction
      • Set HeroSpecializations[32] = Warlock Demonology
      • Set HeroSpecializations[33] = Warlock Destruction
      • Set HeroSpecializations[34] = Necromancer Chaos
      • Set HeroSpecializations[35] = Necromancer Dark
      • Set HeroSpecializations[36] = Necromancer Unholy
      • Set HeroSpecializations[37] = Demon Hunter Havoc
      • Set HeroSpecializations[38] = Demon Hunter Tormentor
      • Set HeroSpecializations[39] = Demon Hunter Vengeance
  • HeroSelection
    • Events
      • Unit - A unit Sells a unit
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 39, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Sold unit)) Equal to HeroTypes[(Integer A)]
            • Then - Actions
              • Set BuyingU = (Buying unit)
              • Set SoldU = (Sold unit)
              • Set HeroSpawn = (Center of RegionHeroSpawn <gen>)
              • Unit - Explode BuyingU
              • Unit - Move SoldU instantly to HeroSpawn
              • Camera - Pan camera for (Owner of SoldU) to HeroSpawn over 0.05 seconds
              • Selection - Select SoldU for (Owner of SoldU)
              • Unit - Make SoldU face 270.00 over 0.00 seconds
              • Special Effect - Create a special effect at (Position of SoldU) using Abilities\Spells\Human\Resurrect\ResurrectTarget.mdl
              • Special Effect - Destroy (Last created special effect)
              • For each (Integer B) from 1 to 39, do (Actions)
                • Loop - Actions
                  • Player - Make HeroTypes[(Integer B)] Unavailable for training/construction by (Owner of SoldU)
              • Game - Display to (All players) the text: ((|c00006699 + (Name of (Owner of SoldU))) + ( Has chosen:|r + HeroSpecializations[(Integer A)]))
              • Custom script: call RemoveLocation(udg_HeroSpawn)
              • Set BuyingU = No unit
              • Set SoldU = No unit
            • Else - Actions
I tried with the integers to change from 1 3 to 1 39 for A and B
I have a singleplayer mode where you get share control of the unused player slots to get hero with them..maybe i can't choose because the hero shown from tavern are only for the player and he can choose for computers based on his avaibleness for construction/training from the tavern?
If red chooses arcane mage, i want the frost mage and fire mage to can't be picked by other players or him.
 
Last edited:
Level 27
Joined
May 18, 2018
Messages
397
I tried with the integers to change from 1 3 to 1 39 for A and B
I have a singleplayer mode where you get share control of the unused player slots to get hero with them..maybe i can't choose because the hero shown from tavern are only for the player and he can choose for computers based on his avaibleness for construction/training from the tavern?
If red chooses arcane mage, i want the frost mage and fire mage to can't be picked by other players or him.

If you're in singleplayer mode, you can only choose based on your availability, so you can't choose Hero for computers with this method.

Let me understand, so if Player 1 chooses Warrior Fury, do you want to disable all 3 Warrior types for all other players and so on with the rest of the classes?
 
Level 9
Joined
Dec 16, 2017
Messages
343
If you're in singleplayer mode, you can only choose based on your availability, so you can't choose Hero for computers with this method.

Let me understand, so if Player 1 chooses Warrior Fury, do you want to disable all 3 Warrior types for all other players and so on with the rest of the classes?
yes, exactly
 
Level 27
Joined
May 18, 2018
Messages
397
Here is the updated version of the test map.

What I did was create a variable to store the names of the main classes and another variable to link each hero with its corresponding class type.

Then in the Hero Selection trigger I created a check that will disable all heroes for the player who is choosing, and will also disable heroes of the same class for all other players.
 

Attachments

  • hero selection test.w3x
    20.1 KB · Views: 35
Level 9
Joined
Dec 16, 2017
Messages
343
Here is the updated version of the test map.

What I did was create a variable to store the names of the main classes and another variable to link each hero with its corresponding class type.

Then in the Hero Selection trigger I created a check that will disable all heroes for the player who is choosing, and will also disable heroes of the same class for all other players.
Thanks a lot for this !
 
Status
Not open for further replies.
Top