Jump to content
Mekrell

"Suicide bomber" with damaging area instead of exploding

Recommended Posts

Heya so i have been looking at 2 scripts pretty much and i want to combine these as well as the spoopy function but as i am new to scripting in sqf i honestly have little clue as to how to go about it

 

The  first script as the title suggests is the suicide bomber script made by zooloo75 in this post: 

 

The second script being this killing players through exposure made/shown by DayZ medic in this video: 


So basically im trying to make a unit that runs at the player group and when within a certain range it will run the exposure script for the players inside said area around the unit

im thinking its probably easiest to "replace" the explosive part of the suicide bomber script aka this part

{

        _runCode = 0;

        _explosive = _explosiveClass createVehicle (position _bomber);

        [_bomber] spawn {_bomber = _this select 0; sleep 2; _bomber say3D "shout"; _explosive setDamage 1; _bomber addRating -10000000;};

        [_explosive,_bomber] spawn {_explosive = _this select 0; _bomber = _this select 1; waitUntil {!alive _bomber}; deleteVehicle _explosive;};

            if(round(random(1)) == 0) then

            {

            _explosive attachTo [_bomber,[-0.02,-0.07,0.042],"rightHand"];

            }

            else

            {

            _explosive attachTo [_bomber,[-0.02,-0.07,0.042],"leftHand"];

            };

        };

with the exposure script but again im very new to sqf and scripting so im a bit at a loss for how to go about it...

I hope someone can help as i have been looking around the forum for quite a bit now especially the AI script compilation (great help for searching!)

Share this post


Link to post
Share on other sites

While i have had time i have been trying to make a restructure myself and so far i have gotten this:

_bomber = _this select 0;

_targetSide = _this select 1;

_info = [_bomber,_targetSide];

Pcolor = 1;

Pbright = 1;

Pgrain = 0.005;

Pblur = 0;

Pdamage = 0;

Pstamina = 60;

while {alive _bomber} do {

    _nearUnits = nearestObjects [_bomber,["CAManBase"],70];

    _nearUnits = _nearUnits - [_bomber];

    {

        if(!(side _x in _targetSide)) then {_nearUnits = _nearUnits - [_x];};

    } forEach _nearUnits;

    if(count _nearUnits != 0) then {

        _pos = position (_nearUnits select 0);

        _bomber doMove _pos;

        waitUntil {_bomber distance _pos < 2};

        while {_bomber distance (_nearUnits select 0) < 2 && alive (_nearUnits select 0)} do {

            _nearUnits select 0 setDammage Pdamage;

            _nearUnits select 0 setStamina Pstamina;

            "colorCorrections" ppEffectAdjust [Pbright, 1, 0, [1, 1, 1, 0], [1, 1, 1, Pcolor], [0.75, 0.25, 0, 1.0]]; 

            "colorCorrections" ppEffectCommit 1; 

            "colorCorrections" ppEffectEnable TRUE; 

            "filmGrain" ppEffectAdjust [Pgrain, 1, 1, 0, 1]; 

            "filmGrain" ppEffectCommit 1; 

            "filmGrain" ppEffectEnable TRUE;

            "DynamicBlur" ppEffectAdjust [Pblur];

            "DynamicBlur" ppEffectCommit 1;

            "DynamicBlur" ppEffectEnable TRUE;

            Pcolor = Pcolor - 0.04;

            Pbright = Pbright - 0.03;

            Pblur = Pblur + 0.1;

            Pgrain = Pgrain + 0.0015;

            Pdamage = Pdamage + 0.03;

            Pstamina = Pstamina - 2;

            sleep 0.6;

        

        };

    };

    

    sleep 1;

};

 

but well it still doesnt work and as the post originally suggested im very lacking in knowledge when it comes to sqf and how to structure it so any input/help is appreciated

Share this post


Link to post
Share on other sites

Okay so I managed to figure it out and basically I restructured it properly Just instead of putting the script run command [bomber,[WEST]] execVM "meleebadtimes.sqf"; in a trigger i have it in my init.sqf file for the mission and now it works for every unit I name "bomber" although I should probably change that (overall i wanted to make an invinsible enemy with the "this setVariable ["GOM_fnc_spoopy",true];" in a unit's init and go into melee and cause a person to quickly get bad and die as im trying to make an SCP like mission without needing mods that add in creepy units

 

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

×