I am making a barrier system, which summons a barrier, which blocks missiles. If missile damage > barrier, then missile goes through, but its damage is reduced by barrier's hp. The barrier can be damaged by auto-attacks and AOE spells as well. It is impossible for units to go through a barrier.
My questions are:
1. How to make it dynamically that units can't go through the barrier? Since barrier's length can vary, I need different numbers of path blockers every time.
2. How to make that barrier receives damage from AOE, which is only in its rect? The problem is illustrated on a screenshot I attached.
3. I want to make a barrier as an effect. How do I make it that it is possible to attack it? (Unit without a model, which can be selected)
Would appreciate any help. I code in vJass
Edit: One of the ideas I have is to make a barrier of multiple invisible dummy units (determine the number of dummies by calculating length of the barrier/pathing of the dummy). And then have the main unit (barrier in the center). This solves problems 1 and 3. In terms of problem 2, I need to transfer all the damage from these units to the main one. The problem here is how to avoid double counting? Just checking whether dummy 1 and dummy 2 receives the same damage from the same source might not do it because some aoe spells are gradual (eg. they increase their aoe of dmg overtime). So, if another aoe hits and rewrites the memory the last damage and owner, it creates bugs.
Maybe someone has ideas on this? Or more optimal ideas, since creating and deleting so many units every time is heavy (and I can't use dummy recycling for this).
My questions are:
1. How to make it dynamically that units can't go through the barrier? Since barrier's length can vary, I need different numbers of path blockers every time.
2. How to make that barrier receives damage from AOE, which is only in its rect? The problem is illustrated on a screenshot I attached.
3. I want to make a barrier as an effect. How do I make it that it is possible to attack it? (Unit without a model, which can be selected)
Would appreciate any help. I code in vJass
Edit: One of the ideas I have is to make a barrier of multiple invisible dummy units (determine the number of dummies by calculating length of the barrier/pathing of the dummy). And then have the main unit (barrier in the center). This solves problems 1 and 3. In terms of problem 2, I need to transfer all the damage from these units to the main one. The problem here is how to avoid double counting? Just checking whether dummy 1 and dummy 2 receives the same damage from the same source might not do it because some aoe spells are gradual (eg. they increase their aoe of dmg overtime). So, if another aoe hits and rewrites the memory the last damage and owner, it creates bugs.
Maybe someone has ideas on this? Or more optimal ideas, since creating and deleting so many units every time is heavy (and I can't use dummy recycling for this).
Attachments
Last edited: