Unit - Disable Ability not working correctly

Status
Not open for further replies.

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
I am trying to disable the Berserk ability and then re-enable it for a specific unit.
Disabling it works, however, re-enabling it does not.

Check the picture below #6 to see an example. The first loop (disabling it) works, but the second one (re-enabling) doesn't work. I've tested it, and both loops are running fine and there isn't any possible issue outside of the action just straight up not working.

Is this a known bug? I've had issues with this in the past but I always managed to get it to work. This time I can't. Is it an issue with the Berserk ability not having a cast time (being instant)?

EDIT:

So it seems to be multiple issues. Check picture #7 for an example.

1: I can disable the ability via the loop, but re-enabling it via loop does not work.

2: If I use an ability based off Channel, I can disable with or without a loop, but I can ONLY re-enable it WITHOUT a loop. So it sort of works, I just can't rely on a loop to re-enable it.

3: The Berserk ability can't get re-enabled AT all, regardless of loop or no loop.

So I can't get Berserk to re-enable no matter what I try, however, abilities based off of Channel work but only if I manually re-enable each ability instead of using a loop.
 

Attachments

  • 6.png
    6.png
    7.8 KB · Views: 206
  • 7.png
    7.png
    30.6 KB · Views: 219
Last edited:
The Disable Ability is coded very poorly. I've run into similar problems like you.

For everytime you disable the ability, you have to enable it before it can be used again. There seems to be a hidden integer that starts at 1 and everytime you disable the ability it substracts 1, when you enable it it adds 1. The unit will be able to use the ability only if that number is 1 or more.

You could fix that by creating a boolean for each unit that you set to TRUE/FALSE whenever you Enable/Disable the ability, and run the Disable/Enable loop only on the appropriate units.

Also, what I found is that if the unit is silenced at the time you use the Disable/Enable ability, it won't do anything. I don't know about stuns, but it might be similar.
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
The Disable Ability is coded very poorly. I've run into similar problems like you.

For everytime you disable the ability, you have to enable it before it can be used again. There seems to be a hidden integer that starts at 1 and everytime you disable the ability it substracts 1, when you enable it it adds 1. The unit will be able to use the ability only if that number is 1 or more.

You could fix that by creating a boolean for each unit that you set to TRUE/FALSE whenever you Enable/Disable the ability, and run the Disable/Enable loop only on the appropriate units.

Also, what I found is that if the unit is silenced at the time you use the Disable/Enable ability, it won't do anything. I don't know about stuns, but it might be similar.
Thanks! That did the trick. All I have to do (at least for my map with the way I set it up) is enable the abilities twice, so I loop and disable each ability once, then loop and re-enable each ability twice.

Weird that silence bugs it out. I'll just have to make my own custom silence system too which shouldn't be too hard (I'll probably just disable the abilities the same way I'm doing it now)
 
Level 5
Joined
Dec 30, 2022
Messages
36
Thanks! That did the trick. All I have to do (at least for my map with the way I set it up) is enable the abilities twice, so I loop and disable each ability once, then loop and re-enable each ability twice.
Uncle, did you just put the unit-disable ablility line from your GUI screenshot twice in a row in the loop to re-enable? Or two separate loops
 
Status
Not open for further replies.
Top