Jump to content
Sign in to follow this  
super-truite

change the AI max spot distance?

Recommended Posts

I would like to increase the maximum spot distance of some AI units. In particular it is ridiculous how blind the marksmans are!

They can't spot a target at 400 meters in the middle of the day! I tried to set manually their spot distance using setskill ["spotdistance",1]: https://community.bistudio.com/wiki/setSkill_array,

but I suspect that I am doing nothing better than setting the skill to 1 with that (I guess it sets all the options 'spotdistance', 'aimingaccuracy' ect. to 1)... Is there a simple way to go over the setskill = 1 limit or should I wait for mods like ZEUSAI?

Share this post


Link to post
Share on other sites

Simpliest I know would be a script with constant loop, that cyclically checks for all units, if there is any enemy in given radius around (or just checks distancies between each possible pair of opposite units present on map). If so, then is applied "knowsAbout" factor in any preferred way - simply, or sophisiticated, counting many factors like distance, movement, weather, daytime, LOS, kind, size, health, skill, background and such. Somewhere I have test version of such code for A2 - it is heavy. Max possible distance would be viewDistance set in video settings.

Edited by Rydygier

Share this post


Link to post
Share on other sites

ai with spotting skill 1 will still have 0.4 spotting probability. you will probably need to overwrite cfgAIskills to make it higher

Share this post


Link to post
Share on other sites

make a function and call it when needed?

MYSKILL_fnc_Skill ={
_groupnamed = _this select 0;	
_leaderguy = leader _groupnamed;
_leaderguy setskill 0.55;
{
_x setskill ["aimingAccuracy",0.55];
_x setskill ["spotDistance",0.85];
_x setskill ["spotTime",0.55];
_x setskill ["courage",0.50];
_x setskill ["commanding",0.60];
_x setskill ["aimingShake",0.60];
_x setskill ["aimingSpeed",0.55];
} foreach units _groupnamed ;
};

Share this post


Link to post
Share on other sites

Thanks for the anwrers.

Simpliest I know would be a script with constant loop, that cyclically checks for all units, if there is any enemy in given radius around (or just checks distancies between each possible pair of opposite units present on map). If so, then is applied "knowsAbout" factor in any preferred way - simply, or sophisiticated, counting many factors like distance, movement, weather, daytime, LOS, kind, size, health, skill, background and such. Somewhere I have test version of such code for A2 - it is heavy. Max possible distance would be viewDistance set in video settings.

I was afraid I would have to to something like this... I'll try, but I am quite a noob at scripting.

ai with spotting skill 1 will still have 0.4 spotting probability. you will probably need to overwrite cfgAIskills to make it higher

How do you modify cfgAIskill? The wiki page is quite obscure: http://community.bistudio.com/wiki/CfgAISkill

@Psviali, I think I won't do better than setting the skill manually to 1 by using your function. My goal is to go over the maximal value allowed (at least for the spotting distance).

Share this post


Link to post
Share on other sites

I'd imagine you would need to overwrite the class, redefine it again in config.hpp in your mod

class CfgAISkill {

aimingAccuracy[] = {0,0,1,1};

aimingShake[] = {0,0,1,1};

aimingSpeed[] = {0,0.5,1,1};

commanding[] = {0,0,1,1};

courage[] = {0,0,1,1};

endurance[] = {0,0,1,1};

general[] = {0,0,1,1};

reloadSpeed[] = {0,0,1,1};

spotDistance[] = {0,0.2,1,0.4};

spotTime[] = {0,0,1,0.7};

};

then change spot distance probability to min 1 max 1 regardless of skill just to see if it's working

spotDistance[] = {0,1,1,1};

Share this post


Link to post
Share on other sites

OK, for what I need it will be enough to reveal the unit I want to the marksman when the unit enter a trigger.

Put

 _marksman reveal _unit 

in the trigger activation.

  • Like 1

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×