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

Pick Hero

Status
Not open for further replies.
Level 13
Joined
Oct 25, 2009
Messages
995
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.
 
Level 9
Joined
Dec 12, 2007
Messages
489
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.
 
Level 13
Joined
Oct 25, 2009
Messages
995
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)
 
Level 12
Joined
Jan 30, 2009
Messages
1,067
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.
 
Level 9
Joined
Jun 25, 2009
Messages
427
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
 
Level 10
Joined
Apr 22, 2010
Messages
421
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!
 
Status
Not open for further replies.
Top