I'm trying to do a Count unit for "zergling". Basically, I want the ability to be enabled when there are "0, zero" zerglings. When there are 1 or more zerglings, I want it to be greyed out. Unfortunately I found no node combinations to do it properly, it seems that constant = 0 is not really working. :( Need help thanks a lot
edit: I tried with triggers and it was a total mess. I had a damn hard time to set variables on summoned units.
A really simple way to do this would be creating a trigger that picks every unit of the zergling type every second or so and then remove the ability from the unit if the trigger doesn't pick any units. This method would be rather inefficient and may create lag.
Thanks for the reply. This part of logic was already done. I just had a hard time to set variable on unit group. But now it works wonderful thanks again.
Now I just need to find how to make cooldown works even if the ability is disabled.
Anyway to disable an ability usage without really disabling it? Disabling an ability completely freeze cooldown and will only start if ability is enabled again.
I would like the cooldown time to go even if the ability can't be used. And I don't want to show/hide the skill button.
I don't quite get your question regarding the ability, but I will take a guess...
You can force an ability to be used through script actions, and you can manipulate it's cooldown (reset it, set it to max, etc). Why do you want to be able to use an ability during it's cooldown? doesn't that defeat the purpose of the cooldown?
If I were you, I'd use the data editor for this as well. I'm not looking at the editor right now so I cant tell you exactly, but if you look at the requirement for the Carrier's Hangar ability it disables the ability if there are 8. if you just match that for the new ability and make it 1 instead of 8 it should work.
I don't quite get your question regarding the ability, but I will take a guess...
You can force an ability to be used through script actions, and you can manipulate it's cooldown (reset it, set it to max, etc). Why do you want to be able to use an ability during it's cooldown? doesn't that defeat the purpose of the cooldown?
It's just that my current triggers settings disable the ability once it is cast (IF conditions are met). And when it's disabled, the cooldown is just not working. It will just work once the ability is being enabled again. I want the ability to be ready after 10 seconds, disabled or not.
Basically the countdown only starts when the ability is enabled back again... it's not acting as an "overall" cooldown, it acts dependly of ability's stasus.
Man I don't know how to explain it lol... any way to copy/paste my damn trigger logics lol?
Alright I finally got it all working like I wanted.. had to put a wait trigger. Thanks again everyone, espcially Anthius. I could only do it with triggers, even the carrier thing couldn't do it like I wanted.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
I'm trying to do a Count unit for "zergling". Basically, I want the ability to be enabled when there are "0, zero" zerglings. When there are 1 or more zerglings, I want it to be greyed out. Unfortunately I found no node combinations to do it properly, it seems that constant = 0 is not really working. :( Need help thanks a lot
edit: I tried with triggers and it was a total mess. I had a damn hard time to set variables on summoned units.
Variable (Unit Group): myGroupOfZerglings
Actions:
NOTE: be sure to declare the myGroupOfZerglings OUTSIDE of the trigger
Ah so that's how you set multiple units?
@Wanny1: Go
Triggers would be the way to do it.
A really simple way to do this would be creating a trigger that picks every unit of the zergling type every second or so and then remove the ability from the unit if the trigger doesn't pick any units. This method would be rather inefficient and may create lag.
The variable lets you refer to the units any time you want in other triggers without knowing what and how many units will be there.
you can then do things like...
pick each unit in (unit group) and do actions
and...
Number of Units in (unit group)
So you don't have to count
Nice thanks everyone
I'm sorry, I went back and I realized I didn't answer your question completely...
You do what I have in my first post to keep track of all the units... then you need another trigger
and also
@Anthius: Go
Thanks for the reply. This part of logic was already done. I just had a hard time to set variable on unit group. But now it works wonderful thanks again.
Now I just need to find how to make cooldown works even if the ability is disabled.
Well since we're at it...
Anyway to disable an ability usage without really disabling it? Disabling an ability completely freeze cooldown and will only start if ability is enabled again.
I would like the cooldown time to go even if the ability can't be used. And I don't want to show/hide the skill button.
try look up the requirement for carriars they have simuler requirement. duo to the carriar only can build 8 units
Use
Less Than
Count unit (your unit) queued or better
Constant 1
Show
then it will show as you need something before you can train the next one, just change the tooltip to something else and you should be good to go
I don't quite get your question regarding the ability, but I will take a guess...
You can force an ability to be used through script actions, and you can manipulate it's cooldown (reset it, set it to max, etc). Why do you want to be able to use an ability during it's cooldown? doesn't that defeat the purpose of the cooldown?
@Wanny1: Go
If I were you, I'd use the data editor for this as well. I'm not looking at the editor right now so I cant tell you exactly, but if you look at the requirement for the Carrier's Hangar ability it disables the ability if there are 8. if you just match that for the new ability and make it 1 instead of 8 it should work.
@Diablito816: Go
Worth looking into. I'll check it out.
It's just that my current triggers settings disable the ability once it is cast (IF conditions are met). And when it's disabled, the cooldown is just not working. It will just work once the ability is being enabled again. I want the ability to be ready after 10 seconds, disabled or not.
Basically the countdown only starts when the ability is enabled back again... it's not acting as an "overall" cooldown, it acts dependly of ability's stasus.
Man I don't know how to explain it lol... any way to copy/paste my damn trigger logics lol?
@Wanny1: Go
Alright I finally got it all working like I wanted.. had to put a wait trigger. Thanks again everyone, espcially Anthius. I could only do it with triggers, even the carrier thing couldn't do it like I wanted.