- Joined
- Aug 31, 2009
- Messages
- 776
Hello all.
I previously made a topic in this forum about one of my spells, and through tedious testing I found the cause of the issue - but it's something I've never experience before in the Warcraft III editor.
The way to demonstrate this bug is simple:
First, have yourself a dummy unit with cast point 0 and all the subsequent usual conditions to cast a spell immediately. Make 3 dummy spells based on Firebolt, Frost Nova, and Cripple.
In a trigger, write the following, and of course adjust points and locations etc to fill your need.
Put a Footman in the middle of the map somewhere.
The result is as you'd expect - the Footman gets Fire Bolted 100 times, and all the numbers from 1 to 100 are printed.
Now make another trigger:
As there's a small delay between the time the spell is cast to the time that the spell hits the target (even if projectile speed is set to 9999999), then the value of myInt doesn't get changed until all 100 loops have run.
Okay, nothing too strange so far, right?
Where it gets really weird, is if you use a spell like Cripple.
If you use Cripple, it casts SO FAST that the second trigger gets NESTED INSIDE THE FIRST TRIGGER. The result is that the spell cripple is only cast once. You can demonstrate this clearly by making the actions of the second trigger deal damage to target - it only deal the damage once.
This means that the loop creates a dummy, casts a single cripple, goes into the nested trigger, sets the value of MyInt to 100, and therefore instantly breaks the loop of the first trigger.
What's even more weird, is that if you use Frost Nova for this, it doesn't cause this behavior, despite the fact that Frost Nova is also instant and has no projectile speed associated with it.
I haven't yet tested with other spells, but this is absolutely true for cripple.
So why am I posting this? I dunno, thought it might be nice to let people know in case they run into a similar bug to mine!
tl;dr version:
Cripple casts so fast that if a trigger is to be run from the effect of the cripple spell, it will cause that trigger to be nested inside the first trigger that issued the order to cast. This can break your spells, so watch out.
I previously made a topic in this forum about one of my spells, and through tedious testing I found the cause of the issue - but it's something I've never experience before in the Warcraft III editor.
The way to demonstrate this bug is simple:
First, have yourself a dummy unit with cast point 0 and all the subsequent usual conditions to cast a spell immediately. Make 3 dummy spells based on Firebolt, Frost Nova, and Cripple.
In a trigger, write the following, and of course adjust points and locations etc to fill your need.
Put a Footman in the middle of the map somewhere.
-
For each Integer (MyInt) from 1 to 100 do (Multiple Actions)
-
Loop (Actions)
-
Unit - Create 1 (Dummy Unit) at [some point near the footman] facing default building degrees.
-
Unit - Add (Dummy Fire Bolt) to last created unit.
-
Unit - Order (last created unit) to Orc Warlock - Firebolt [Footman]
-
Unit - Add a 2 second generic expiration timer to (Last created unit)
-
Game - Display to (all players) the text: String(MyInt)
-
-
The result is as you'd expect - the Footman gets Fire Bolted 100 times, and all the numbers from 1 to 100 are printed.
Now make another trigger:
-
Events
-
A unit starts the effect of an ability
-
-
Conditions
-
Ability being cast equal to (Dummy Fire Bolt)
-
-
Actions
-
Set MyInt = 100
-
As there's a small delay between the time the spell is cast to the time that the spell hits the target (even if projectile speed is set to 9999999), then the value of myInt doesn't get changed until all 100 loops have run.
Okay, nothing too strange so far, right?
Where it gets really weird, is if you use a spell like Cripple.
If you use Cripple, it casts SO FAST that the second trigger gets NESTED INSIDE THE FIRST TRIGGER. The result is that the spell cripple is only cast once. You can demonstrate this clearly by making the actions of the second trigger deal damage to target - it only deal the damage once.
This means that the loop creates a dummy, casts a single cripple, goes into the nested trigger, sets the value of MyInt to 100, and therefore instantly breaks the loop of the first trigger.
What's even more weird, is that if you use Frost Nova for this, it doesn't cause this behavior, despite the fact that Frost Nova is also instant and has no projectile speed associated with it.
I haven't yet tested with other spells, but this is absolutely true for cripple.
So why am I posting this? I dunno, thought it might be nice to let people know in case they run into a similar bug to mine!
tl;dr version:
Cripple casts so fast that if a trigger is to be run from the effect of the cripple spell, it will cause that trigger to be nested inside the first trigger that issued the order to cast. This can break your spells, so watch out.