Some time next week I'll be doing advanced paving techniques for my actors and with it advanced actor targeting including doing stuff totally different to how I've done things before.
I wont be starting the targeting stuff till the basic paving is done but here's an advance of one of my problems I'll be running into, take a look at the picture below:
My bot will be looking for actors using the findnearactor command and then seeing if he can see them using the canseesprite commands and stuff. The problem in the picture is that my Bot will find enemy number 2 each time findnearactor is used since enemy 2 is the closest target. The Bot cannot see the enemy so I need it to search for the next closest enemy........but how?
Findnearactor will always bring me the ID of the closest target so I can't use that. Each of the 3 enemies are in their own sectors so I can't have my actor quickly check his current sector for enemies, I can't have the enemies tell the Bot their locations if they can see him because enemy 3 in the picture could very well be a sniper and telling the Bot his location would allow the bot to aim his weapons accurately at a target you shouldn't even be able to see till you're much closer so I don't want it to be able to shoot accross the map all because someone hiding can see him and I can't have it check what's in front of it using hitscan because the closest enemy (enemy 1) is on a moderate sized piller which puts it above the Bot's center possition. (also I've never got hitscan to work since it requires sin cos and tan and I don't know how to get those)
Before I make a suggested to TerminX about having an "optional" addon value to the findnearactor commands that allows you to toggle the number of actors it searches before it records the ID (This value would be a gamevar so actors can adjust it themselves), is there any other way to make my Bot in that picture find Actor enemy 1 and other actors in simular situations which aren't the closest but are shootable?