Has anyone noticed that if a zealot's first attack triggers an event, then its second attack will also trigger the event? I wasn't sure what was causing some of my trigger bugs until I tested and confirmed that it does happen. This also means that if you make a trigger which make a unit invulnerable, if the first zealot attack was before the invulnerability, so will the second attack.
This may be intended but it is annoying to deal with.
This happens on a number of abilities that use multiple phases or sets of abilities. The best solution is just to turn the trigger firing off while the trigger is in action (so it only catches the first attack and ignores the rest until the trigger is done).
If you don't care about multiple units or players using that trigger.
In my case, since it was using a revive trigger, I added a wait of .5 seconds. Most of the time I was just getting a double trigger action but it was starting to look like a triple trigger action.
What other units "use multiple phases or sets of abilities"?
PRDeltoid, please remove that avatar, it was very annoying to write this post while seeing that in the top section of my screen.
RileyStarcraft, were you directing that to me or acidragoon. I know zealots are supposed to attack twice. Do you thing its an error in Blizzards code that if the first attack hits, the second attack automatically hits? It may very well be intentional and I can see for balance purposes why they would code it like that. However what that means is that if your unit has 10 health, a zealot attacks for one hit and brings it down to 2, you activate your invulnerability spell but then the zealot attacks again and is able to kill you.
I think the game doesn't check each period firing as if a weapon were firing. In other words, you're going to take 16 damage if the weapon fires, regardless of any changing states after it's fired; it's only delayed a bit to match the swing animation.
Keep in mind that if you set the period to 1, you'll be buffing damage against armor, as damage subtracts armor amounts per period (a zealot hits a non upgraded Marauder for 14), whereas the zealot will hit for 15 if the period were 1. At least I didn't know that. :O
I'm not getting this though. I setup this simple trigger:
Event - Any Unit is attacked;
Actions - Text message 'Hit';
and only prints it once when I attack something with a zealot.
There are lots of units whose attacks are basically channeled abilities, doing one attack immediately and one a hair later. For example, the Viking and the Banshee both launch two projectiles in a similar fashion. So does the Phoenix, but both projectiles launch at exactly the same time (one could probably hit first, though).
It's most likely completely intentional that the second attack automatically launches if the first one does. Your triggers will just have to be resilient.
Heres the example I made, if you wait long enough, you will probably see a triple (wait about 30 seconds).
Many times the trigger will indeed fire only once.
Cool, few things. I switched the units to friendly, too, but I don't think that'd matter (so I could control and watch when the HP fell)
- One zealot seems to work fine. Only get one message when it dies. Two zealots trigger multiple messages every time, so it's two or more zealots attacking your same target.
- Put some other units to see if they'd do the same thing. No luck with other Stalkers (thought maybe projectiles mid air would also do it) or Archons (single hit 'melee').
- Removing the Period *Durations* of 0.28 from Zealot - Psi Blades Effect (NONdamage) also solves it even with 3 zealots attacking
This is easy to solve.
Create a global variable boolean called zealotAttackedAlready = FALSE.
Then, in the trigger condition you put: if (zealotAttackedAlready == FALSE) which means (Do this only if the zealot has not attacked).
The first action of this trigger will be: Set zealotAttackedAlready = TRUE.
Then, every other attack will not be executed by the trigger until you set this boolean to false again (maybe after some seconds).
RileyStarcraft, were you directing that to me or acidragoon. I know zealots are supposed to attack twice. Do you thing its an error in Blizzards code that if the first attack hits, the second attack automatically hits? It may very well be intentional and I can see for balance purposes why they would code it like that. However what that means is that if your unit has 10 health, a zealot attacks for one hit and brings it down to 2, you activate your invulnerability spell but then the zealot attacks again and is able to kill you.
It's absolutely intentional that it works that way (the delay between attacks is just for aesthetics and isn't intended to affect gameplay in any way), but there's a very simple way to do what you're trying to do. Just add a validator to the damage effect to check if the target is invulnerable. Normally single-target damage effects don't bother checking this because the weapon filters out invulnerable targets.
Whatever you do don't create a single global variable like the poster above suggested because that presupposes only a single zealot ever attacking at one time.
YiffMaster and RileyStarcraft are right, adding the validator the effect works perfectly and even though I don't like to modify the core starcraft 2 units, this is such a minor edit that should rarely ever effect the gameplay.
Starcraft 2 already has a built in validator that works called Not Invulnerable
Btw this bug was the reason why 3 medivacs were created at 2:15 in this video
Has anyone noticed that if a zealot's first attack triggers an event, then its second attack will also trigger the event? I wasn't sure what was causing some of my trigger bugs until I tested and confirmed that it does happen. This also means that if you make a trigger which make a unit invulnerable, if the first zealot attack was before the invulnerability, so will the second attack.
This may be intended but it is annoying to deal with.
Change the zealot attack to do 1 attack as opposed to 2.
That's not a bug, the zealot has two attacks. It even says so in the weapon tooltip.
This happens on a number of abilities that use multiple phases or sets of abilities. The best solution is just to turn the trigger firing off while the trigger is in action (so it only catches the first attack and ignores the rest until the trigger is done).
@PRDeltoid: Go
If you don't care about multiple units or players using that trigger.
In my case, since it was using a revive trigger, I added a wait of .5 seconds. Most of the time I was just getting a double trigger action but it was starting to look like a triple trigger action.
What other units "use multiple phases or sets of abilities"?
PRDeltoid, please remove that avatar, it was very annoying to write this post while seeing that in the top section of my screen.
@RileyStarcraft: Go
RileyStarcraft, were you directing that to me or acidragoon. I know zealots are supposed to attack twice. Do you thing its an error in Blizzards code that if the first attack hits, the second attack automatically hits? It may very well be intentional and I can see for balance purposes why they would code it like that. However what that means is that if your unit has 10 health, a zealot attacks for one hit and brings it down to 2, you activate your invulnerability spell but then the zealot attacks again and is able to kill you.
I think the game doesn't check each period firing as if a weapon were firing. In other words, you're going to take 16 damage if the weapon fires, regardless of any changing states after it's fired; it's only delayed a bit to match the swing animation.
Keep in mind that if you set the period to 1, you'll be buffing damage against armor, as damage subtracts armor amounts per period (a zealot hits a non upgraded Marauder for 14), whereas the zealot will hit for 15 if the period were 1. At least I didn't know that. :O
I'm not getting this though. I setup this simple trigger: Event - Any Unit is attacked; Actions - Text message 'Hit'; and only prints it once when I attack something with a zealot.
What events are you using for this?
@Lascero: Go
Heres the example I made, if you wait long enough, you will probably see a triple (wait about 30 seconds).
Many times the trigger will indeed fire only once.
There are lots of units whose attacks are basically channeled abilities, doing one attack immediately and one a hair later. For example, the Viking and the Banshee both launch two projectiles in a similar fashion. So does the Phoenix, but both projectiles launch at exactly the same time (one could probably hit first, though).
It's most likely completely intentional that the second attack automatically launches if the first one does. Your triggers will just have to be resilient.
Cool, few things. I switched the units to friendly, too, but I don't think that'd matter (so I could control and watch when the HP fell)
- One zealot seems to work fine. Only get one message when it dies. Two zealots trigger multiple messages every time, so it's two or more zealots attacking your same target.
- Put some other units to see if they'd do the same thing. No luck with other Stalkers (thought maybe projectiles mid air would also do it) or Archons (single hit 'melee').
- Removing the Period *Durations* of 0.28 from Zealot - Psi Blades Effect (NONdamage) also solves it even with 3 zealots attacking
This is easy to solve. Create a global variable boolean called zealotAttackedAlready = FALSE.
Then, in the trigger condition you put: if (zealotAttackedAlready == FALSE) which means (Do this only if the zealot has not attacked). The first action of this trigger will be: Set zealotAttackedAlready = TRUE. Then, every other attack will not be executed by the trigger until you set this boolean to false again (maybe after some seconds).
It's absolutely intentional that it works that way (the delay between attacks is just for aesthetics and isn't intended to affect gameplay in any way), but there's a very simple way to do what you're trying to do. Just add a validator to the damage effect to check if the target is invulnerable. Normally single-target damage effects don't bother checking this because the weapon filters out invulnerable targets.
Whatever you do don't create a single global variable like the poster above suggested because that presupposes only a single zealot ever attacking at one time.
YiffMaster and RileyStarcraft are right, adding the validator the effect works perfectly and even though I don't like to modify the core starcraft 2 units, this is such a minor edit that should rarely ever effect the gameplay.
Starcraft 2 already has a built in validator that works called Not Invulnerable
Btw this bug was the reason why 3 medivacs were created at 2:15 in this video