- Joined
- May 1, 2008
- Messages
- 27
Most often than not you will use:
Now before we begin, I expect you to know GUI/Trigger basics, and understand how to clean common leaks. I only use Unit Groups in this, so if you know how to clean those that's great (I do it myself in this tutorial), but it's better if you go learn how to if you don't.
Say you wanted something like "No UNIT" to "appear" in that unit's Requirements, and it to be greyed out instead. This looks a lot more refined, and at least now, the player knows why they can't create that unit anymore.
Create the unit itself you're going to add a limit to, then create a copy of that unit (preferably add "(At limit)" or something to that effect in the copy's Editor Suffix). In the Requirements of the copy, add another unit called "No UNIT" or "Less than # UNIT" (Depends on how many you want it limited to). It doesn't matter what you use, as long as it is called "No UNIT" or "Less than # UNIT".
Then follow these triggers:
You can set the maximum amount by changing what UNIT_Limit[] is set to. Also rename that to whatever your unit is called.
Also, these triggers work with both units and structures.
PS: Some of you may be wondering "Why is there a second if statement in the OnOff trigger? Why not just put it in the "Else" of the first? Similarly, why is that "Wait" there?
I tried that. It worked at first, then out of nowhere stopped working. For some reason it would never register anymore that the unit was actually "dead" the "instant" it was dead. So I added a wait, then a second if statement.
Regardless it still works as desired.
Also, if any trigger novices would like me to make an example map, I will.
-
Melee Initialization
-
Events
-
Map initialization
-
-
Conditions
-
Actions
-
For each (Integer A) from 1 to 12, do (Actions)
-
Loop - Actions
-
Player - Limit training of UNIT to # for (Player((Integer A)))
-
-
-
-
Now before we begin, I expect you to know GUI/Trigger basics, and understand how to clean common leaks. I only use Unit Groups in this, so if you know how to clean those that's great (I do it myself in this tutorial), but it's better if you go learn how to if you don't.
Say you wanted something like "No UNIT" to "appear" in that unit's Requirements, and it to be greyed out instead. This looks a lot more refined, and at least now, the player knows why they can't create that unit anymore.
Create the unit itself you're going to add a limit to, then create a copy of that unit (preferably add "(At limit)" or something to that effect in the copy's Editor Suffix). In the Requirements of the copy, add another unit called "No UNIT" or "Less than # UNIT" (Depends on how many you want it limited to). It doesn't matter what you use, as long as it is called "No UNIT" or "Less than # UNIT".
Then follow these triggers:
|
|
You can set the maximum amount by changing what UNIT_Limit[] is set to. Also rename that to whatever your unit is called.
Also, these triggers work with both units and structures.
PS: Some of you may be wondering "Why is there a second if statement in the OnOff trigger? Why not just put it in the "Else" of the first? Similarly, why is that "Wait" there?
I tried that. It worked at first, then out of nowhere stopped working. For some reason it would never register anymore that the unit was actually "dead" the "instant" it was dead. So I added a wait, then a second if statement.
Regardless it still works as desired.
Also, if any trigger novices would like me to make an example map, I will.
Last edited: