hey there,
@f1rpo, hey friend
so,
My Doto is based off advc.
Indeed i have spent many hours on ranged attack code. in my escapades with it, i was able to create a nice system that the ai knew how to work with.
It is quite complicated to catch all the places where the ai needs to evaluate wheatear to attack or not. which i wrote some functions to do so, according to the rules i thought of.
In the end, i decided to go with existing ai logic and not do per say ranged attack, but rather a system of attack that will make the siege units more powerful.
the base of this code is, ranged attack strike and cannot get damage from the unit it attacked, like in a normal combat. it involves more rules, but thats the idea.
it worked nicely. still got some ai tweaks on how much siege units ai should build and risk eval for using those units in combat.
if you are using advc code as basis, you can import code from my mod, i kept it clean and with comments for each component.
i will suggest another go for ranged attack,
Vincent, from VIP mod, wrote a pretty good ranged attack system. which i used as reference point at the start.
from its source code, its really not so difficult to port it to you code.
if you need some help, let me know.