• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Custom Hero Problem (limit to 1 per type)

Status
Not open for further replies.
Level 15
Joined
Jan 12, 2011
Messages
1,197
Hi guys,
Can anyone help me? I am amking custom heroes in my map, and when i play it, i see that the custom heroes can be repicked more than once, but they disappear luckily after the 3rd hero. I set the gameplay constants and the tier requirements properly, so how should i fix that?
Please help me about it. I would really appreciate that and rep+!:thumbs_up:
 

Attachments

  • Through Snow and Ice.w3x
    2.8 MB · Views: 118
Last edited:
Level 17
Joined
Feb 11, 2011
Messages
1,860
Try this:

  • Trigger
    • Events
      • Unit - A unit Sells a unit
    • Conditions
      • ((Sold unit) is A Hero) Equal to True
    • Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Player - Make (Unit-type of (Sold unit)) Unavailable for training/construction by (Picked player)
Is this what you are looking for?
 

Bannar

Code Reviewer
Level 26
Joined
Mar 19, 2008
Messages
3,140
@Mgeterno11 You have to make use of:
  • Player - Limit training of Acentis to 1 for Player (1) (Red)
For each hero type for eahc player. If you have plroblems with loop trigger, let me know.

EDIT: Sorry mckill2009 didn't know you replied. I was checking how to increase max amount of heroes too, thats why ^^
 
Level 3
Joined
Jun 1, 2021
Messages
10
  • Untitled Trigger 001
    • Events
      • Time - Elapsed game time is 1.00 seconds
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • Player - Limit training of Barbara Windstrenght to 1 for (Player((Integer A)))
and so on...
Thanks. For now, it worked
 
Level 7
Joined
Sep 4, 2016
Messages
116
I think it should also work when creating a custom hero if you keep the "melee game - limit heroes to 1 per hero type" and modify the gameplay constants to include the new custom hero. That's how I did it in my current map (at least, I'm pretty sure it's been working).

Otherwise, mckill2009's trigger is a good option.

Edit: I looked at my own map, and I stand corrected. Follow mckill2009's trigger.
 
Last edited:
Status
Not open for further replies.
Top