[Solved] Limit Heroes to 1 per Game?

Level 21
Joined
Mar 16, 2008
Messages
955
I want to disable hero type for all players when a player begins training that hero. So there are 8 players that train up to 22 heroes from their altars (only allowed one and they cannot "-repick"). We were thinking limit the heroes to one per type. So only one player could play Paladin, for example. We won't have two of the same hero type. Does that make sense?

I was thinking make the unit-type of training unit unavailable upon event "begins training unit" (this event response "training unit" does not exist because the unit does not exist yet). I can't think of a good way to do this? Anyone have any ideas?
 
Last edited:

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
Trained Unit-Type is not in the standard Event Response list where you'd expect it, but instead in the base Function list, it's a little confusing:

1719599557547.png


At least that's how it works until the Unit actually exists, then it becomes the (Trained unit).
 
Last edited:
Level 21
Joined
Mar 16, 2008
Messages
955
This seems to work on simple LAN tests:

  • Limit Heroes Train
    • Events
      • Unit - Altar of Knights 0225 <gen> Begins training a unit
      • Unit - Altar of Knights 0226 <gen> Begins training a unit
      • Unit - Altar of Knights 0227 <gen> Begins training a unit
      • Unit - Altar of Knights 0319 <gen> Begins training a unit
      • Unit - Altar of Knights 0320 <gen> Begins training a unit
      • Unit - Altar of Knights 0326 <gen> Begins training a unit
      • Unit - Altar of Knights 0340 <gen> Begins training a unit
      • Unit - Altar of Knights 0342 <gen> Begins training a unit
      • Unit - Altar of Knights 0343 <gen> Begins training a unit
      • Unit - Altar of Knights 0341 <gen> Begins training a unit
      • Unit - Altar of Knights 0352 <gen> Begins training a unit
      • Unit - Altar of Knights 0504 <gen> Begins training a unit
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Player - Make (Trained unit-type) Unavailable for training/construction by (Picked player)
  • Limit Heroes Cancel
    • Events
      • Unit - Altar of Knights 0225 <gen> Cancels training a unit
      • Unit - Altar of Knights 0226 <gen> Cancels training a unit
      • Unit - Altar of Knights 0227 <gen> Cancels training a unit
      • Unit - Altar of Knights 0319 <gen> Cancels training a unit
      • Unit - Altar of Knights 0320 <gen> Cancels training a unit
      • Unit - Altar of Knights 0326 <gen> Cancels training a unit
      • Unit - Altar of Knights 0340 <gen> Cancels training a unit
      • Unit - Altar of Knights 0342 <gen> Cancels training a unit
      • Unit - Altar of Knights 0343 <gen> Cancels training a unit
      • Unit - Altar of Knights 0341 <gen> Cancels training a unit
      • Unit - Altar of Knights 0352 <gen> Cancels training a unit
      • Unit - Altar of Knights 0504 <gen> Cancels training a unit
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Player - Make (Trained unit-type) Available for training/construction by (Picked player)

1719610891715.png
 
Last edited:
Top