Hero type limit only one per whole map amongst all players

Status
Not open for further replies.
Level 3
Joined
May 7, 2020
Messages
12
Hello! In the map I am making, I want to make the map to have only 1 type of hero. Like in DOTA if one player have already chosen a hero, non of the other players can choose the same hero, and they would have to choose from what is left.
 
Level 23
Joined
Feb 27, 2019
Messages
739
Here is a very vanilla way of doing it.

Create a new unit based on Marketplace. Replace its ability Select Hero with Select Unit.
Use this action to add all your units to the Marketplace.
  • Neutral Building - Add Paladin to Marketplace 0000 <gen> with 1 in stock and a max stock of 1
Create a Wisp next to the Marketplace and do this when a hero is purchased.
  • Choose Hero
    • Events
      • Unit - Marketplace 0000 <gen> Sells a unit
    • Conditions
    • Actions
      • Neutral Building - Remove (Unit-type of (Sold unit)) from Marketplace 0000 <gen>
Its also possible to display a stock of 0, making the hero unavailable. Tech requirements should be deleted for this.
  • Neutral Building - Remove (Unit-type of (Sold unit)) from Marketplace 0000 <gen>
  • Neutral Building - Add (Unit-type of (Sold unit)) to Marketplace 0000 <gen> with -1 in stock and a max stock of -1
This action limits the amount of heroes a player can buy.
  • Player - Limit training of Heroes to 1 for Player 1 (Red)
It can be applied to all players like this.
  • Player Group - Pick every player in (All players) and do (Actions)
    • Loop - Actions
      • Player - Limit training of Heroes to 1 for (Picked player)
 
Last edited:
Level 19
Joined
Mar 16, 2008
Messages
809
also if you are using custom heroes then you need to add those custom units to the heroes list in Advanced -> Gameplay Constants.

edit: this is more of a general forum world editor help topic imo but not a huge deal.
 
Level 3
Joined
May 7, 2020
Messages
12
Here is a very vanilla way of doing it.

Create a new unit based on Marketplace. Replace its ability Select Hero with Select Unit.
Use this action to add all your units to the Marketplace.
  • Neutral Building - Add Paladin to Marketplace 0000 <gen> with 1 in stock and a max stock of 1
Create a Wisp next to the Marketplace and do this when a hero is purchased.
  • Choose Hero
    • Events
      • Unit - Marketplace 0000 <gen> Sells a unit
    • Conditions
    • Actions
      • Neutral Building - Remove (Unit-type of (Sold unit)) from Marketplace 0000 <gen>
Its also possible to display a stock of 0, making the hero unavailable. Tech requirements should be deleted for this.
  • Neutral Building - Remove (Unit-type of (Sold unit)) from Marketplace 0000 <gen>
  • Neutral Building - Add (Unit-type of (Sold unit)) to Marketplace 0000 <gen> with -1 in stock and a max stock of -1
This action limits the amount of heroes a player can buy.
  • Player - Limit training of Heroes to 1 for Player 1 (Red)
It can be applied to all players like this.
  • Player Group - Pick every player in (All players) and do (Actions)
    • Loop - Actions
      • Player - Limit training of Heroes to 1 for (Picked player)
Hello again and thanks again for reply! I tried the way you recommended, and it works kinda. But in the way of: when for example I buy a hero, all other disapper from my tavern, and other players don't have heroes to choose in tavern as well. So I am assuming that heroes are just getting removed not only for a player that have chosen a hero, but for everyone. Is there a way to make it work the way I need it?
 
Level 23
Joined
Feb 27, 2019
Messages
739
Sounds like its just the effect the action Player - Limit training of Heroes to 1 for (Picked player) has for the player since it has 1 hero all other heroes become unavailable for the player. You can disable the action by right clicking and ticking off Enable trigger to see how it would look for the other players once a player has purchased a hero. I am pretty sure thats it or did you play it with other players already?
 
Level 3
Joined
May 7, 2020
Messages
12
Sounds like its just the effect the action Player - Limit training of Heroes to 1 for (Picked player) has for the player since it has 1 hero all other heroes become unavailable for the player. You can disable the action by right clicking and ticking off Enable trigger to see how it would look for the other players once a player has purchased a hero. I am pretty sure thats it or did you play it with other players already?
Yeah, I made my friend to test this function with me, and it didn't work :(
 
Level 23
Joined
Feb 27, 2019
Messages
739
Hmm.. thats strange. I just tried it with a friend and it works fine for me. Can you post your triggers so that I can have a look? Right click the trigger name in the Trigger functions: field and Copy As Text. Use [.trigger][./trigger] without the dots to post the text in-between as a trigger.
 

Attachments

  • buy hero tavern.w3m
    18.5 KB · Views: 2
Level 3
Joined
May 7, 2020
Messages
12
Hmm.. thats strange. I just tried it with a friend and it works fine for me. Can you post your triggers so that I can have a look? Right click the trigger name in the Trigger functions: field and Copy As Text. Use [.trigger][./trigger] without the dots to post the text in-between as a trigger.
just tried copying, and because it is in another language it has "weird symbols" where there is no english, I can attach screenshots but I don't know if that helps (lol). And unfortunately your map doesn't open with my WE (i am using JSNGP) for 1.26a vers, maybe thats the issue
 
Status
Not open for further replies.
Top