Jump to content

Recommended Posts

I still fail to see how this is supposed to be an AI accuracy bug?

 

That was quick demo, it work same on all distances up to 400M. But as i stated around 10 times already, my internet conenction is very bad, longer videos take longer to upload, i dont have ages to take this operation, and wil not record with every 100M further. And i need to take 3-4hits to take him down even with kotiba.

 

As andersson said, how do you confirm that you hit the AI at all? They hit the dirt as soon as they know you're around, then it's impossible to tell by looks alone, not in the video, not in game.

 

Taking 1-2 hits in that timeframe while staying still is totally okay since you neither try to get behind cover or change your location trying to flank the AI.

If the AI was a player you'd be a goner way earlier.

 

So about you claiming to be killed by an opfor rifleman with a katiba + ironsights at 400m:

 

 

In this video I engage an opfor rifleman, we both are armed with a katiba, Ironsights only.

 

Guess who had not fired one single shot at that distance during a timeframe of almost 30 seconds after being hit and spotting the shooter?

 

That's right, AI with Ironsights don't fire back at that distance, even when they have been hit before and know where you are.

I even run a fired eventhandler on the player that reveals him to hostile units, range depending on weapon used and silencer/suppressor.

I know you were probably over exaggerating when you said you were being headshotted at 400m, but throwing this nonsense around doesn't help anyone.

 

Cheers

  • Like 7

Share this post


Link to post
Share on other sites

@GrumpyOldMan
Thanks for the nice tests and demo. Where exactly is spine1?
 
Haven't been able to play in awhile, but don't remember headshots being overly ridiculous. A bit frustrating, but not outside the realm of believability.
 
Not at the same ranges, but while airsofting, most hits are chest, head and arms. Rarely shot anywhere below nipples. And if I am, its often while crouched. Arms are hit because i'm holding the gun infront of me. Head is shot probably 30-40% of the time because its often only the head and a bit of the weapon/arm I am exposing. 
 
Though I can't find it now, read an article years back, about troops being accused of executing taliban due to overwhelming number of head wounds amongst the dead. Turns out troops were just good at popping skulls. Article said the main reason was increasing number of magnified optics being used. 
 
So, based on that, i'd expect headshots to occur more often than the head's relative size might suggest. 
 
That being said, with untrained shooters, or shooters under a bit of stress, I wouldn't be expecting every other hit to be a head/centre of mass.
 

 
Good shooting there. But how often is it that you take that time to aim so precisely in firefights. Time increases odds of getting hit, and targets could move or take cover. Unless I have a big advantage or the fight hasn't kicked off yet, I am shooting more rapidly with less precision. Potentially where Ai could improve - they do good at starting inaccurate and zeroing in on you if you don't move/hide and they aren't under fire - Devs have done a great job there. But, when they start to line up accurate shots, their rate of fire remains the same. Think they should shoot slower like you did, as they get more accurate. Might help prevent the "miss, miss, miss, miss, BLAMBLAMinstantdeath" that people find off putting.
 
Just an idea. Honestly if you use cover and react sensibly to incoming fire immediately the ai have a really hard time killing you.

Share this post


Link to post
Share on other sites

Are you sure you are hitting with all your shots?

And I find it quite reasonable to only be able to take 1-2 shots. I actually like what I see in your video. You get quite a few bullets your way until he hits you.

Yes. But when he hits me (when i'm crouched) - there is only 1 hit and i'm dead. That happen too often in mentioned circumstates.

Share this post


Link to post
Share on other sites

@GrumpyOldMan

Thanks for the nice tests and demo. Where exactly is spine1?

 

Haven't been able to play in awhile, but don't remember headshots being overly ridiculous. A bit frustrating, but not outside the realm of believability.

 

Not at the same ranges, but while airsofting, most hits are chest, head and arms. Rarely shot anywhere below nipples. And if I am, its often while crouched. Arms are hit because i'm holding the gun infront of me. Head is shot probably 30-40% of the time because its often only the head and a bit of the weapon/arm I am exposing. 

 

Though I can't find it now, read an article years back, about troops being accused of executing taliban due to overwhelming number of head wounds amongst the dead. Turns out troops were just good at popping skulls. Article said the main reason was increasing number of magnified optics being used. 

 

So, based on that, i'd expect headshots to occur more often than the head's relative size might suggest. 

 

That being said, with untrained shooters, or shooters under a bit of stress, I wouldn't be expecting every other hit to be a head/centre of mass.

 

 

Good shooting there. But how often is it that you take that time to aim so precisely in firefights. Time increases odds of getting hit, and targets could move or take cover. Unless I have a big advantage or the fight hasn't kicked off yet, I am shooting more rapidly with less precision. Potentially where Ai could improve - they do good at starting inaccurate and zeroing in on you if you don't move/hide and they aren't under fire - Devs have done a great job there. But, when they start to line up accurate shots, their rate of fire remains the same. Think they should shoot slower like you did, as they get more accurate. Might help prevent the "miss, miss, miss, miss, BLAMBLAMinstantdeath" that people find off putting.

 

Just an idea. Honestly if you use cover and react sensibly to incoming fire immediately the ai have a really hard time killing you.

 

About spine1, selectionposition doesn't return anything useful, I guess it's the first area below the neck, continuing down to spine3 until pelvis. Just a guess though.

The videos purpose was just to demonstrate that AI with ironsights just won't fire back at that distance, to counter those "I got instant headshot from AI with ironsights at 400m" arguments.

 

Considering the situation, at 400m without a decent scope/rangefinder you can't tell which weapon or gear the enemy has. I usually like it up close and personal, the AA-12 was my baby back in A2.

Tanoa is a godsend for those close quarter situations. It is actually astounding how you can outmaneuver AI groups just to show up at their flank, seeing that they still try to push forward to your last known location.

 

There's also quite a few people claiming AI can spot you too easy from audible cues alone. This is what I believe just another myth, since you can slow walk up to 5 meters behind an enemy soldier without being spotted.

Unless you're sprinting with a Titan, Lynx and Bergen backpack.

It has never been easier to set up a "Commandos" style mission in arma, the AI is actually really authentic in the current state of the game.

 

I agree with your fire rate part, it should go down to 1.3 shots every ten seconds at higher ranges, but be more accurate.

AI subskills are good for a rough tweak but they're somewhat too abstract and application in game can be cartoonish at most,

just give a M134 door gunner a low accuracy skill, they will spray bullets in a 80m circle around the target, tracers really make this obvious.

 

Cheers

Yes. But when he hits me (when i'm crouched) - there is only 1 hit and i'm dead. That happen too often in mentioned circumstates.

 

Where is the problem with that? It has been explained a few times already, if you crouch or you go prone the bullet will move through multiple parts of your body, doing incredible damage and therefor killing you with a single hit.

That's not an AI accuracy bug.

If this happens during regular gameplay and not for debugging/testing purposes you'd move into cover, hard cover at best. Or wouldn't you?

 

Cheers

Share this post


Link to post
Share on other sites

Problem is, i wasnt phrone, i was crouch

The problem is you stayed static in the crouch, immediately coming under fire he went prone...

 

That's a BIG advantage he has over you already, his aim is steadier, but it still takes 3-4 rounds before the 1st one strikes or kills you, you're presenting yourself as one big static target, he wasn't getting one shot kills on you.

I wouldn't say this was a bug at all, I'd say this was pretty realistic

 

Doesn't matter where he hits you in that face/head triangle, you will die, also the body armour only covers the chest/abdomen area, a round hitting can be a fatal one, the lungs go all the way up into the collar bone, and getting hit between the pectoral and the shoulder, can still potentially kill you if it severs the brachial artery, or cause a tension pneumothorax.

Try the same test with both of you going prone, and see what the results are ??

  • Like 1

Share this post


Link to post
Share on other sites

The problem is you stayed static in the crouch, immediately coming under fire he went prone...

 

That's a BIG advantage he has over you already, his aim is steadier, but it still takes 3-4 rounds before the 1st one strikes or kills you, you're presenting yourself as one big static target, he wasn't getting one shot kills on you.

I wouldn't say this was a bug at all, I'd say this was pretty realistic

 

Doesn't matter where he hits you in that face/head triangle, you will die, also the body armour only covers the chest/abdomen area, a round hitting can be a fatal one, the lungs go all the way up into the collar bone, and getting hit between the pectoral and the shoulder, can still potentially kill you if it severs the brachial artery, or cause a tension pneumothorax.

Try the same test with both of you going prone, and see what the results are ??

You didnt undertsand. I wasnt trying to hit him on further testing, i just wanted to get his attention to show you how many times I GOT HIT to die.

@ Grumpy Old Man - Crouching vs standing - chest, stomach is uncovered the same way, thats not excusion.

PS what, where is the script to make bullet tracers stay as in virtual arsenal?

Share this post


Link to post
Share on other sites

road runner basically said everything there is to say, AI is fine.

_trace = [player] call BIS_fnc_traceBullets

Going to post my own debug script once it's a bit more fleshed out.

 

Cheers

  • Like 1

Share this post


Link to post
Share on other sites

Very interesting numbers. It would be great to know though, how those hits spread over time. Would it be possible to tweak your script to get statistical distribution of the first 3 shots, for example?

Share this post


Link to post
Share on other sites

Sure, what do you want to have measured?

I could measure how close bullets pass by the target or what data do you want measured from the first three shots?

Projectile distance checks are still a bit rough though even with stacked onEachFrame and 60fps.

 

Cheers

Share this post


Link to post
Share on other sites

If and where the first three shots hit is what I have in mind.

Share this post


Link to post
Share on other sites

If and where the first three shots hit is what I have in mind.

 

Here you go, simply paste this into your debug console:


GOM_fnc_debugUnitFiringAccuracy = {

    params [ ["_unit", player]];

        GOM_fnc_debugTargetInit = {

        params ["_target"];
        _target addEventHandler ["Killed", {

            _report = _this spawn {

                params ["_target", "_killer"];

                _killerASL = getPosASLVisual _killer;
                _unitASL = getPosASLVisual _target;
                playsound "click";
                systemchat "...Waiting for last bullet to land...";

                waituntil {_killer getVariable ["GOM_debug_bulletFlightTime", -1] > 0};

                _hitsTilDeath = _target getVariable ["GOM_fnc_HitsTilDeath", []];
                _initPos = _target getVariable ["GOM_fnc_InitPos", getposatl _target];
                _flightTime = _killer getVariable ["GOM_debug_bulletFlightTime", -1];

                if (isPlayer _killer) then {

                    _distance = [(_killerASL distance _unitASL), 2] call BIS_fnc_cutDecimals;
                    _altDifference = [((_killerASL select 2) - (_unitASL select 2)), 2] call BIS_fnc_cutDecimals;
                    _shotsFired = _killer getvariable ["GOM_debug_shotsFired", 0];
                    _percent = [(count _hitsTilDeath / _shotsFired) * 100, 2] call BIS_fnc_cutDecimals;
                    _text = format ["Dist: %1m\nAltDiff: %2m\nShots needed: %3\nHits: %4\nLethal Shot: %5\nProjectile flight time: %6s\nShot accuracy: %7%8", _distance, _altDifference, _shotsFired, ( [_hitsTilDeath] call BIS_fnc_consolidateArray), (_hitsTilDeath select (count _hitsTilDeath - 1)), ( [_flightTime, 2] call BIS_fnc_cutDecimals), _percent, "%"];
                    _killer setvariable ["GOM_debug_bulletFlightTime", -1];
                    _killer setvariable ["GOM_debug_shotsFired", 0];

                    hint _text;

                    playsound "click";

                    _delete = _target spawn {

                        sleep 5;
                        deletevehicle _this;
                        true
                    };

                }

            }

        }];


        _target addEventHandler ["HitPart", {

            {

                _x params ["_target", "_shooter", "_bullet", "_position", "_velocity", "_selectionName", "_ammo", "_direction", "_radius", "_surface", "_direct"];

                _hitsTilDeath = _target getVariable ["GOM_fnc_HitsTilDeath", []];
                _selCheck = !(_selectionName isEqualTo "");
                _directText = "direct";

                if !(_direct) then {_directText = "indirect"};

                _selections = _selectionName joinString "+";

                if (_selCheck) then {

                    _hitsTilDeath append _selectionName;
                    _target setVariable ["GOM_fnc_HitsTilDeath", _hitsTilDeath];

                }

            } foreach _this;
        true
        }];
    true
    };

    GOM_fnc_trackEnemyShots = {

        params ["_enemy", ["_numberToTrack", 3]];
        _enemy setvariable ["GOM_debug_ShotsToTrack", _numberToTrack];
        GOM_list_debugShotPos = [];
        GOM_list_debugShotTextArray = [];

        _ID = _enemy addEventHandler ["Fired", {

            params ["_firer", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile"];
            _shotsFired = _firer getvariable ["GOM_debug_shotsFired", 0];
            _shotsToTrack = _firer getvariable ["GOM_debug_ShotsToTrack", 3];
            _shotsFired = _shotsFired + 1;
            _firer setVariable ["GOM_debug_shotsFired", _shotsFired];

            if (_shotsFired > _shotsToTrack) exitWith {

                _firer removeEventhandler ["Fired", (_firer getvariable ["GOM_fnc_trackEnemyShotsEH", -1])];

            };

            _ID = format ["%1%2%3", time, random 10000, getposatl _firer];

            [_ID, "onEachFrame", {

                params ["_bullet", "_initTime", "_ID", "_firer", "_shotsFired", "_shotsToTrack"];

                if !(isNull _bullet) then {

                    GOM_list_debugShotPos set [_shotsFired, getposasl _bullet];

                };

                if (isNull _bullet) then {

                    _text = format ["Shot %1 impact dist: %2m.", _shotsFired, ((GOM_list_debugShotPos select _shotsFired) distance getposasl player)];
                    GOM_list_debugShotTextArray set [_shotsFired,_text];
                    systemchat _text;
                    diag_log _text;
                    [_ID, "onEachFrame"] call BIS_fnc_removeStackedEventHandler;

                };

            }, [_projectile, time, _ID, _firer, _shotsFired, _shotsToTrack]] call BIS_fnc_addStackedEventHandler;

        }];

        _enemy setvariable ["GOM_fnc_trackEnemyShotsEH", _ID];
        true
    };

    GOM_fnc_Bulletcam = {

        params ["_firer"];

        _eh = _firer addeventhandler ["Fired", {

            params ["_firer", "", "", "", "", "", "_bullet"];
            _firer removeEventHandler ["Fired", (_firer getvariable ["GOM_fnc_diagBulletCam", -1])];
            _cam = "camera" camcreate getposatl _bullet;
            _cam cameraeffect ["internal", "back"];
            _cam camCommitPrepared 0;

            _ID = format ["%1%2%3", time, random 10000, getposatl _firer];

            [_ID, "onEachFrame", {

                params ["_bullet", "_cam", "_ID", "_firer"];
                _tarPos = getposASLVisual (_firer getVariable ['GOM_debug_target', objNull]);
                _bulPos = getPosASLVisual _bullet;
                _distCheck = _tarPos distancesqr _bulPos < 7500;


                if !(isNull _bullet AND _distCheck) then {

                    _cam camSetTarget _bullet;
                    _cam camSetRelPos [0, -3, 1];
                    _cam camCommitPrepared 0;

                };

                if (!(isNull _bullet) AND _distCheck) exitWith {

                    [_ID, "onEachFrame"] call BIS_fnc_removeStackedEventHandler;

                    _target = (_firer getVariable ['GOM_debug_target', objNull]);

                    if !(_target isEqualTo objNull) then {

                        _cam camSetTarget _target;
                        _cam camCommitPrepared 0;
                        _cam camSetRelPos [0, -4, 2];
                        _cam camCommitPrepared 0.8;

                    };

                    _delay = [_cam, _firer] spawn {

                    params ["_cam", "_firer"];
                    sleep 5;
                    _firer setvariable ['GOM_fnc_bulletCamActive', false];
                    _cam cameraeffect ["terminate", "back"];
                    camdestroy _cam;
                    true
                    };

                };

                if (isNull _bullet) then {

                    _delay = [_cam, _firer] spawn {

                    params ["_cam", "_firer"];
                    sleep 1;
                    _firer setvariable ['GOM_fnc_bulletCamActive', false];
                    _cam cameraeffect ["terminate", "back"];
                    camdestroy _cam;
                    true
                    };

                [_ID, "onEachFrame"] call BIS_fnc_removeStackedEventHandler;

                };

            }, [_bullet, _cam, _ID, _firer]] call BIS_fnc_addStackedEventHandler;

        }];

        _firer setvariable ["GOM_fnc_diagBulletCam", _eh];

    };

    _EHs = _unit getvariable ["GOM_debug_EHactive", []];

    if !(_unit getvariable ["GOM_debug_EHs", []] isEqualTo [])then {

        _EHs params ["_one", "_too"];
        _unit removeEventhandler ["Reloaded", _one];
        _unit removeEventhandler ["Fired", _too];
        _unit setvariable ["GOM_debug_EHactive", []];

    };


    if (_unit getvariable ["GOM_debug_EHs", []] isEqualTo []) then {


        _ID1 = _unit addEventHandler ["Reloaded", {

            params ["_unit", "_weapon", "_muzzle", "_newMag", "_oldMag"];
            _unit addMagazine (_oldMag select 0);

        }];


    _ID2 = _unit addEventHandler ["Fired", {

        params ["_firer", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile"];
        _shotsFired = _firer getvariable ["GOM_debug_shotsFired", 0];
        _shotsFired = _shotsFired + 1;
        _firer setVariable ["GOM_debug_shotsFired", _shotsFired];

        _ID = format ["%1%2%3", time, random 10000, getposatl _firer];

        [_ID, "onEachFrame", {

            params ["_bullet", "_initTime", "_ID", "_firer"];

            _firer setvariable ["GOM_debug_bulletFlightTime", -1];

            if (isNull _bullet) then {

                _firer setvariable ["GOM_debug_bulletFlightTime", abs (time - _initTime)];
                [_ID, "onEachFrame"] call BIS_fnc_removeStackedEventHandler;

            };

        }, [_projectile, time, _ID, _firer]] call BIS_fnc_addStackedEventHandler;

    }];

    _unit setvariable ["GOM_debug_EHactive", [_ID1, _ID2]]

    };



    if (isPlayer _unit) then {

        _unit addAction ["Create Target at screen center", "
        params ['_unit','_caller','_ID'];
        _side = selectRandom ([side _unit] call BIS_fnc_enemySides);
        _type = 'O_Soldier_F';
        if (screenToWorld [0.5,0.5] isEqualTo [0,0,0]) exitWith {true};
        playsound 'click';

        _soldier = creategroup _side createUnit ['O_Soldier_F',screenToWorld [0.5,0.5],[],0,'NONE'];
        if (isNil '_soldier') exitWith {true};
        _soldier setdir random 360;
        1 preloadObject _soldier;
        _soldier lookat ([getposatl _soldier,100,random 360] call BIS_fnc_relPos);
        _sName = getText (configfile >> 'CfgVehicles' >> _type >> 'displayName');
        _altDiff = [((getposasl _unit) select 2) - ((getposasl _soldier) select 2),2] call BIS_fnc_cutDecimals;
        _dist = [getPosASLVisual _soldier distance getPosASLVisual _unit,2] call BIS_fnc_cutDecimals;
        hint format ['%1. Dist: %2m. AltDiff: %3m',_sName,_dist,_altDiff];
        _trace = [_soldier,10] call BIS_fnc_traceBullets;
        [_soldier] call GOM_fnc_debugTargetInit;
        [_soldier] call GOM_fnc_trackEnemyShots;
        _caller setvariable ['GOM_debug_shotsFired',0];
        _caller setVariable ['GOM_debug_target',_soldier];
        ", [], 6, false, true, "", "cameraView isEqualTo 'GUNNER'"];

        _unit addAction ["Create Trench at your position+direction", "
        params ['_unit','_caller','_ID'];
        _trench = 'Land_Trench_01_forest_F' createVehicle [0,0,0];
        _trench setdir getdir _unit;
        _trench setposATL getposATL _unit;
        hint '--Trench placed--';

        playsound 'click';
        _unit setvariable ['GOM_fnc_trenchPos',getposatl _trench];
        ", [], 0, false, true, "", "(_target getvariable ['GOM_fnc_trenchPos',[0,0,0]]) distance2d getposatl _this > 5"];

        _unit addAction ["Bulletcam for next shot", "
        params ['_unit','_caller','_ID'];
        _bcam = [_unit] call GOM_fnc_Bulletcam;
        _unit setvariable ['GOM_fnc_bulletCamActive',true];
        hint '--Bulletcam active--';

        playsound 'click';
        ", [], 5, false, true, "", "!(_target getvariable ['GOM_fnc_bulletCamActive',false])"];


        _unit addAction ["Enable Bullettracing", "
        params ['_unit','_caller','_ID'];
        _bcam = [_unit] call BIS_fnc_traceBullets;
        _unit setvariable ['GOM_fnc_bullettrace',true];
        hint '--Bullettrace active--';

        playsound 'click';
        ", [], 5, false, true, "", "!(_target getvariable ['GOM_fnc_bullettrace',false])"];

        _unit addAction ["Disable Bullettracing", "
        params ['_unit','_caller','_ID'];
        _unit setvariable ['GOM_fnc_bullettrace',false];
        _ID = _unit getvariable ['BIS_bulletTrace_EHPool',[0]];
        {_unit removeEventhandler ['Fired',_x]} foreach _ID;
        hint '--Bullettrace disabled--';

        playsound 'click';
        ", [], 0, false, true, "", "(_target getvariable ['GOM_fnc_bullettrace',false])"];
        }
};
pewpew = [player] call GOM_fnc_debugUnitFiringAccuracy;

 

It's not where I want it to be, has a few extras in there too.

You can create a target unit at your screen center when in gunner view (looking through scope), everything goes from there.

Cheers

  • Like 2

Share this post


Link to post
Share on other sites

2016-07-2712_01_52-a3bsqmk.png
spine hitpoints marked red. pairs from bottom to top: spine1,spine2,spine3 (A3 character sample from Steam tools -> A3 samples )
you can display pernanent hitpoint status (and hitpoint spheres) using devbranch and arma3diag.exe instead of arma3.exe (diag_toggle "HitPoints";)

  • Like 1

Share this post


Link to post
Share on other sites

I just figured out, why rearming for AI is not working :
https://feedback.bistudio.com/T119623

If they would fix it in the way i described, we would have 50% less actions for AI on order list, and rearming would start working. At least i think so.

  • Like 1

Share this post


Link to post
Share on other sites

When asking my team to report in, only one team mate actually reports in. I am on stable.

 

Furthermore, the bug where an AI soldier changes from AT to primary constantly back and forth is present again. (Seems to only happen when in SAFE mode?!?)

  • Like 2

Share this post


Link to post
Share on other sites

Here you go, simply paste this into your debug console:


GOM_fnc_debugUnitFiringAccuracy = {

    params [ ["_unit", player]];

        GOM_fnc_debugTargetInit = {

        params ["_target"];
        _target addEventHandler ["Killed", {

            _report = _this spawn {

                params ["_target", "_killer"];

                _killerASL = getPosASLVisual _killer;
                _unitASL = getPosASLVisual _target;
                playsound "click";
                systemchat "...Waiting for last bullet to land...";

                waituntil {_killer getVariable ["GOM_debug_bulletFlightTime", -1] > 0};

                _hitsTilDeath = _target getVariable ["GOM_fnc_HitsTilDeath", []];
                _initPos = _target getVariable ["GOM_fnc_InitPos", getposatl _target];
                _flightTime = _killer getVariable ["GOM_debug_bulletFlightTime", -1];

                if (isPlayer _killer) then {

                    _distance = [(_killerASL distance _unitASL), 2] call BIS_fnc_cutDecimals;
                    _altDifference = [((_killerASL select 2) - (_unitASL select 2)), 2] call BIS_fnc_cutDecimals;
                    _shotsFired = _killer getvariable ["GOM_debug_shotsFired", 0];
                    _percent = [(count _hitsTilDeath / _shotsFired) * 100, 2] call BIS_fnc_cutDecimals;
                    _text = format ["Dist: %1m\nAltDiff: %2m\nShots needed: %3\nHits: %4\nLethal Shot: %5\nProjectile flight time: %6s\nShot accuracy: %7%8", _distance, _altDifference, _shotsFired, ( [_hitsTilDeath] call BIS_fnc_consolidateArray), (_hitsTilDeath select (count _hitsTilDeath - 1)), ( [_flightTime, 2] call BIS_fnc_cutDecimals), _percent, "%"];
                    _killer setvariable ["GOM_debug_bulletFlightTime", -1];
                    _killer setvariable ["GOM_debug_shotsFired", 0];

                    hint _text;

                    playsound "click";

                    _delete = _target spawn {

                        sleep 5;
                        deletevehicle _this;
                        true
                    };

                }

            }

        }];


        _target addEventHandler ["HitPart", {

            {

                _x params ["_target", "_shooter", "_bullet", "_position", "_velocity", "_selectionName", "_ammo", "_direction", "_radius", "_surface", "_direct"];

                _hitsTilDeath = _target getVariable ["GOM_fnc_HitsTilDeath", []];
                _selCheck = !(_selectionName isEqualTo "");
                _directText = "direct";

                if !(_direct) then {_directText = "indirect"};

                _selections = _selectionName joinString "+";

                if (_selCheck) then {

                    _hitsTilDeath append _selectionName;
                    _target setVariable ["GOM_fnc_HitsTilDeath", _hitsTilDeath];

                }

            } foreach _this;
        true
        }];
    true
    };

    GOM_fnc_trackEnemyShots = {

        params ["_enemy", ["_numberToTrack", 3]];
        _enemy setvariable ["GOM_debug_ShotsToTrack", _numberToTrack];
        GOM_list_debugShotPos = [];
        GOM_list_debugShotTextArray = [];

        _ID = _enemy addEventHandler ["Fired", {

            params ["_firer", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile"];
            _shotsFired = _firer getvariable ["GOM_debug_shotsFired", 0];
            _shotsToTrack = _firer getvariable ["GOM_debug_ShotsToTrack", 3];
            _shotsFired = _shotsFired + 1;
            _firer setVariable ["GOM_debug_shotsFired", _shotsFired];

            if (_shotsFired > _shotsToTrack) exitWith {

                _firer removeEventhandler ["Fired", (_firer getvariable ["GOM_fnc_trackEnemyShotsEH", -1])];

            };

            _ID = format ["%1%2%3", time, random 10000, getposatl _firer];

            [_ID, "onEachFrame", {

                params ["_bullet", "_initTime", "_ID", "_firer", "_shotsFired", "_shotsToTrack"];

                if !(isNull _bullet) then {

                    GOM_list_debugShotPos set [_shotsFired, getposasl _bullet];

                };

                if (isNull _bullet) then {

                    _text = format ["Shot %1 impact dist: %2m.", _shotsFired, ((GOM_list_debugShotPos select _shotsFired) distance getposasl player)];
                    GOM_list_debugShotTextArray set [_shotsFired,_text];
                    systemchat _text;
                    diag_log _text;
                    [_ID, "onEachFrame"] call BIS_fnc_removeStackedEventHandler;

                };

            }, [_projectile, time, _ID, _firer, _shotsFired, _shotsToTrack]] call BIS_fnc_addStackedEventHandler;

        }];

        _enemy setvariable ["GOM_fnc_trackEnemyShotsEH", _ID];
        true
    };

    GOM_fnc_Bulletcam = {

        params ["_firer"];

        _eh = _firer addeventhandler ["Fired", {

            params ["_firer", "", "", "", "", "", "_bullet"];
            _firer removeEventHandler ["Fired", (_firer getvariable ["GOM_fnc_diagBulletCam", -1])];
            _cam = "camera" camcreate getposatl _bullet;
            _cam cameraeffect ["internal", "back"];
            _cam camCommitPrepared 0;

            _ID = format ["%1%2%3", time, random 10000, getposatl _firer];

            [_ID, "onEachFrame", {

                params ["_bullet", "_cam", "_ID", "_firer"];
                _tarPos = getposASLVisual (_firer getVariable ['GOM_debug_target', objNull]);
                _bulPos = getPosASLVisual _bullet;
                _distCheck = _tarPos distancesqr _bulPos < 7500;


                if !(isNull _bullet AND _distCheck) then {

                    _cam camSetTarget _bullet;
                    _cam camSetRelPos [0, -3, 1];
                    _cam camCommitPrepared 0;

                };

                if (!(isNull _bullet) AND _distCheck) exitWith {

                    [_ID, "onEachFrame"] call BIS_fnc_removeStackedEventHandler;

                    _target = (_firer getVariable ['GOM_debug_target', objNull]);

                    if !(_target isEqualTo objNull) then {

                        _cam camSetTarget _target;
                        _cam camCommitPrepared 0;
                        _cam camSetRelPos [0, -4, 2];
                        _cam camCommitPrepared 0.8;

                    };

                    _delay = [_cam, _firer] spawn {

                    params ["_cam", "_firer"];
                    sleep 5;
                    _firer setvariable ['GOM_fnc_bulletCamActive', false];
                    _cam cameraeffect ["terminate", "back"];
                    camdestroy _cam;
                    true
                    };

                };

                if (isNull _bullet) then {

                    _delay = [_cam, _firer] spawn {

                    params ["_cam", "_firer"];
                    sleep 1;
                    _firer setvariable ['GOM_fnc_bulletCamActive', false];
                    _cam cameraeffect ["terminate", "back"];
                    camdestroy _cam;
                    true
                    };

                [_ID, "onEachFrame"] call BIS_fnc_removeStackedEventHandler;

                };

            }, [_bullet, _cam, _ID, _firer]] call BIS_fnc_addStackedEventHandler;

        }];

        _firer setvariable ["GOM_fnc_diagBulletCam", _eh];

    };

    _EHs = _unit getvariable ["GOM_debug_EHactive", []];

    if !(_unit getvariable ["GOM_debug_EHs", []] isEqualTo [])then {

        _EHs params ["_one", "_too"];
        _unit removeEventhandler ["Reloaded", _one];
        _unit removeEventhandler ["Fired", _too];
        _unit setvariable ["GOM_debug_EHactive", []];

    };


    if (_unit getvariable ["GOM_debug_EHs", []] isEqualTo []) then {


        _ID1 = _unit addEventHandler ["Reloaded", {

            params ["_unit", "_weapon", "_muzzle", "_newMag", "_oldMag"];
            _unit addMagazine (_oldMag select 0);

        }];


    _ID2 = _unit addEventHandler ["Fired", {

        params ["_firer", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile"];
        _shotsFired = _firer getvariable ["GOM_debug_shotsFired", 0];
        _shotsFired = _shotsFired + 1;
        _firer setVariable ["GOM_debug_shotsFired", _shotsFired];

        _ID = format ["%1%2%3", time, random 10000, getposatl _firer];

        [_ID, "onEachFrame", {

            params ["_bullet", "_initTime", "_ID", "_firer"];

            _firer setvariable ["GOM_debug_bulletFlightTime", -1];

            if (isNull _bullet) then {

                _firer setvariable ["GOM_debug_bulletFlightTime", abs (time - _initTime)];
                [_ID, "onEachFrame"] call BIS_fnc_removeStackedEventHandler;

            };

        }, [_projectile, time, _ID, _firer]] call BIS_fnc_addStackedEventHandler;

    }];

    _unit setvariable ["GOM_debug_EHactive", [_ID1, _ID2]]

    };



    if (isPlayer _unit) then {

        _unit addAction ["Create Target at screen center", "
        params ['_unit','_caller','_ID'];
        _side = selectRandom ([side _unit] call BIS_fnc_enemySides);
        _type = 'O_Soldier_F';
        if (screenToWorld [0.5,0.5] isEqualTo [0,0,0]) exitWith {true};
        playsound 'click';

        _soldier = creategroup _side createUnit ['O_Soldier_F',screenToWorld [0.5,0.5],[],0,'NONE'];
        if (isNil '_soldier') exitWith {true};
        _soldier setdir random 360;
        1 preloadObject _soldier;
        _soldier lookat ([getposatl _soldier,100,random 360] call BIS_fnc_relPos);
        _sName = getText (configfile >> 'CfgVehicles' >> _type >> 'displayName');
        _altDiff = [((getposasl _unit) select 2) - ((getposasl _soldier) select 2),2] call BIS_fnc_cutDecimals;
        _dist = [getPosASLVisual _soldier distance getPosASLVisual _unit,2] call BIS_fnc_cutDecimals;
        hint format ['%1. Dist: %2m. AltDiff: %3m',_sName,_dist,_altDiff];
        _trace = [_soldier,10] call BIS_fnc_traceBullets;
        [_soldier] call GOM_fnc_debugTargetInit;
        [_soldier] call GOM_fnc_trackEnemyShots;
        _caller setvariable ['GOM_debug_shotsFired',0];
        _caller setVariable ['GOM_debug_target',_soldier];
        ", [], 6, false, true, "", "cameraView isEqualTo 'GUNNER'"];

        _unit addAction ["Create Trench at your position+direction", "
        params ['_unit','_caller','_ID'];
        _trench = 'Land_Trench_01_forest_F' createVehicle [0,0,0];
        _trench setdir getdir _unit;
        _trench setposATL getposATL _unit;
        hint '--Trench placed--';

        playsound 'click';
        _unit setvariable ['GOM_fnc_trenchPos',getposatl _trench];
        ", [], 0, false, true, "", "(_target getvariable ['GOM_fnc_trenchPos',[0,0,0]]) distance2d getposatl _this > 5"];

        _unit addAction ["Bulletcam for next shot", "
        params ['_unit','_caller','_ID'];
        _bcam = [_unit] call GOM_fnc_Bulletcam;
        _unit setvariable ['GOM_fnc_bulletCamActive',true];
        hint '--Bulletcam active--';

        playsound 'click';
        ", [], 5, false, true, "", "!(_target getvariable ['GOM_fnc_bulletCamActive',false])"];


        _unit addAction ["Enable Bullettracing", "
        params ['_unit','_caller','_ID'];
        _bcam = [_unit] call BIS_fnc_traceBullets;
        _unit setvariable ['GOM_fnc_bullettrace',true];
        hint '--Bullettrace active--';

        playsound 'click';
        ", [], 5, false, true, "", "!(_target getvariable ['GOM_fnc_bullettrace',false])"];

        _unit addAction ["Disable Bullettracing", "
        params ['_unit','_caller','_ID'];
        _unit setvariable ['GOM_fnc_bullettrace',false];
        _ID = _unit getvariable ['BIS_bulletTrace_EHPool',[0]];
        {_unit removeEventhandler ['Fired',_x]} foreach _ID;
        hint '--Bullettrace disabled--';

        playsound 'click';
        ", [], 0, false, true, "", "(_target getvariable ['GOM_fnc_bullettrace',false])"];
        }
};
pewpew = [player] call GOM_fnc_debugUnitFiringAccuracy;

 

It's not where I want it to be, has a few extras in there too.

You can create a target unit at your screen center when in gunner view (looking through scope), everything goes from there.

Cheers

 

Thanks. I'll see what I can do.

Share this post


Link to post
Share on other sites

When asking my team to report in, only one team mate actually reports in. I am on stable.

I think it's done that way with purpose. If the whole group is alright and in the same spot only the highest ranked report back. That means the rest are ok too. 

  • Like 2

Share this post


Link to post
Share on other sites

Thanks. I'll see what I can do.

Geez, guys, do you really have to quote all that wall of text to add one line of text? Please, cut down your replies.

Send from my tablet, so pardon any autocorrect bollocks

  • Like 5

Share this post


Link to post
Share on other sites

When asking my team to report in, only one team mate actually reports in. I am on stable.

 

Furthermore, the bug where an AI soldier changes from AT to primary constantly back and forth is present again. (Seems to only happen when in SAFE mode?!?)

Confirm. AT > rifle > AT > rifle. They seem to have too much on their head, they cannot decide where to shoot :D Some priorities of targets need update.

Share this post


Link to post
Share on other sites

Furthermore, the bug where an AI soldier changes from AT to primary constantly back and forth is present again. (Seems to only happen when in SAFE mode?!?)

What are the repro steps, please?

Does it look like an anim. loop bug or is it the situation when AI switches to rifle to move in order to keep formation position?

Share this post


Link to post
Share on other sites

What are the repro steps, please?

Does it look like an anim. loop bug or is it the situation when AI switches to rifle to move in order to keep formation position?

 

No clue, sorry. If I had a way to repro it, I would have posted it. I'll try to gather more infos when I place some sp missions later.

Share this post


Link to post
Share on other sites

What are the repro steps, please?

Does it look like an anim. loop bug or is it the situation when AI switches to rifle to move in order to keep formation position?

 

I've seen this before when you try use forceWeaponFire and the AI kept switching between his launcher and rifle, not got the code to hand as I was playing with it a while ago.

Share this post


Link to post
Share on other sites

What are the repro steps, please?

Does it look like an anim. loop bug or is it the situation when AI switches to rifle to move in order to keep formation position?

It looks more like problem with target choose - if AT gunner see infantry and vehicle - the bug should occur.

Share this post


Link to post
Share on other sites

Would it be possible to get more stuff for AI suppression? Stuff like a command to adjust how much it affects the AI, how much fire it requires to take them upto maximum suppression and the like. 

Share this post


Link to post
Share on other sites

Here you go, simply paste this into your debug console:

 

Thanks for sharing GOM. Tried it but couldn't get it to work, am I missing something?

 

/KC

Share this post


Link to post
Share on other sites

Thanks for sharing GOM. Tried it but couldn't get it to work, am I missing something?

 

/KC

Just paste it to your debug console.

Nothing more to it.

If you still got questions PM me to keep the thread clean.

 

Cheers

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

×