Thank you very much, this has worked! I made it move to the nearest enemy (outside range) when one in range to attack doesn't exist. I used path_search_long(NULL, sd2->bl.m, sd2->bl.x, sd2->bl.y, md->bl.x, md->bl.y, CELL_CHKWALL)) to check what can be reached and it seems to work although it seems to have problems going around obstacles. That's not a problem, I'm going to be playing manually afterall, so I can always just move the stuck character if it happens, although if there is a fix for this that would be of course even better.
So next up is implementing skills slowly one at a time but first, characters not in "tanking" mode should follow the tank to ensure they are in range to use their skills. I'm going to simplify this and make it a rule for myself that it's always the party leader who is doing the tanking, whether I'm playing that character or it's automatic -that makes most sense anyway as the tank determines which way the party will be heading. So now I need a way to get the party leader of a specific player, so I can send them to follow it, then I'll need a way to check if they have a specific skill or not and if yes, use it on the leader's target for attack skills. I might be able to get that done on my own, but I got stuck on an unexpected thing. Even though I added autopilot: true to my groups.conf file for players, it still only works on the GM account, any idea what could cause that? I have no problems with the other commands so I guess custom ones are different somehow? I can't test the feature with multiple characters as is although I guess I can make all my accounts admins but I rather not.
Oh, this is case sensitive I bet. I had "ACMD_DEF(Autopilot)," in the def file, that has to be the problem. Indeed, it was. I missed it because it wasn't case sensitive ingame.
More progress : following the leader now works. Only skills are left to tackle now. Thanks for all the help one more time!
Edit : changing the max walk path from 32 to 128 fixed the issue of getting stuck. So moving and normal attacking is fully functional now.