- Joined
- Jul 23, 2009
- Messages
- 1,033
I am trying to make an ammunition system for a ranger unit in my map and for that I need a function that deducts an arrow for each auto attack. The problem lies with the way of detecting it because if I choose to detect a unit attacking it will cause you to lose ammo if you start an attack but then cancel it.
Does anyone know how to work around this?
I have a last resort idea that I would prefer not to use.
Does anyone know how to work around this?
I have a last resort idea that I would prefer not to use.
I have the ranged unit's attack type as instant and intercept the damage with a damage engine reducing it to 0. I then detect the unit taking damage (technically) and deduct an arrow from the unit. Then to get the projectile and actual damage I spawn a dummy unit with 0 attack windup time to attack the target. As I said I would prefer if there is another way.