- Joined
- May 16, 2020
- Messages
- 660
Hi all,
The following trigger should recognize if a specific unit is in range, and if yes, just extend the Timed Life of units within the group.
However, the created group which I use to check if someone is in range is always empty, even though the AA_Point[1] literally contains >100 units of this type. This results in the trigger creating 1 Spectral Dagger (Shadow) at AA_PointTemp[1] over and over.
I believe the problem is with the function "unit-type of matching unit equal to XXX". I do not see any mistake here, but maybe I'm handing the function wrong. Can anyone help please?
The following trigger should recognize if a specific unit is in range, and if yes, just extend the Timed Life of units within the group.
However, the created group which I use to check if someone is in range is always empty, even though the AA_Point[1] literally contains >100 units of this type. This results in the trigger creating 1 Spectral Dagger (Shadow) at AA_PointTemp[1] over and over.
I believe the problem is with the function "unit-type of matching unit equal to XXX". I do not see any mistake here, but maybe I'm handing the function wrong. Can anyone help please?
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (AA_GroupHitHero[AA_Integer] is empty) Equal to False
-
Then - Actions
-
Unit Group - Pick every unit in AA_GroupHitHero[AA_Integer] and do (Actions)
-
Loop - Actions
- Set VariableSet AA_Unit = (Picked unit)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (AA_Unit is alive) Equal to True
-
Then - Actions
- Set VariableSet AA_PointTemp[1] = (Position of AA_Unit)
- Custom script: set udg_AA_GroupShadowCheck = CreateGroup()
- Set VariableSet AA_GroupShadowCheck = (Units within 120.00 of AA_PointTemp[1] matching ((Unit-type of (Matching unit)) Equal to Spectral Dagger (Shadow)).)
- Game - Display to (All players) the text: (String((Number of units in AA_GroupShadowCheck)))
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Number of units in AA_GroupShadowCheck) Equal to 0
-
Then - Actions
- Game - Display to (All players) the text: Nothing found - Cre...
- Unit - Create 1 Spectral Dagger (Shadow) for (Owner of AA_Caster[AA_Integer]) at AA_PointTemp[1] facing Default building facing degrees
- Set VariableSet AA_Dummy = (Last created unit)
- Ability - Set Ability: (Unit: AA_Dummy's Ability with Ability Code: Spectral Dagger (Self))'s Real Level Field: Movement Speed Increase (%) ('Oae1') of Level: 0 to AA_Speed[AA_Integer]
- Ability - Set Ability: (Unit: AA_Dummy's Ability with Ability Code: Spectral Dagger (Enemies))'s Real Level Field: Movement Speed Factor ('Slo1') of Level: 0 to AA_Slow[AA_Integer]
- Unit - Add a 7.00 second Generic expiration timer to AA_Dummy
-
Else - Actions
-
Unit Group - Pick every unit in AA_GroupShadowCheck and do (Actions)
-
Loop - Actions
- Game - Display to (All players) the text: Found - extend life
- Set VariableSet AA_UnitTemp = (Picked unit)
- Unit - Cancel Timed Life for AA_UnitTemp
- Unit - Add a 7.00 second Generic expiration timer to AA_UnitTemp
-
Loop - Actions
-
Unit Group - Pick every unit in AA_GroupShadowCheck and do (Actions)
-
If - Conditions
- Custom script: call RemoveLocation( udg_AA_PointTemp[1])
- Custom script: call DestroyGroup(udg_AA_GroupShadowCheck)
- Else - Actions
-
If - Conditions
-
Loop - Actions
-
Unit Group - Pick every unit in AA_GroupHitHero[AA_Integer] and do (Actions)
- Else - Actions
-
If - Conditions