Warcraft III resources & community, 2003–2006 · archived

How To Set One Hero Allowed Only ?

10 posts
#1

How To Set One Hero Allowed Only ?

May I Ask How To Set Only Allows A Player Can Only Train One Hero??

Use Object Editor Or Trigger Editor??

Tell Me Please

P.S = Thank You
#2
object editor, food used, 1.

make it so that you have a building (or dummy unit) that provides 1 food. this is the same if you want 2 herooes max make it 2 food supplied from dummy unit. good day
#3
nonono Make the hero cost 1 wood, give player 1 wood. GG
#4
it depends if he needs wood for something else..in most custom games food isnt used for anything and thats why it is a good way of doing it
#5
But....
My Maps Unit Trained Used Food And Gold
Item Are Using Wood To Buy
Gold Can Take From Gold Mine
Wood Can Buy Also


Help Me Please
#6
Untitled Trigger 002
    Events
        Unit - A unit Finishes training a unit
    Conditions
        ((Trained unit) is A Hero) Equal to True
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                HeroCount[(Player number of (Owner of (Trained unit)))] Greater than 1
            Then - Actions
                Unit - Remove (Trained unit) from the game
                -------- Here you should refund the amount that the hero would have cost to the player. Only use these functions  --------
                -------- below if you are using WEU, otherwise delete them and replace them with the numbers of the price of the unit trained. --------
                Player - Add (Gold cost of (Trained unit-type)) to (Owner of (Trained unit)) Current gold
                Player - Add (Wood cost of (Trained unit-type)) to (Owner of (Trained unit)) Current gold
            Else - Actions
                Set HeroCount[(Player number of (Owner of (Trained unit)))] = (HeroCount[(Player number of (Owner of (Trained unit)))] + 1)
#7
As I could understand... I would do:
Add all your custom heroes to a standard hero's "Techtree - Dependency Equivalents". Then use the trigger editor and make a trigger:

Event:
Map Initialization
Condition:
Actions:
Limit training of heroes to 1 for Player X

that's all...
#8
My way was better. The End
#9
CorpseFireMy way was better. The End


Stop being so selfish. A simple way to do this is using the following function:

Player - Limit Training Of Unit-Type:
Limit training of Hero to 1 for Player.
#10
Corpse, your method sucks. It doesn't limit you to training one hero, it simply means you can only train one hero and if you try to train another it just cancels it