I followed your suggestions and the only Units that are triggering it are the proper Enemy units for the level
From looking at the Trigger Debugger it seems as if it firing more than just when a Unit dies, but everytime damage is dealt as well. :(
Here is the updated Trigger...below I also put part of the Trigger Debugger log so you can see what I mean. The Broodlings are the Enemy units for Level 1. The Marines/Medic are the Defender's units.
Thanks again any other suggestions/help would be greatly appreciated!
I am making a Defense Map that keeps track of each Player's Kills and their Total Score for all Units that they have killed. I am making good progress but this trigger has had me stuck for several weeks. Basically, when a Level starts and the Enemy units start engaging the defenders, the map starts lagging extremely bad for a little bit, which makes the fights no fun at all(Defenders can have anywhere from 5-25 units typically when the Level starts, and the Enemies have 3 spawn points where 30 enemy units come from, so 90 enemy units in total). I have narrowed it down to this trigger right here.
Any assistance would be greatly appreciated! I know there is probably tons of different ways to Optimize/Make this trigger better!
(Player 15 is the Enemy in my map)
While watching the Trigger Debugger when the lag starts, this Trigger goes off like crazy, it seems to go off not only when a Unit is killed, but when a Unit is damaged as well. It seems like I need to make the Event more specific, I just don't know how, I have tried learning Presets/Functions, but still have difficulty completely wrapping my head around it.
Sorry for the delay on an update...work been bogging me down
I tried setting up the trigger how you suggested but I am getting errors unfortunately :/
Any help would be greatly appreciated...This issue has made me start to lose interest because I have tried so many ways of doing this.. I really wish I could wrap my head around Functions/Presets if they would help in this case
Here is a snip of the trigger debuggger when this happens...It just seems like this event is firing way more than it should, and I am getting an array index overflow error as well.... at the bottom I will post the new trigger that is setup
EnemyUnitDiesTestEventsUnit-AnyUnitdiesLocalVariablesKiller=(Killingplayer)<Integer>Chooser=(PlayerScoreCount[Killer]/50000)<Integer>Conditions(Ownerof(Triggeringunit))==15ActionsVariable-ModifyKiller:+1Leaderboard-SetLeaderboarditemtextatcolumn2androw(Killer+1)to(Text(PlayerKillsCount[Killer]))Variable-SetPlayerScoreCount[Killer]=((PlayerKillerPointValueofUnitsKilledscore)+(PlayerKillerPointValueofUnitsKilledscore))Leaderboard-SetLeaderboarditemtextatcolumn3androw(Killer+1)to(Text(PlayerScoreCount[Killer]))General-If(Conditions)thendo(Actions)elsedo(Actions)IfPlayerScoreCount[Killer]!=ChooserChooser<=10ThenVariable-SetPlayer-NewUnitChooser[Killer]=ChooserUnit-Create1Unit/PowerSelectorforplayerKilleratUnit/PowerSelectorStartingPointfacing180.0degrees(NoOptions)UI-Display"Congratulations! You just received ..."for(Playergroup(Killer))toSubtitleareaElse
I am making a defense map that keeps track of Kills/Score. When I start the first Level, as soon as the enemy units engage my units the game gets extremely laggy and choppy.
Using the trigger debugger I have narrowed it down to my Trigger that updates the Leaderboard Kills/Score every time a Unit Dies.
When watching the trigger debugger, the Trigger seems to be firing before units are dieing(I also noticed it says Event: Unit damaged/dies instead of just Event: Unit Dies when this happenes. It is firing every time any unit is damaged and any time any unit is dies.
I am guessing I need to be more specific with the Event so that it does not fire so often, right now it is Unit - Any Unit dies, but it also has several If statements for rewarding a new Unit every 50,000 score.
I have tried to get the trigger to only fire if a Unit owned by Player 15 dies(who is the Enemy in my map) but have been so far unsuccessful, I have a lot of the rest of my map finished but this issue is preventing me from moving on and have spent hours upon hours trying to resolve this. Any help would be so much appreciated :D
I still have not gotten down the concept of making Presets/or Functions and I am sure those would help big time for this trigger. Thanks again in advance. Here is the whole trigger(minus about 10 more of the If statements for Unit Reward so it doesnt make this post 3 pages LOL) so you can see :D
EnemyUnitDiesEventsUnit-AnyUnitdiesLocalVariablesConditions(Ownerof(Triggeringunit))==15ActionsTrigger-Add(Actions)totheactionqueueActionsVariable-ModifyPlayerKillsCount[(Killingplayer)]:+1Leaderboard-SetLeaderboarditemtextatcolumn2androw((Killingplayer)+1)to(Text(PlayerKillsCount[(Killingplayer)]))Variable-SetPlayerScoreCount[(Killingplayer)]=((Player(Killingplayer)PointValueofUnitsKilledscore)+(Player(Killingplayer)PointValueofUnitsKilledscore))Leaderboard-SetLeaderboarditemtextatcolumn3androw((Killingplayer)+1)to(Text(PlayerScoreCount[(Killingplayer)])withAnyPrecisiondecimalplaces)General-If(Conditions)thendo(Actions)elsedo(Actions)IfPlayerScoreCount[(Killingplayer)]>=50000.0PlayerScoreCount[(Killingplayer)]<=99999.0Player-NewUnitChooser[(Killingplayer)]==0ThenUnit-Create1Unit/PowerSelectorforplayer(Killingplayer)atUnit/PowerSelectorStartingPointfacing180.0degrees(NoOptions)UI-CreateaTriggeralertatUnit/PowerSelectorStartingPointforplayer1withthetext:"You just received another Unit / Po..."(Customicon:NoFile)Variable-SetPlayer-NewUnitChooser[(Killingplayer)]=1UI-Display"Congratulations! You just received ..."for(Playergroup((Killingplayer)))toSubtitleareaElseGeneral-If(Conditions)thendo(Actions)elsedo(Actions)IfPlayerScoreCount[(Killingplayer)]>=100000.0PlayerScoreCount[(Killingplayer)]<=149999.0Player-NewUnitChooser[(Killingplayer)]==1ThenUnit-Create1Unit/PowerSelectorforplayer(Killingplayer)atUnit/PowerSelectorStartingPointfacing180.0degrees(NoOptions)Variable-SetPlayer-NewUnitChooser[(Killingplayer)]=2UI-Display"Congratulations! You just received ..."for(Playergroup((Killingplayer)))toSubtitleareaElse
0
Thank you for the reply SouLCarveRR
I followed your suggestions and the only Units that are triggering it are the proper Enemy units for the level
From looking at the Trigger Debugger it seems as if it firing more than just when a Unit dies, but everytime damage is dealt as well. :(
Here is the updated Trigger...below I also put part of the Trigger Debugger log so you can see what I mean. The Broodlings are the Enemy units for Level 1. The Marines/Medic are the Defender's units.
Thanks again any other suggestions/help would be greatly appreciated!
0
I am making a Defense Map that keeps track of each Player's Kills and their Total Score for all Units that they have killed. I am making good progress but this trigger has had me stuck for several weeks. Basically, when a Level starts and the Enemy units start engaging the defenders, the map starts lagging extremely bad for a little bit, which makes the fights no fun at all(Defenders can have anywhere from 5-25 units typically when the Level starts, and the Enemies have 3 spawn points where 30 enemy units come from, so 90 enemy units in total). I have narrowed it down to this trigger right here.
Any assistance would be greatly appreciated! I know there is probably tons of different ways to Optimize/Make this trigger better! (Player 15 is the Enemy in my map)
Thanks in advance
While watching the Trigger Debugger when the lag starts, this Trigger goes off like crazy, it seems to go off not only when a Unit is killed, but when a Unit is damaged as well. It seems like I need to make the Event more specific, I just don't know how, I have tried learning Presets/Functions, but still have difficulty completely wrapping my head around it.
Thanks again in advance!
0
Sorry for the delay on an update...work been bogging me down
I tried setting up the trigger how you suggested but I am getting errors unfortunately :/
Any help would be greatly appreciated...This issue has made me start to lose interest because I have tried so many ways of doing this.. I really wish I could wrap my head around Functions/Presets if they would help in this case
Here is a snip of the trigger debuggger when this happens...It just seems like this event is firing way more than it should, and I am getting an array index overflow error as well.... at the bottom I will post the new trigger that is setup
0
Thank you for the quick reply, I will definitely give this a shot and report back....
I had it setup originally without the Add Actions to Action Queue :/ that was one of my last efforts to try and optimize unfortunately :/ lol
0
I am making a defense map that keeps track of Kills/Score. When I start the first Level, as soon as the enemy units engage my units the game gets extremely laggy and choppy.
Using the trigger debugger I have narrowed it down to my Trigger that updates the Leaderboard Kills/Score every time a Unit Dies.
When watching the trigger debugger, the Trigger seems to be firing before units are dieing(I also noticed it says Event: Unit damaged/dies instead of just Event: Unit Dies when this happenes. It is firing every time any unit is damaged and any time any unit is dies.
I am guessing I need to be more specific with the Event so that it does not fire so often, right now it is Unit - Any Unit dies, but it also has several If statements for rewarding a new Unit every 50,000 score.
I have tried to get the trigger to only fire if a Unit owned by Player 15 dies(who is the Enemy in my map) but have been so far unsuccessful, I have a lot of the rest of my map finished but this issue is preventing me from moving on and have spent hours upon hours trying to resolve this. Any help would be so much appreciated :D
I still have not gotten down the concept of making Presets/or Functions and I am sure those would help big time for this trigger. Thanks again in advance. Here is the whole trigger(minus about 10 more of the If statements for Unit Reward so it doesnt make this post 3 pages LOL) so you can see :D