• Check out the results of the Techtree Contest #19!
  • Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

Pick Hero

Status
Not open for further replies.
Level 13
Joined
Oct 25, 2009
Messages
996
When a pick a hero,how to make the player cannot pick again another hero?
I set the trigger to:
  • Events:
  • Unit - A unit Sells a unit
  • Conditions:
  • (Selling unit) Equal to Agility Tavern - Morning 0095 <gen>
  • Actions:
  • 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)
  • Player - Set name of (Owner of (Buying unit)) to ((Name of (Owner of (Buying unit))) + ( ( + ((Proper name of (Sold unit)) + ))))
It doesn't work,i still can pick another hero.
 
I don't know, but what i see from your trigger, what it does is disable the same Hero from being bought by other players, isn't it?
then what is your trouble really? i don't really understand your problem.

if you mean that you want that each player can pick only once,

a header for you:
- Open 'Advanced' -> 'Gameplay Constants', tick the 'Use Custom Gameplay Constants'
- Look at Techtree -> Dependency Equivalent - Hero
- Remove all heroes there and add ALL your Heroes, then OK
- Open Trigger Editor, make a trigger that runs at map initialization, and add action:
  • Melee Game - Limit Heroes to 1 per Hero-type (for all players)
if you have done everything, it should works perfectly.
 
possible solution, set the food limit to 5 so that he cant pick/choose anymore hero from the tavern...

i want change the food limit into time =.=,another idea?
Gameplay Constant got help?

I don't know, but what i see from your trigger, what it does is disable the same Hero from being bought by other players, isn't it?
then what is your trouble really? i don't really understand your problem.

if you mean that you want that each player can pick only once,

a header for you:
- Open 'Advanced' -> 'Gameplay Constants', tick the 'Use Custom Gameplay Constants'
- Look at Techtree -> Dependency Equivalent - Hero
- Remove all heroes there and add ALL your Heroes, then OK
- Open Trigger Editor, make a trigger that runs at map initialization, and add action:
  • Melee Game - Limit Heroes to 1 per Hero-type (for all players)
if you have done everything, it should works perfectly.

Doesn't Work==
Melee Game - Limit Heroes to 1 per Hero-type this doesn't work,have another ideas?
I wanna simple way(if don't have simple way then advanded way==)
 
this is what I do... it stops the player from picking again and makes the hero unpickable by other players
  • Events
    • Unit - A unit sells a unit
  • Actions
    • Player - Limit training of Heroes to 0 for (Owner of Buying Unit)
    • Player Group - Pick every player in AllPlayers and do (Actions)
      • Loop - Actions
        • Player - Make (Unit-type of (Sold unit)) Unavailable for training/construction by (Picked player)
 
Can you not just remove the hero from the sell list of the tavern itself?

Or make it have a 9999999 cooldown with a max stock of 1?

That way when the hero is bought, it goes to 0 and you have to wait hours before buying another one, that's another possibility.
 
I think i can give you a solution:

  • Heroes Setting
    • Events:
      • Time - Elapsed game time is 0.01 seconds
    • Conditions:
    • Actions:
      • Set Heroes[1]=Shaman
      • Set Heroes[2]=Goblin Techies
      • Set Heroes[3]=Wind Runner
      • Set Heroes[4]=Unholy Spirit
  • Buying Heroes
    • Events:
      • Unit - A unit sells a unit
    • Conditions:
      • (Sold Unit) is a Hero equal to True
    • Actions:
      • Player Group - Pick all players in (All Players) and do (Actions):
        • Loop - Actions:
          • Player - Make (Unit-type of (Sold Unit) unavailable for constructing for (Picked Player)
      • For each Buying_Hero_Integer from 1 to 4 do (Actions):
        • Loop - Actions:
          • Player - Make (Heroes[Buying_Hero_Integer]) unavailabe for constructing for (Owner of (Buying Unit))
In the first trigger you set your heroes and using a loop you disable all of them for that player so he will no longer be able to buy more than one hero (:

Tiche3
 
heres the MOST simplest method: make a dummy unit and name it "Can only select 1 Hero"
thats is for text purposes only.
then in constants, look for the hero equvilants and remove those heros, then add you own heros.
last, if the hero techtree requirements, replace the teir 2 and 3 require to the dummy unit-"Can only select 1 Hero"

Ingame, it looks fine and this requires no triggers at all!
 
Maybe just remove the unit which buys/hires the hero once it's bought?
 
Status
Not open for further replies.
Back
Top