Is there a function that returns the current state of the cooldown of an ability for a given unit? I need the exact number as I want to convert it from (Real) to Text and display in a dialog item.
The ability most certainly has been used and tested multiple times and is in cooldown.
<<code>>
Unit - Order Imperium Control Tower [18.00, 96.00] to (Imperium- Imperium- Ancient Guardian) (Replace Existing Orders)
Dialog - Set Faction Ability Button # 3 text to ("Ancient Guardian: Currently in Cool..." + (Text((Cooldown of cooldown (Abil/AncientGuardian|) on ability Imperium- Ancient Guardian on unit Imperium Control Tower [18.00, 96.00])) with Any Precision decimal places)) for (Allies of Player 14)
<</code>>
And later there is a trigger which pops up the dialog for the player to view the appropriate button. But it just shows the text as 0. Also, I might add, I tried using this function in a conditional as well and it always registered as 0 even after the unit used the ability. If I get it to work later I'll adjust the numbers to change continually, but for now I just want it to actually show the current cooldown amount remaining, which it does not.
And here is the ability DATA.
<<code>>
Field Imperium- Ancient Guardian Cost^ - Cooldown^ - Link^ (Abil/AncientGuardian|) Cost^ - Cooldown^ - Location^ (Ability|Ability) Cost^ - Cooldown^ - Operation^ (Add If Not In Cooldown|Add If Not In Cooldown) Cost^ - Cooldown^ - Time Start^ (0.0000|0.0000) Cost^ - Cooldown^ - Time Use^ (400.0000|0.0000)
I found the problem. It's with the cooldown link. Set it to anything else and it works.
When you make custom abilities I figured you just had to create your own cooldown link. It works in data. But there is another setting somewhere you have to adjust for it to work in triggers apparently.
Is there a function that returns the current state of the cooldown of an ability for a given unit? I need the exact number as I want to convert it from (Real) to Text and display in a dialog item.
Use cooldown of unit ability to return time remaining.
Yeah I tried using that only it's not working. I don't know why. For some reason the returned value is always 0.
I was using it in a conditional for a separate trigger and had to use unit state of ability instead. But that only returns the unit state.
If it returns zero that should mean that the ability hasn't been cast aka no cooldown. Post your trigger code.
The ability most certainly has been used and tested multiple times and is in cooldown.
<<code>>
Unit - Order Imperium Control Tower [18.00, 96.00] to (Imperium- Imperium- Ancient Guardian) (Replace Existing Orders)
Dialog - Set Faction Ability Button # 3 text to ("Ancient Guardian: Currently in Cool..." + (Text((Cooldown of cooldown (Abil/AncientGuardian|) on ability Imperium- Ancient Guardian on unit Imperium Control Tower [18.00, 96.00])) with Any Precision decimal places)) for (Allies of Player 14)
<</code>>
And later there is a trigger which pops up the dialog for the player to view the appropriate button. But it just shows the text as 0. Also, I might add, I tried using this function in a conditional as well and it always registered as 0 even after the unit used the ability. If I get it to work later I'll adjust the numbers to change continually, but for now I just want it to actually show the current cooldown amount remaining, which it does not.
And here is the ability DATA.
<<code>>
Field Imperium- Ancient Guardian
Cost^ - Cooldown^ - Link^ (Abil/AncientGuardian|)
Cost^ - Cooldown^ - Location^ (Ability|Ability)
Cost^ - Cooldown^ - Operation^ (Add If Not In Cooldown|Add If Not In Cooldown)
Cost^ - Cooldown^ - Time Start^ (0.0000|0.0000)
Cost^ - Cooldown^ - Time Use^ (400.0000|0.0000)
<</code>>
I found the problem. It's with the cooldown link. Set it to anything else and it works.
When you make custom abilities I figured you just had to create your own cooldown link. It works in data. But there is another setting somewhere you have to adjust for it to work in triggers apparently.
Sorry about the messiness of the post. I don't quite understand how to use the new forums since they changed everything.