Devastator_cm 434 Posted February 15, 2017 Hi Guys, anybody knows a command which can be used to find a position where a target can be shot. I couldn't find such command and it looks like I need to handle such case via findEmptyPosition and checkVisibility. My goal is to find the best shooting position for AI unit to hit a target Share this post Link to post Share on other sites
champ-1 40 Posted February 15, 2017 I think you might look into BIS_fnc_findOverwatch function. Share this post Link to post Share on other sites
celludriel 79 Posted February 15, 2017 Can you be a bit more elaborate ? I myself have used checkVisibility with succes _visibility = [objNull, "VIEW"] checkVisibility [eyePos player, eyePos (crew _x select 0)]; if (_visibility > 0.5) then { ... } I guess you could let the AI move a few meters, check the target area for visibility, if it is greater then a treshold in the above case 0.5, that would be the best position. 1 being the best 0 being not visible at all. I'm not saying this will be the most efficient way to do it but it could work ? If this is what you want to do of course. or you can use champ-1's idea who beat me five seconds to the punch ... Share this post Link to post Share on other sites
Devastator_cm 434 Posted February 15, 2017 4 minutes ago, champ-1 said: I think you might look into BIS_fnc_findOverwatch function. Thanks looks like that function do not checks if found position is ok to fire or not. Still I might adjust it maybe with checkvisibility to have that criteria 1 minute ago, celludriel said: Can you be a bit more elaborate ? I myself have used checkVisibility with succes _visibility = [objNull, "VIEW"] checkVisibility [eyePos player, eyePos (crew _x select 0)]; if (_visibility > 0.5) then { ... } I guess you could let the AI move a few meters, check the target area for visibility, if it is greater then a treshold in the above case 0.5, that would be the best position. 1 being the best 0 being not visible at all. I'm not saying this will be the most efficient way to do it but it could work ? If this is what you want to do of course. I have a Tank and when it finds enemy it should move to a nice position around enemy (i.e. random postion around100 meter from target) where it can fire Share this post Link to post Share on other sites
celludriel 79 Posted February 16, 2017 Ok here is how I would approach this problem. as soon as the enemy is found following algorithm would kick into action: - Use shkPos to find a random position on the edge of a circle around the target - Use checkVisibility from that location to the target if it passes a certain treshold confirm the position if not use shkPos again to find another position, repeat until a good position is found - Move the tank to that position and check again with checkVisibility if the position is still valid, if not repeat above process - When all conditions are met, make the tank engage I'm not sure if I missed something, but this sounds a valid strategy to me. Share this post Link to post Share on other sites