Leak custom aura triger. Need help.

streng

Member
Reaction score
1
Hi guys. I made this triger (and similar trigers) for 7 my custom spells. Everything work fine, until i add couple of neutral hostile creeps. I understand why game lags. Trigers picking every unit in map (neutral hostile 300+ unit). I need fix this triger. Need only picking heros , or player units.

Code:
Events
    Time - Every 1.00 seconds of game time
Conditions
Actions
    Set TempUnitGroup = (Units in (Playable map area))
    Unit Group - Pick every unit in TempUnitGroup and do (If (((Picked unit) has buff Melody Aura ) Equal to True) then do (Unit - Add Spell Book 1  to (Picked unit)) else do (Unit - Remove Spell Book 1  from (Picked unit)))
    Custom script:  call DestroyGroup ( udg_TempUnitGroup )

I try to fix with this, but no working.
Code:
Actions
    Set TempUnitGroup = (Units in (Playable map area) matching (((Matching unit) is A Hero) Equal to True))
    Unit Group - Pick every unit in TempUnitGroup and do (If (((Picked unit) has buff Melody Aura ) Equal to True) then do (Unit - Add Spell Book 1  to (Picked unit)) else do (Unit - Remove Spell Book 1  from (Picked unit)))
    Custom script:  call DestroyGroup ( udg_TempUnitGroup )

Thanx for your answers. :)
 

BcBoy

Active Member
Reaction score
6
Assign your Hero/Heroes to a Variable and/or Array.
Then you can pick ONLY those characters instead of picking every single unit on the map.
 

streng

Member
Reaction score
1
Can you write it more details about your idea ? Because Im trying to do with Array as you said , but dont know how ?
 

vypur85

Hibernate
Reaction score
803
Code:
Set UnitGroup1 = Every unit... matching (Matching unit) has TheBuff Equal to True and (Matching unit) is in UnitGroup2 Equal False...
Unit group - Pick every unit in UnitGroup1 and...
Loop - Actions
  Unit group - Add Picked unit to UnitGroup2
  Unit - Add YourAbility to Picked unit
Unit group - Pick every unit in UnitGroup2 and...
Loop - Actions
  If
      Picked unit has TheBuff Equal to False
  Then
      Unit group - Remove Picked unit from UnitGroup2
      Unit - Remove YourAbility from Picked unit
  Else
Custom script: Destroy UnitGroup1 only...
 
-No need to destroy UnitGroup2

Try this. Not sure how much it'd help though. Usually picking units in the entire map region causes a lil bit of lag if you have many units across. It can't be helped. But it doesn't occur that often because usually nobody use that many units in their map. Perhaps reducing the number of creeps will help your case. :)
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top