Jump to content
Sign in to follow this  
Mr.jizz

Drawline3d/DrawIcon3d MP?

Recommended Posts

so iv adapted this script to use as a predator style lazer pointer, it all works great as 'player' but when i change it to run on an 'AI' nothing shows up, so what im guess is, do i need to do something to make it multiplayer friendly?....

 

heres my script (checked with 'nvg' and the ai has the irlaser turned on etc, still drawline3d doesn't show)....

testman1 enableIRLasers true;
testman1 setBehaviour "COMBAT";

["babe_laser", "onEachFrame", {

if (testman1 isIRLaserOn currentWeapon testman1) then
{
    

    _lasercolourr = [1,0,0,1.5-sunOrmoon]; // first 3 numbers are RGB
	_lasercolourrr = [1,0,0,1.5-sunOrmoon]; // first 3 numbers are RGB
	_lasercolourg = [0,1,0,1.5-sunOrmoon]; // first 3 numbers are RGB
	_lasercolourb = [0,0,1,1.5-sunOrmoon]; // first 3 numbers are RGB
	
    _range = 250; // laser range

    _maxsize = 0.015; 

    _rwrist = (testman1 selectionPosition "rwrist");
    _start = testman1 modeltoworld [_rwrist select 0, (_rwrist select 1) + 0, (_rwrist select 2) + 0.1];

    _lstart = atltoasl(testman1 modeltoworld _rwrist);

    _lend = (testman1 weaponDirection currentWeapon testman1) vectorMultiply _range;
	
    _end = asltoatl(_lend vectoradd _lstart);

    _int = lineIntersectsSurfaces [atltoasl _start, atltoasl _end, testman1, objNull, true, 1, "GEOM", "NONE"];

    _endL = _end;

    _size = _maxsize;
	
	_offsetend1 = _endL vectorAdd [0,0,0.5];
	_offsetend2 = _endL vectorAdd [1,-1,-1];
	_offsetend3 = _endL vectorAdd [-1,1,-1];




    if (count _int > 0) then
    {
        _end = (_int select 0) select 0;
        _endL = asltoagl _end;

        _length = _lstart vectorDistance _end;

        

        if (_length >= _range) then
        {
            _size = 0
        } else
        {
            _size = _maxsize*_range/(_length);
        };
        if (_length < 1) then
        {
            _size = 0;
        };
    } else
    {
        _size = 0
    };

    drawLine3D [_start, _endL, _lasercolourrr]; // comment this out to remove the line
	
drawIcon3D ["\a3\data_f\car_light_flare2.paa", _lasercolourr, _offsetend1 ,_size, _size, random 360, "", 0, 1, "PuristaMedium"];
drawIcon3D ["\a3\data_f\car_light_flare2.paa", _lasercolourr, _offsetend2 ,_size, _size, random 360, "", 0, 1, "PuristaMedium"];
drawIcon3D ["\a3\data_f\car_light_flare2.paa", _lasercolourr, _offsetend3 ,_size, _size, random 360, "", 0, 1, "PuristaMedium"];
};

}] call BIS_fnc_addStackedEventHandler;

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  

×