Limit training of heros based off campaign heros

Leo

New Member
Reaction score
14
So I have a basic trigger that limits training of heros to 1 for all players. However, for custom heros based off of campaign heros, the limit doesn't work. I can build unlimited numbers of these.

Any idea why this is, or how how I can fix it?
 

Sirroelivan

Gunnerkrigg Court
Reaction score
95
I believe you have to add your heroes to the hero list under advanced-> gameplay constants
 

Leo

New Member
Reaction score
14
which constant is it? I thought it might be something there, and I looked through the constant list, but I didn't see one that looked like it applied. I guess I'll check again.
 

dragonhord

Knowledge is true opinion. - Plato
Reaction score
82
One way you could do it that also proves efficient for other hero coding is...
Code:
Sentinel Heroes
    Events
    Conditions
    Actions
        -------- Sentinel Heroes --------
        Set RandomTotal_Sentinel = 10
        Set Heroes_Sentinel[1] = Archmage
        Set Heroes_Sentinel[2] = Mountain King
        Set Heroes_Sentinel[3] = Crisis
        Set Heroes_Sentinel[4] = Priestess of the Moon
        Set Heroes_Sentinel[5] = Demon Hunter
        Set Heroes_Sentinel[6] = Warden
        Set Heroes_Sentinel[7] = Pandaren Brewmaster
        Set Heroes_Sentinel[8] = Pyromancer
        Set Heroes_Sentinel[9] = Naga Sea Witch
        Set Heroes_Sentinel[10] = Blood Tide
Make your unit variable array.... Then add EACH AND EVERY! hero to the variable, then make an integer variable for the last number in your array. Then make another trigger that when a player gets a hero do
Code:
For each (Integer A) from 1 to 10, do (Actions)
    Loop - Actions
        Player - Make Heroes_Sentinel[(Integer A)] Unavailable for training/construction by <Player>
 
U

ugly guy

Guest
I believe you have to add your heroes to the hero list under advanced-> gameplay constants

I've done this with another and it didn't work too.

If you want to solve it, you can trigge it:
Code:
Events - A unit Finishes training a unit
Conditions - ((Trained unit) is A Hero) Equal to True
Actions - Players - Limit training of (Unit-type of (Trained unit)) to 1 for (Owner of (Trained unit))
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
> I've done this with another and it didn't work either.

It should though.
Assuming you still have the default melee action that limits the Heroes to 1 per type.

Well, anyway, triggering works for sure.
 

Leo

New Member
Reaction score
14
Eh I already know how to do it these ways via trigger, I'd just prefer to do it via the game constants method if it works, much simpler.
 

esb

Because none of us are as cruel as all of us.
Reaction score
329
Events - A unit Finishes training a unit
Conditions - ((Trained unit) is A Hero) Equal to True
Actions - Players - Limit training of (Unit-type of (Trained unit)) to 1 for (Owner of (Trained unit))

You could just limit all heroes at map inilization. Just copy the "Players - limit training...." and change Trained unit, with the specific unit, and "to 1 for Owner of trained unit" to all.

Since it's a campaign, i don't think everyone can make every hero
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top