I am creating a map in wich players have to conquer regions.
I need to know if TeamA and/or TeamB have units placed in those regions or not.
I created a trigger picking all units inside the specific region. Owners of units are checked.
If a unit is owned by any player of TeamA a variable ("blue") is set to true, saying there is a unit of teamA inside the region.
Same for TeamB, second boolean variable ("red") storing wether there is a unit of teamB inside or not.
The problem:
This method ALWAYS find a unit owned by TeamA inside a region even if there is no unit of any team inside
Units of TeamB are recognized correctly
Troubleshooting (only one change at a time):
- i disabled the check for units of player 1 -> WORKED
- i deleted every unit/doodad/etc inside the region -> broken
- i changed the location of the region ->broken
Looks like the problem is, that my triggers always find a unit owned by player 1 inside a region.
I have no idea why.
I have implemented a hero-selection-system before.
As long as i did not choose a unit, the trigger works fine.
If a unit is created after selection, the trigger is broken. After this units death, the triggers work fine again.
I'm going to try a few things, if i cant find any solution i will post the complete map ...
@SouLCarveRR: Go
if i had posted the complete trigger you would have find my mistake i guess :D Thanks for having a look at it anyway!
Mistake was:
I was referring to "triggered region" but had a periodic event (changed this some time ago >.<), so i guess the whole map was the "triggering region" ...
--
concerning my use of logic: imo it is quite ok for this, because it does the following thing:
I have an array storing the "ownership" of regions.
Values range 0 ... 30, while 0..9 ist owned by TeamA, 10..20 is neutral and 21...30 is TeamB
A periodic event adds -1, 0 or 1 to the ownership (min 0, max 30)
only TeamA inside region: -1
only TeamB inside region: +1
TeamA and B or no units: ± 0
So it does not make any difference if Red/Blue are false or true if they have the same value ;)-
your debug idea is great, i already added some debug text messages but quite ineffective :D
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Hey!
I am creating a map in wich players have to conquer regions.
I need to know if TeamA and/or TeamB have units placed in those regions or not.
I created a trigger picking all units inside the specific region. Owners of units are checked. If a unit is owned by any player of TeamA a variable ("blue") is set to true, saying there is a unit of teamA inside the region. Same for TeamB, second boolean variable ("red") storing wether there is a unit of teamB inside or not.
The problem: This method ALWAYS find a unit owned by TeamA inside a region even if there is no unit of any team inside Units of TeamB are recognized correctly
Troubleshooting (only one change at a time): - i disabled the check for units of player 1 -> WORKED - i deleted every unit/doodad/etc inside the region -> broken - i changed the location of the region ->broken
Looks like the problem is, that my triggers always find a unit owned by player 1 inside a region. I have no idea why.
I would be happy about any advice! Thanks!
@DemoniacMilk: Go
Your use of logic.... is rather bad.......
why would you check to see if red = blue?
You should really show us the whole trigger.... events, variables, conditions.
from what your showing us .... i cant even tell what your trying to accomplish.
But yeah your first condition is set to if Red == Blue.....
which is a really bad way about doing things since..... it would be true if both red and blue = false as well as if they are both set to true
simple way to debug it finding units would be to do a
Text message ( unity type of picked unit & owner of picked unit ) to debug
seems like the problem is located anywhere else.
I have implemented a hero-selection-system before.
As long as i did not choose a unit, the trigger works fine. If a unit is created after selection, the trigger is broken. After this units death, the triggers work fine again.
I'm going to try a few things, if i cant find any solution i will post the complete map ...
@SouLCarveRR: Go if i had posted the complete trigger you would have find my mistake i guess :D Thanks for having a look at it anyway!
Mistake was: I was referring to "triggered region" but had a periodic event (changed this some time ago >.<), so i guess the whole map was the "triggering region" ...
-- concerning my use of logic: imo it is quite ok for this, because it does the following thing:I have an array storing the "ownership" of regions. Values range 0 ... 30, while 0..9 ist owned by TeamA, 10..20 is neutral and 21...30 is TeamB A periodic event adds -1, 0 or 1 to the ownership (min 0, max 30)
only TeamA inside region: -1 only TeamB inside region: +1 TeamA and B or no units: ± 0
So it does not make any difference if Red/Blue are false or true if they have the same value ;)
-your debug idea is great, i already added some debug text messages but quite ineffective :D