Do loops cause any delay between actions?

O.A

Quantum physics rules
Reaction score
29
Say you have 3 actions;
1. Make unit x invulnerable 2. Integer loop from 1-10 (e.g) OR Pick every unit in group x
3. Make unit x vulnerable.

Would the loop above cause even a fraction more delay between actions 1. and 3. than say;
1. Make unit x invulnerable 2. any non-loop action, for example; cause unit x to damage unit y
3. Make unit x vulnerable.

All actions would be consecutive without any Wait functions.
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
Define "delay".

Of course the computer has to do calculations and that probably costs a fraction of a millisecond to carry out. But you will probably not notice.

If you are talking about in-game time then no. The game logic is single-threaded. All actions are performed in sequential order and until the former action has finished the later will not be started.
 
  • Like
Reactions: O.A

O.A

Quantum physics rules
Reaction score
29
I'm familiarizing myself with the Damage Target action that i've never used in any in-depth way. I have a couple of custom spells that use it to deal damage, and i thought setting the damage to "Spells" would make it deal spell damage.

But now i've noticed that the caster takes damage when using those spells against targets with Thorns Aura, so i tried to get around that by making the caster invulnerable when the damage is dealt. However, that had a side-effect. It makes enemies disengage combat for a second (because of the invulnerability of course). I thought it would be so quick this wouldn't happen (the invulnerability doesn't even show up in the hero's status).

It only seemed to happen once in a while, so i thought maybe the 'Pick every unit' loop caused just enough delay for the enemy to "notice" the invulnerability, and flee. But if there is no in-game delay then this can't be the reason? I guess it just happens if the circumstances are right (the enemy has already started attacking, or already chosen the hero as the target).
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
Probably has.

But I didnt know that thorns aura would affect units when dealing damage through Damage Target action.
Maybe try setting the type to "unknown".
 
  • Like
Reactions: O.A

O.A

Quantum physics rules
Reaction score
29
That actually works. That's going to save me a lot of trouble with this. I never even thought to try changing the damage type since i've always thought they do nothing.

By setting the type to 'unknown' the target's damage reduction is also bypassed, which answers a few totally unrelated questions as well. I will call this a victory. Thank you.
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
The damage types seem to be unfinished. Some of them work, most of them dont.
Unknown is something special, it ignores armor and as it seems thorns aura too.
What exactly the others do I do not know; I never bothered to find out.
 

Solu9

You can change this now in User CP.
Reaction score
216
By using Unknown which, as Accname said, ignores armor. Won't you run into problems if a with with an armor type which reduce spell damage is the target?
 

O.A

Quantum physics rules
Reaction score
29
Based on my testing 'Unknown' only ignores the DR%, not the armor type. It seems 'Spells' does absolutely nothing as an attack type, but using 'Magic' behaves like it should (medium armor takes less damage, even with 'Unknown' as damage type, and heavy takes considerably more).
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top