Hello!
I have two example triggers below. The first works on every unit in the unit group, and the second does not - It only seems to hit a handful of random units in the group. I am not sure why the second doesn't work.
My reasoning for trigger #2 is to create less units overall in the game, reducing leaks/lag in the log run.
As always, thanks for the help!
I have two example triggers below. The first works on every unit in the unit group, and the second does not - It only seems to hit a handful of random units in the group. I am not sure why the second doesn't work.
My reasoning for trigger #2 is to create less units overall in the game, reducing leaks/lag in the log run.
-
alifeCast
-
Events
- Unit - A unit Starts the effect of an ability
-
Conditions
- (Ability being cast) Equal to Antilife Shell (Necro)
-
Actions
- Set VariableSet alifeCasterLoc[(Player number of (Owner of (Triggering unit)))] = (Position of (Triggering unit))
- Custom script: set bj_wantDestroyGroup = true
-
Unit Group - Pick every unit in (Units within 800.00 of alifeCasterLoc[(Player number of (Owner of (Triggering unit)))].) and do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- ((Picked unit) is dead) Equal to True
- (Color of (Owner of (Picked unit))) Equal to (Color of Player 12 (Brown))
-
Then - Actions
- Set VariableSet alifeCorpseCount[(Player number of (Owner of (Triggering unit)))] = (alifeCorpseCount[(Player number of (Owner of (Triggering unit)))] + 1)
- Set VariableSet alifeCorpseLoc[(Player number of (Owner of (Triggering unit)))] = (Position of (Picked unit))
- Special Effect - Create a special effect at alifeCorpseLoc[(Player number of (Owner of (Triggering unit)))] using Objects\Spawnmodels\Undead\UndeadDissipate\UndeadDissipate.mdl
- Special Effect - Destroy (Last created special effect)
- Custom script: call RemoveLocation(udg_alifeCorpseLoc[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))])
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Loop - Actions
- Custom script: set bj_wantDestroyGroup = true
-
Unit Group - Pick every unit in (Units within 800.00 of alifeCasterLoc[(Player number of (Owner of (Triggering unit)))].) and do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- alifeCorpseCount[(Player number of (Owner of (Triggering unit)))] Greater than 0
- ((Owner of (Picked unit)) controller) Equal to User
- ((Picked unit) is dead) Equal to False
-
Then - Actions
- Unit - Create 1 dummy_unit for (Owner of (Triggering unit)) at alifeCasterLoc[(Player number of (Owner of (Triggering unit)))] facing Default building facing degrees
- Unit - Add a 0.30 second Generic expiration timer to (Last created unit)
- Set VariableSet alifeDummyUnit[(Player number of (Owner of (Triggering unit)))] = (Last created unit)
- Unit - Add Antilife Shell (Necro Dummy) to alifeDummyUnit[(Player number of (Owner of (Triggering unit)))]
- Ability - Set Ability: (Unit: alifeDummyUnit[(Player number of (Owner of (Triggering unit)))]'s Ability with Ability Code: Antilife Shell (Necro Dummy))'s Integer Level Field: Defense Increase ('Inf2') of Level: 0 to (alifeCorpseCount[(Player number of (Owner of (Triggering unit)))] x 5)
- Set VariableSet alifeArmorTarget[(Player number of (Owner of (Triggering unit)))] = (Picked unit)
- Unit - Order alifeDummyUnit[(Player number of (Owner of (Triggering unit)))] to Human Priest - Inner Fire alifeArmorTarget[(Player number of (Owner of (Triggering unit)))]
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Loop - Actions
- Set VariableSet alifeCorpseCount[(Player number of (Owner of (Triggering unit)))] = 0
- Custom script: call RemoveLocation(udg_alifeCasterLoc[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))])
-
Events
-
alifeCast
-
Events
- Unit - A unit Starts the effect of an ability
-
Conditions
- (Ability being cast) Equal to Antilife Shell (Necro)
-
Actions
- Set VariableSet alifeCasterLoc[(Player number of (Owner of (Triggering unit)))] = (Position of (Triggering unit))
- Custom script: set bj_wantDestroyGroup = true
-
Unit Group - Pick every unit in (Units within 800.00 of alifeCasterLoc[(Player number of (Owner of (Triggering unit)))].) and do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- ((Picked unit) is dead) Equal to True
- (Color of (Owner of (Picked unit))) Equal to (Color of Player 12 (Brown))
-
Then - Actions
- Set VariableSet alifeCorpseCount[(Player number of (Owner of (Triggering unit)))] = (alifeCorpseCount[(Player number of (Owner of (Triggering unit)))] + 1)
- Set VariableSet alifeCorpseLoc[(Player number of (Owner of (Triggering unit)))] = (Position of (Picked unit))
- Special Effect - Create a special effect at alifeCorpseLoc[(Player number of (Owner of (Triggering unit)))] using Objects\Spawnmodels\Undead\UndeadDissipate\UndeadDissipate.mdl
- Special Effect - Destroy (Last created special effect)
- Custom script: call RemoveLocation(udg_alifeCorpseLoc[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))])
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Loop - Actions
- Custom script: set bj_wantDestroyGroup = true
- Unit - Create 1 dummy_unit for (Owner of (Triggering unit)) at alifeCasterLoc[(Player number of (Owner of (Triggering unit)))] facing Default building facing degrees
- Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
- Set VariableSet alifeDummyUnit[(Player number of (Owner of (Triggering unit)))] = (Last created unit)
- Unit - Add Antilife Shell (Necro Dummy) to alifeDummyUnit[(Player number of (Owner of (Triggering unit)))]
- Ability - Set Ability: (Unit: alifeDummyUnit[(Player number of (Owner of (Triggering unit)))]'s Ability with Ability Code: Antilife Shell (Necro Dummy))'s Integer Level Field: Defense Increase ('Inf2') of Level: 0 to (alifeCorpseCount[(Player number of (Owner of (Triggering unit)))] x 5)
-
Unit Group - Pick every unit in (Units within 800.00 of alifeCasterLoc[(Player number of (Owner of (Triggering unit)))].) and do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- alifeCorpseCount[(Player number of (Owner of (Triggering unit)))] Greater than 0
- ((Owner of (Picked unit)) controller) Equal to User
- ((Picked unit) is dead) Equal to False
-
Then - Actions
- Set VariableSet alifeArmorTarget[(Player number of (Owner of (Triggering unit)))] = (Picked unit)
- Unit - Order alifeDummyUnit[(Player number of (Owner of (Triggering unit)))] to Human Priest - Inner Fire alifeArmorTarget[(Player number of (Owner of (Triggering unit)))]
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Loop - Actions
- Set VariableSet alifeCorpseCount[(Player number of (Owner of (Triggering unit)))] = 0
- Custom script: call RemoveLocation(udg_alifeCasterLoc[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))])
-
Events
As always, thanks for the help!