Is it possible to remove and / or activate the cooldown of the ability of an item ?
I have tried to remove the cooldown of the item considering it like the unit whom to remove the CD but it doesn't work.
Actually if there is a way to detect and prevent the use of an item, or to detect and prevent the use of the ability of an item, it could do the job too. But my tries have lead me nowhere.
Hm this inventory system seems harder and longer to fix than to build a custom one -.-
I think that I can't use your solution, I am trying to prevent the use of an item in some areas. And so I can't know if the target is in this area only when the item is already used to get the target point.
To reset the cooldown of an item, I can quite "easily" delete the item then create a new one instead, but to activate the cooldown, I think that I can't as the ability of the item has a target point ?
there is a trigger action to set the "cooldown of an ability for unit". the the cooldown link location is set to unit it should work.
btw you can validate the target point, there is a validator for that, you can either place dummy units and use an anum area validator etc. endless possibilities.
You can do this by altering the stats if the ability with a Catalog Field Value Set action. This will change the cooldown for the ability for the player. If you wan't to increase it only once/add aditional cooldown, you can use the Add Cooldown For Unit Ability which will have you choose a cooldown ID (set in the Info+ Cost field of the ability), the Ability and the taget unit.
Disable the ability for the unit temporarily:
You can either do this with a trigger, with the Enable/Disable Ability For Unit or use a Requirement which requires an upgrade (just create an upgrade which does nothing -> set the requirement for the Ability to that -> have a trigger use the Set Upgrade Level For Player and set it to either 1 (the requirement will return true) or 0 (the requirement will return false).
Thanks Demtrod, but it is the ability of an item.
So if I did nothing wrong during my tests, the ability of the item doesn't trigger the event "ability used" in a trigger. So I can't stop it before to be fully done. If I use the event "item used", the ability is fully done and can't be stopped.
So I tried to use a dummy ability, then test if I should allow the real ability (so start the real ability) if it doesn't target a certain area. But then I have troubles with the cooldown of the item, which is triggered during the dummy ability. According to my test, I can't reset the cooldown of an item : I tried to rest it indicating the item itself as an unit or the unit bearing it, without any success.
FunkyUserName, thanks for your solution. I guess that it is the only way to do it. I miss the lack of terrain texture, buildable, and several other validator possibilities. But I have to admit that there is already a big list in the validators types. Annoying to have to go with such an inelegant and unaccurate solution...
I want to prevent the use of an item if it targets a certain area of the map.
But I think that FunkyUserName has given me the only way to do it : putting dummy units, and checking the number of dummy units close in a validator. Which is bad because unaccurate mainly, but it does the job ^^
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Hello,
Is it possible to remove and / or activate the cooldown of the ability of an item ?
I have tried to remove the cooldown of the item considering it like the unit whom to remove the CD but it doesn't work.
Actually if there is a way to detect and prevent the use of an item, or to detect and prevent the use of the ability of an item, it could do the job too. But my tries have lead me nowhere.
https://www.sc2mapster.com/forums/development/data/128471-disable-the-use-of-items-in-certain-slot/
for the cooldown, i think if cd location is set to "unit" instead of ability it will work with trigger actions to set cd.
Hm this inventory system seems harder and longer to fix than to build a custom one -.-
I think that I can't use your solution, I am trying to prevent the use of an item in some areas. And so I can't know if the target is in this area only when the item is already used to get the target point.
To reset the cooldown of an item, I can quite "easily" delete the item then create a new one instead, but to activate the cooldown, I think that I can't as the ability of the item has a target point ?
there is a trigger action to set the "cooldown of an ability for unit". the the cooldown link location is set to unit it should work. btw you can validate the target point, there is a validator for that, you can either place dummy units and use an anum area validator etc. endless possibilities.
I'm not sure what you want, but if it's:
Increase the cooldown for an ability:
You can do this by altering the stats if the ability with a Catalog Field Value Set action. This will change the cooldown for the ability for the player. If you wan't to increase it only once/add aditional cooldown, you can use the Add Cooldown For Unit Ability which will have you choose a cooldown ID (set in the Info+ Cost field of the ability), the Ability and the taget unit.
Disable the ability for the unit temporarily:
You can either do this with a trigger, with the Enable/Disable Ability For Unit or use a Requirement which requires an upgrade (just create an upgrade which does nothing -> set the requirement for the Ability to that -> have a trigger use the Set Upgrade Level For Player and set it to either 1 (the requirement will return true) or 0 (the requirement will return false).
Thanks Demtrod, but it is the ability of an item. So if I did nothing wrong during my tests, the ability of the item doesn't trigger the event "ability used" in a trigger. So I can't stop it before to be fully done. If I use the event "item used", the ability is fully done and can't be stopped.
So I tried to use a dummy ability, then test if I should allow the real ability (so start the real ability) if it doesn't target a certain area. But then I have troubles with the cooldown of the item, which is triggered during the dummy ability. According to my test, I can't reset the cooldown of an item : I tried to rest it indicating the item itself as an unit or the unit bearing it, without any success.
FunkyUserName, thanks for your solution. I guess that it is the only way to do it. I miss the lack of terrain texture, buildable, and several other validator possibilities. But I have to admit that there is already a big list in the validators types. Annoying to have to go with such an inelegant and unaccurate solution...
@Kloupz: Go
What events exactly do you want to disable the use of the item (I assume you mean like give an error such as "Caster if full health")?
Try to explain it further, and we might be able to help. It's hard to help when I don't know what you want :)
I want to prevent the use of an item if it targets a certain area of the map.
But I think that FunkyUserName has given me the only way to do it : putting dummy units, and checking the number of dummy units close in a validator. Which is bad because unaccurate mainly, but it does the job ^^