In my mod, NE Enemies, I have some enemies that are 100% immune to certain types of damage.
In my mod NE Buildings, I have ammo that can convert a unit to our side.
As a result, sometimes two units of the some type would get stuck shooting at each other forever.
Was wondering if some smart people could think of a solution around this.
I'd like to keep the 100% immunity. So just dropping that is not a solution I want to consider currently.
Please let me know if anyone has an idea how to prevent/resolve this problem.
Thanks.
Re: Need Solution to Deadlock
Posted: Sat Mar 23, 2019 4:34 pm
by danielbrauer
It sounds like the general problem is units shooting at things which are immune to their attacks. In this case it lasts forever and so it’s obviously silly, but even if you’re vulnerable to an enemy it doesn’t make sense to attack it for zero damage.
So if it’s possible to not attack enemies which are immune, I’d go for that. Otherwise some sort of special casing might work, but that sounds trickier.
Re: Need Solution to Deadlock
Posted: Mon Apr 01, 2019 6:56 pm
by TheSAguy
Okay, so I solved most of the problem by just giving each enemy a very small secondary damage type. So if two Acid Immune enemies attack each other, there is a small amount of "physical" damage also, that will eventually kill the other unit.
This worked for all my attacks, except for the Fire Spitter units. I added a little physical damage to the fire, but for some reason, it's not doing any damage.