Hi everyone, I'm trying to make a zombie map, where there are a few zombies here and there but they walk amongst the other units peacefully. They only attack when there's only one unit near them (so nobody but the victim knows who he is).
So, I was thinking I would do something like this:
1. Spawn zombie
2. Give him the Ghost - Hold Fire effect
3. Use the event Unit Enters Range of Unit with 5 range
4. Make a condition to continue if it's the only unit within 5 range
5. Order to attack the unit
However, one snag. In #3, the unit whose range is being entered has to be a specific single unit, I can't just say "any zombie".
It would be better to use a loop and check if the number of enemy units within range of the zombie = 1 periodically. That way you can pick all zombies and convert a circle around the picked zombie into a region with radius 5.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Hi everyone, I'm trying to make a zombie map, where there are a few zombies here and there but they walk amongst the other units peacefully. They only attack when there's only one unit near them (so nobody but the victim knows who he is).
So, I was thinking I would do something like this:
1. Spawn zombie
2. Give him the Ghost - Hold Fire effect
3. Use the event Unit Enters Range of Unit with 5 range
4. Make a condition to continue if it's the only unit within 5 range
5. Order to attack the unit
However, one snag. In #3, the unit whose range is being entered has to be a specific single unit, I can't just say "any zombie".
Any ideas? Thanks!
- Evan
It would be better to use a loop and check if the number of enemy units within range of the zombie = 1 periodically. That way you can pick all zombies and convert a circle around the picked zombie into a region with radius 5.