• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[Trigger] 1 Hero per player.

Status
Not open for further replies.
Level 14
Joined
Oct 27, 2007
Messages
1,395
well you could just make it so that the hero is worth a certain amount of food and give the player that specific number.

or you could try something like this:
  • Heroes
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Player - Limit training of Heroes to 1 for Player 1 (Red)
I'm not entirely sure if that works, but try it.
 
Level 6
Joined
Sep 26, 2007
Messages
114
i think this might be better
  • Untitled Trigger 001
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Melee Game - Limit Heroes to 1 per Hero-type (for all players)
      • Melee Game - Give trained Heroes a Scroll of Town Portal (for all players)
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
            • Then - Actions
              • Player - Limit training of Heroes to 1 for (Picked player)
            • Else - Actions
 
Level 12
Joined
Mar 23, 2008
Messages
942
well you could just make it so that the hero is worth a certain amount of food and give the player that specific number.

I did that, but when you die you can buy another hero...

Edit1: And lol... how I didn't saw that trigger before? I was searching for it >.<

Edit2: Didn't worked, I think its because you buy a heroin the tavern, not train him...

Well, Its possible to do a loop disabling all the heroes in the game? So after you buy one you will not be able to buy another one.

Edit3: I'm trying to do a array that stores all the heroes of the game, and them do a loop that disable all of them...

Edit4: Worked!
  • For each (Integer A) from 0 to 3, do (Actions)
    • Loop - Actions
      • Player - Make AllHeroes[(Integer A)] Unavailable for training/construction by (Owner of (Entering unit))
---------------------------------------X--------------------------------

I have one doubt, If I set a array variable with size = 10. The index will be 0-9 or 0-10?
 
Last edited:
Level 12
Joined
Mar 16, 2006
Messages
992
Just remove every single other hero choice for that player after he picks his hero.

When player buys hero, remove all heros from tavern.

If you want to keep it unique, remove all heros from tavern for player, remove picked hero from tavern for everyone else.

Just saw your fourth edit. Doh!
 
Last edited:
Status
Not open for further replies.
Top