hello new to forum and i have one question that i've been looking all over for
i want to make hero units max build limit 1 per hero char (of each team) and limit 3 heroes per team player similiar to how wc3 plays out in melee
(i don't know if the limit is 3 or 4 heroes)
also i prefer data editor solution over triggers if you can
Use the "Requirements" tab in the data editor.
Create a new requirement, open the "Requirement +" field, click on "expression"
Then you can use the boxes below to generate the script (or write it yourself if you know how)
Basically do something in this direction: "CountUnit.[ID of hero].QeuedOrBetterAtPlayer == 0" (not sure if that's how it would be exactly, but something along those lines.
Then for max heroes being 3 or 4, you basically do that count unit part agai, just then you make a + instead of "== 0" and add another count unit for another hero you can have, then repeat that for each and every hero you have, put all those CountUnit into a single pair of brackets, and then add " < [Max number of heroes]" That will count each type of hero for the player giving you a number (which will of course only be 1 or 0) and add them all together, compare them to the max hero number and determine whether you can make more.
You'll have to make 1 requirement per hero though.
&& stands for "And" and "||" for "Or"
So make the requirement text i said for counting whether one of the hero type is already made, then make "&&" and then the requirement that counts all heroes.
hello new to forum and i have one question that i've been looking all over for i want to make hero units max build limit 1 per hero char (of each team) and limit 3 heroes per team player similiar to how wc3 plays out in melee (i don't know if the limit is 3 or 4 heroes) also i prefer data editor solution over triggers if you can
Use the "Requirements" tab in the data editor.
Create a new requirement, open the "Requirement +" field, click on "expression"
Then you can use the boxes below to generate the script (or write it yourself if you know how)
Basically do something in this direction: "CountUnit.[ID of hero].QeuedOrBetterAtPlayer == 0" (not sure if that's how it would be exactly, but something along those lines.
Then for max heroes being 3 or 4, you basically do that count unit part agai, just then you make a + instead of "== 0" and add another count unit for another hero you can have, then repeat that for each and every hero you have, put all those CountUnit into a single pair of brackets, and then add " < [Max number of heroes]" That will count each type of hero for the player giving you a number (which will of course only be 1 or 0) and add them all together, compare them to the max hero number and determine whether you can make more.
You'll have to make 1 requirement per hero though.
&& stands for "And" and "||" for "Or"
So make the requirement text i said for counting whether one of the hero type is already made, then make "&&" and then the requirement that counts all heroes.
Hope i wasnt too confusing.
ok i borrowed mothership example to make limit 1 but i'm not sure how to count hero unit types in math statement