Jump to content
Purzel

How do I get an AI-sniper shoot at human over long distance?

Recommended Posts

Hi,
 

my question is:

How do I get an AI-sniper shoot at human players over distances (let´s say 400-500m / ranges over 500m up to 1000m would be much better)..?
I revealed myself to the AI sniper, but he won´t shoot...
Of  course an appropriate sniper-rifle is given to AI.

I´ve got an area-trigger which  is the "viewfield" of the ai-sniper.
If human players walk in (player in thisList) ... the sniper should start shooting at them from 500m away...

Or is there a range-restriction and I just dont know...?
 


Tipps and tricks anyone?

Greetz Purzel

Share this post


Link to post
Share on other sites

Ai's fire depends on visibility, raycasting, weapons used... So you will not change that easily, except playing in daylight and good weather condition.

To start the thread, I suggest you :

yourSniper reveal [yourGuy,4];

and

{ yourSniper setSkill [_x,1] } forEach ["aimingSpeed","spotDistance","spotTime"];

 

 

Share this post


Link to post
Share on other sites

I have something of a solution to this, though it is built into a wider ranging function, and I'm at work. But i can put something up tomorrow for it. 

  • Like 2

Share this post


Link to post
Share on other sites

THX!

This is my actual Code:

Area-Trigger named "trgl"

activated when Blufor present

serverside: yes
Condition:
(this) && {"MAN" countType thisList > 0}

OnAct:
if (isServer) then {  
nul = [] spawn {  
zieleinheitl = (list trgl) select 0;  
sniperwl reveal [zieleinheitl,4];
{sniperwl setSkill [_x,1] } forEach ["aimingSpeed","spotDistance","spotTime"];  
[[[west,"HQ"],"You are detected by Sniper!!"], "sidechat", west, false] call BIS_fnc_MP;   // Just for visual confirmation, the trigger has shot
sniperwl setBehaviour "COMBAT";
while {{alive _x} count units sniperwl > 0} do {sniperwl dotarget zieleinheitl; sleep 12};
sniperwl doFire zieleinheitl;
};  
};


-------------------------------------

Actual the sniper is NOT shooting over a distance about 300m

Is there a possibilty to make the ai-sniper use the rifles bipod?

 

Share this post


Link to post
Share on other sites

To add to this conversation, this very subject as per your title OP was asked before.

Here is the thread from my AI Compilation list of another member about the subject, hope it can help:

Make AI sniper shoots at 2000m

https://tinyurl.com/y7k7yr5g

  • Like 3

Share this post


Link to post
Share on other sites

Well, for what it's worth, this is basically a cut down version of something else I use with snipers. Download MIL_SniperFire.sqf and place it in your mission folder, then run it using:

 

nul = [_sniper,_target,_shot,_delay] execVM "MIL_SniperFire.sqf;

_sniper - The name of the unit doing the sniping.

_target - The name of the unit being sniped.

_shot - How many shots you want the sniper to fire (Optional. Default: 1).

_delay - How many seconds to wait between firing shots (Optional. Default: 0).

 

Example:

//The sniper will fire a single shot at the target.
nul = [sniper1,target1] execVM "MIL_SniperFire.sqf;
//The sniper will fire 5 shots at the target every 10 seconds.
nul = [sniper1,target1,5,10] execVM "MIL_SniperFire.sqf;

 

Set your sniper up however you need to. Consider setting their behaviour and combatMode to avoid them firing on their own.

 

Edit: Don't discount @Gunter Severloh's post though. It would be worth looking into.

  • Like 2
  • Thanks 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

×