Jump to content
Sign in to follow this  
clock_x

Question about bDetect FiredEH array

Recommended Posts

Hey,

 

I got a quick question about bDetect.

 

I just want to pass more strings from the fired EH to my callback function.

At the moment I can only get this from bdetect.sqf:

    _unit = _this select 0;        // unit being under fire
    _shooter = _this select 1;    // shooter
    _bullet = _this select 2;    // bullet object
    _bpos = _this select 3;    // bullet position
    _pos = _this select 4;    // starting position of bullet
    _time = _this select 5; // starting time of bullet
    _proximity = _pos distance _unit;    // distance between _bullet and _unit
    _enemybulletcount = _unit getvariable ["detect_enemybulletcount", 0]; //enemy bullet count

I want the fired weapon and maybe the ammo too.

I tried adding _weapon = this select 6; at different positions like my callback function and the prototype callback function in bdetect.sqf but nothing works.

The fired EH array is defined in bDetect.sqf line 235+:

// Fired EH payload
bdetect_fnc_fired =
{
     private ["_unit", "_weapon", "_muzzle", "_magazine", "_bullet", "_speed", "_msg", "_time", "_dt"];

    if( bdetect_enable ) then
    {
        _unit = _this select 0;
        _weapon = _this select 1;
        _muzzle = _this select 2;
        _mode = _this select 3;
        _ammo = _this select 4;
        _magazine = _this select 5;
        _bullet = _this select 6;
        _speed = speed _bullet;
        _time = time; //diag_tickTime
        _dt = _time - ( _unit getVariable ["bdetect_fired_time", 0] );

[...]

Here is a link to bdetect.sqf:

https://github.com/fabrizioT/bDetect

The reason I want _weapon is to give a different reveal value for unsilenced sniper rifles, I could try to use the bullets instead but I feel it's not that reliable.

 

Also I was asking myself the question if I can find a way that, for example, in a situation were multiple units get incoming shots only one of them executes the code and not all of them, to avoid executing the code like 5x at the same time. But I'm pretty puzzled about it.

But I may just keep discarding the subsonic ammo and basically only use it for sniper rifle detection, that way it isn't much of a problem.

 

Cheers

 

//EDIT: Nevermind found a work around.

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  

×