- Joined
- Sep 21, 2013
- Messages
- 36
Hello, everyone.
So, I made 2 triggers.
First:
Second:
Every time unit with True Sight buff comes within 700 of invisible unit, invisible unit gets the classification of suicidal, Dust buff, and is revealed to the enemy.
2nd trigger works as intended, but it causes so much lags, map is unplayable. Please help me to fix lagging, thanks in advance
And sorry for my bad english.
UPD:
I've made a discovery. Lagging only occurs when there are many invisible (i.e. detectable) units.
Maybe I can improve trigger to fix it somehow?
testmap
So, I made 2 triggers.
First:
- Map initialization
- Unit - Create 1 Dummy TriggerUnit for Player 10 (Light Blue) at (Center of (Playable map area)) facing Default building facing degrees
- Hero - Create Dust of Appearance and give it to (Last created unit)
- Set ID__Unit = (Last created unit)
- Set ID__Item = (Last created item)
Second:
- Time - Every 0.10 seconds of game time
- Hero - Order ID__Unit to use ID__Item
- Set TempUnitGroup = (Units in (Playable map area) matching (((Matching unit) has buff True Sight ) Equal to True))
- Set TempUnitGroup_2 = (Units in (Playable map area))
-
Unit Group - Pick every unit in TempUnitGroup_2 and do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Or - Any (Conditions) are true
-
Conditions
- ((Picked unit) has buff Invisibility) Equal to True
- ((Picked unit) has buff Wind Walk) Equal to True
- (Unit-type of (Picked unit)) Equal to Invisible Guy 1
- (Unit-type of (Picked unit)) Equal to Invisible Guy 2
-
Conditions
-
Or - Any (Conditions) are true
-
Then - Actions
- Set InvisibleUnit = (Picked unit)
- Set TempPoint = (Position of InvisibleUnit)
- Set TempUnitGroup_3 = (Units within 700.00 of TempPoint matching (((Matching unit) is in TempUnitGroup) Equal to True))
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Number of units in TempUnitGroup_3) Greater than 0
-
Then - Actions
- If ((InvisibleUnit is A sapper) Equal to True) then do (Do nothing) else do (Unit - Add classification of A sapper to InvisibleUnit)
-
Else - Actions
- Unit - Remove classification of A sapper from InvisibleUnit
-
If - Conditions
-
Else - Actions
- If (((Picked unit) is A sapper) Equal to True) then do (Unit - Remove classification of A sapper from (Picked unit)) else do (Do nothing)
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Loop - Actions
- Custom script: call RemoveLocation (udg_TempPoint)
- Custom script: call DestroyGroup (udg_TempUnitGroup)
- Custom script: call DestroyGroup (udg_TempUnitGroup_2)
- Custom script: call DestroyGroup (udg_TempUnitGroup_3)
Every time unit with True Sight buff comes within 700 of invisible unit, invisible unit gets the classification of suicidal, Dust buff, and is revealed to the enemy.
2nd trigger works as intended, but it causes so much lags, map is unplayable. Please help me to fix lagging, thanks in advance
And sorry for my bad english.
UPD:
I've made a discovery. Lagging only occurs when there are many invisible (i.e. detectable) units.
Maybe I can improve trigger to fix it somehow?
testmap
Last edited: