Hey, I have been having issues with the Unit-started-attack event. I have tried it in many different ways to get it to work like i need it to and I have found a way that it works... sorta. the way i have it currently set up is that when one specific unit attacks then it the trigger executes. This seems to work exactly like it should and exactly how i want it to. The problem arises when there are several units attacking at the same time. after around 20-30 units are attacking something the event breaks and then every unit in the map that is attacking causes it to trigger. It tends to cause the trigger to execute a little under 5000 times in a 5 min period which causes a little bit of lag. while its not a serious problem yet it will be long before a match is completed.
I was mostly just curious if anyone else experiences the same thing and if anyone knows a way to fix it. I know of a few work arounds that will allow me to do the same thing but they are a lot less accurate and cause small hick-ups in a few other triggers if things line up just right.
Conditions: Event Unit = Hero (the reason i put this was that when it broke it would cause my trigger to run. with this when it breaks they come up as failed)
Actions: Run Action Definition
Basically it updates a dialog that shows how much ammo a weapon has left. The issue is all in the event though. i can replace it with anything else and it works (Just not as accurate).
Hmm, it's really hard for me to tell what exactly is going on. I'm assuming the hero unit has a variable assigned to it, so your method may look something like...
Event
Any Unit Starts Attacking
Conditions
Or
Attacking Unit == HeroUnit[1]
Attacking Unit == HeroUnit[2]...
... Attacking Unit == HeroUnit[n]
Actions
modify Ammo[Attacking Unit]: -1
Then somewhere else in a dialog you have it show the variable Ammo[] which periodically updates or something? I still can't figure out why multiple units shooting would cause en error...
For event its not any unit starts attacking it is Hero starts attacking. i replaced the any with hero. the trigger does exactly what it is supposed to it just seems to be that after so many units are attacking at the same time then it breaks or somehow switches to any unit starts attacking. I am mostly just curious if anyone else has experience with the Unit Starts Attacking Event and has had a similar issue with it.
By breaking i don't mean the conditions, it still comes across in the trigger debugger as failed but when it checks the condition over 1k times a min i notice the slightest bit of lag. which isn't a problem at this point but there are going to be a lot of units attacking by the end of the game and I would like to avoid future issues.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Hey, I have been having issues with the Unit-started-attack event. I have tried it in many different ways to get it to work like i need it to and I have found a way that it works... sorta. the way i have it currently set up is that when one specific unit attacks then it the trigger executes. This seems to work exactly like it should and exactly how i want it to. The problem arises when there are several units attacking at the same time. after around 20-30 units are attacking something the event breaks and then every unit in the map that is attacking causes it to trigger. It tends to cause the trigger to execute a little under 5000 times in a 5 min period which causes a little bit of lag. while its not a serious problem yet it will be long before a match is completed. I was mostly just curious if anyone else experiences the same thing and if anyone knows a way to fix it. I know of a few work arounds that will allow me to do the same thing but they are a lot less accurate and cause small hick-ups in a few other triggers if things line up just right.
@neverwin1011
Are you using Unit is Attacked, Unit Starts Attacking, or Unit Takes Damage?
Also, are there any Conditions in your trigger? If so, what exactly are you trying to accomplish?
Here is basically my trigger
Event: Unit Starts Attacking (Hero)
Conditions: Event Unit = Hero (the reason i put this was that when it broke it would cause my trigger to run. with this when it breaks they come up as failed)
Actions: Run Action Definition
Basically it updates a dialog that shows how much ammo a weapon has left. The issue is all in the event though. i can replace it with anything else and it works (Just not as accurate).
@neverwin1011:
Hmm, it's really hard for me to tell what exactly is going on. I'm assuming the hero unit has a variable assigned to it, so your method may look something like...
Event
Any Unit Starts Attacking
Conditions
Or
Attacking Unit == HeroUnit[1]
Attacking Unit == HeroUnit[2]...
... Attacking Unit == HeroUnit[n]
Actions
modify Ammo[Attacking Unit]: -1
Then somewhere else in a dialog you have it show the variable Ammo[] which periodically updates or something? I still can't figure out why multiple units shooting would cause en error...
For event its not any unit starts attacking it is Hero starts attacking. i replaced the any with hero. the trigger does exactly what it is supposed to it just seems to be that after so many units are attacking at the same time then it breaks or somehow switches to any unit starts attacking. I am mostly just curious if anyone else has experience with the Unit Starts Attacking Event and has had a similar issue with it. By breaking i don't mean the conditions, it still comes across in the trigger debugger as failed but when it checks the condition over 1k times a min i notice the slightest bit of lag. which isn't a problem at this point but there are going to be a lot of units attacking by the end of the game and I would like to avoid future issues.