timer of 0.00 seconds (great uses for it)

mapguy

New Member
Reaction score
46
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:

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




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))))





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.
 

Azlier

Old World Ghost
Reaction score
461
This was pretty much generally known for years, and there are actually one or two totally unused systems dedicated to 0 second timers.

Besides, this tutorial is barely understandable, totally unorganized, but your greatest crime is doing it in GUI!

Well, you won't be murdered for that last one. Sadly.
 

Stringel

New Member
Reaction score
12
You took one of my posts and turned it into an unnecessary tutorial with bad formatting and layout. Improve by structuring it, showing more general examples and you might link to your threads where it has solved your issues.
 

Jesus4Lyf

Good Idea™
Reaction score
397
We already know you can block damage with 0 second timers. But thankfully, we have systems to do that for us.

We also know that you can get the mana cost of a spell, in theory. We also know that this fails when the spell restores mana to the caster. We have a system which factors both things in.

GY'd. I think this is too common knowledge, unlikely to become readable, and the applications of it are already encapsulated neatly into systems. :)
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top