Solved my issue. I found the event Unit is being removed and added a condition requiring it to be in the region. Thanks anyhow guys.
Thanks for the ideas.
I didn't quite understand the "make my own version of remove" idea. I did try the kill instead of remove. Unfortunately it did not work.
My remove/kill unit trigger is a simple Kill/Remove and then adding via function Merc B to the closest point in region B at most 1.
Add to Counter (Works)
Events
Unit - Any Unit Enters Region A
Local Variables
Conditions
Actions
General - If (Conditions) then do (Actions) else do (Actions)
If
(Unit type of (Triggering unit)) == Merc B
Then
Variable - Set B Counter = (B Counter + 1)
Else
Subtract from Counter (Does not Work)
Events
Unit - Any Unit Leaves Region A
Local Variables
Conditions
Actions
General - If (Conditions) then do (Actions) else do (Actions)
If
(Unit type of (Triggering unit)) == Merc B
Then
Variable - Set B Counter = (B Counter - 1)
Else
Events: Unit Enters Region: Any Unit Enters Region X
Actions: If Then Else: If unit type = x Then set Counter +1
And another
Events: Unit Leaves Region: Any Unit Leaves Region X
Actions: If Then Else: If unit type = x Then set Counter -1
The problem is when a unit is created there, it adds the +1 like it's supposed to but when the unit is Removed via trigger the -1 does not happen.
Is there any simple way to get this working? I thought the way I had it set up was easy enough but maybe Remove unit doesn't trigger as Leaving the region?
Any ideas? Appreciate the help.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Thanks for the ideas. I didn't quite understand the "make my own version of remove" idea. I did try the kill instead of remove. Unfortunately it did not work. My remove/kill unit trigger is a simple Kill/Remove and then adding via function Merc B to the closest point in region B at most 1. Add to Counter (Works) Events Unit - Any Unit Enters Region A Local Variables Conditions Actions General - If (Conditions) then do (Actions) else do (Actions) If (Unit type of (Triggering unit)) == Merc B Then Variable - Set B Counter = (B Counter + 1) Else Subtract from Counter (Does not Work) Events Unit - Any Unit Leaves Region A Local Variables Conditions Actions General - If (Conditions) then do (Actions) else do (Actions) If (Unit type of (Triggering unit)) == Merc B Then Variable - Set B Counter = (B Counter - 1) Else
So I have a counter set up basically like this:
Events: Unit Enters Region: Any Unit Enters Region X
Actions: If Then Else: If unit type = x Then set Counter +1
And another
Events: Unit Leaves Region: Any Unit Leaves Region X
Actions: If Then Else: If unit type = x Then set Counter -1
The problem is when a unit is created there, it adds the +1 like it's supposed to but when the unit is Removed via trigger the -1 does not happen.
Is there any simple way to get this working? I thought the way I had it set up was easy enough but maybe Remove unit doesn't trigger as Leaving the region?
Any ideas? Appreciate the help.