one day I discover with the help of a friend that you can use timers that expires in 0.00 seconds.
you will then look to me and say:
"this thing is useless!"
but I have a surprise, it`s not.
I`ll give an example below and then Ill explain:
Oh this really works, great idea.
Oh this really works, great idea.
First Trigger:
Trigger:
Second Trigger:
Trigger:
*
Result:
Unit Mana = 630
Unit Mana = 530
The trigger above was creted by Jedi but he based it in another trigger I created.
looking to what you see above we can conclude an awesome thing.
timers that expires in 0.00 seconds allows us to detect the mana points spent when a hero cast a spell. and I also tested, you can use it to block damage with GUI code.
but this is not a tutorial about damage block, it`s about timers of 0.00 seconds.
the great conclusion is that things happens in this order:
1st = the trigger detects the event ( a units finishes casting a spell)
2nd = all actions inside the trigger happens.
3rd = the mana is spent and effect of the magic starts.
4th = the timer of 0.00 seconds expires and you`re now able to manipulate events after the spell effects and mana spent.
I hope this tutorial allows you to create awesome codes.
you will then look to me and say:
"this thing is useless!"
but I have a surprise, it`s not.
I`ll give an example below and then Ill explain:
Oh this really works, great idea.
Oh this really works, great idea.
First Trigger:
Trigger:
Trigger:
- * Mana Before
- o Events
- + Unit - A unit Starts the effect of an ability
- o Conditions
- + bla bla conditions
- o Actions
- + Set Mana_Unit = (Triggering unit)
- + Game - Display to (All players) the text: (Unit mana = + (String((Mana of (Triggering unit)))))
- + Countdown Timer - Start ManaTimer as a One-shot timer that will expire in 0.00 seconds
- o Events
Second Trigger:
Trigger:
*
Trigger:
- Mana After
- o Events
- + Time - ManaTimer expires
- o Conditions
- o Actions
- + Game - Display to (All players) the text: (Unit mana = + (String((Mana of Mana_Unit))))
- o Events
Result:
Unit Mana = 630
Unit Mana = 530
The trigger above was creted by Jedi but he based it in another trigger I created.
looking to what you see above we can conclude an awesome thing.
timers that expires in 0.00 seconds allows us to detect the mana points spent when a hero cast a spell. and I also tested, you can use it to block damage with GUI code.
but this is not a tutorial about damage block, it`s about timers of 0.00 seconds.
the great conclusion is that things happens in this order:
1st = the trigger detects the event ( a units finishes casting a spell)
2nd = all actions inside the trigger happens.
3rd = the mana is spent and effect of the magic starts.
4th = the timer of 0.00 seconds expires and you`re now able to manipulate events after the spell effects and mana spent.
I hope this tutorial allows you to create awesome codes.