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
The whole "Add (Actions) to the action queue" might be messing it up. Optimizing it might also help. I don't really know what the message is supposed to say, but if it changes you can just create a look-up array for it. BTW I did not actually GUI fully or test this trigger, so some of it might be wrong or not work. Hope this helps.
EnemyUnitDiesEventsUnit-AnyUnitdiesLocalVariablesKiller=(Killingplayer)<Integer>Chooser=(Integer((PlayerScoreCount[Killer] / 50000.0))) <Integer>
Conditions
(Owner of (Triggering unit)) == 15
Actions
Variable - Modify Player Kills Count[Killer]: + 1
Leaderboard - Set Leaderboard item text at column 2 and row (Killer + 1) to (Text(Player Kills Count[Killer]))
Variable - Set Player Score Count[Killer] = ((Player (Killer) Point Value of Units Killed score) + (Player (Killer) Point Value of Units Killed score))
Leaderboard - Set Leaderboard item text at column 3 and row (Killer + 1) to (Text(Player Score Count[Killer]) with Any Precision decimal places)
General - If (Conditions) then do (Actions) else do (Actions)
If
And
Conditions
Player - New Unit Chooser[Killer] != Chooser
Chooser <= 10
Then
Variable - Set Player - New Unit Chooser[Killer] = Chooser
Unit - Create 1 Unit / Power Selector for player (Killer) at Unit / Power Selector Starting Point facing 180.0 degrees (No Options)
UI - Display "Congratulations! You just received ..." for (Player group(Killer)) to Subtitle area
Else
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 have the same problem. I literally have nothing else in my map, its empty. i put a changeling marine in the center of the map for all of the players (including computers) and when i kill a changeling all i want to do is respawn a new one for the player a copule seconds later. it looks like this:
(actually i should say my problem is once i kill a changeling, another one isnt respawned for theplayer. an error pops up saying there was an error starting starcraft 2
ACivDiesEventsUnit-AnyUnitdiesLocalVariablesConditions(Unittypeof(Triggeringunit))==Changeling(Marinewithshield)ActionsUI-Displaycinematictextfor(Allplayers)withtext("killer killed player #"+(Text((Triggeringplayer)))),soundGhost_NukeLaunch,andallow0.1secondsbetweencharacters(maxduration5.0seconds)Variable-SetPlayerLives[(Triggeringplayer)]=(PlayerLives[(Triggeringplayer)]-1)General-Wait2.0GameTimesecondsUnit-Create3Corruptorforplayer(Triggeringplayer)at(Centerof(Playablemaparea))facing(Randomangle)degrees(NoOptions)Variable-SetPlayerCivs[(Triggeringplayer)]=(Lastcreatedunit)Leaderboard-SetPlayerLivesLeaderboarditemtextatcolumn2androw(Triggeringplayer)to(Text(PlayerLives[(Triggeringplayer)]))
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
@Bladien:
The whole "Add (Actions) to the action queue" might be messing it up. Optimizing it might also help. I don't really know what the message is supposed to say, but if it changes you can just create a look-up array for it. BTW I did not actually GUI fully or test this trigger, so some of it might be wrong or not work. Hope this helps.
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
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
@Bladien: Go
i have the same problem. I literally have nothing else in my map, its empty. i put a changeling marine in the center of the map for all of the players (including computers) and when i kill a changeling all i want to do is respawn a new one for the player a copule seconds later. it looks like this:
(actually i should say my problem is once i kill a changeling, another one isnt respawned for theplayer. an error pops up saying there was an error starting starcraft 2