Jump to content

Recommended Posts

Hello! :D

I'm trying to make a suicide bomber script.

 

The suicide bomber will start shouting and then blow himself.

 

I defined a distance that the player have to be near the suicide bomber.

But it doesn't work, I obviously did something wrong.

 

I'd apperciate it if you guys tell me what's that. :)

_nearestdist=15;
{
 _dist = vehicle _x distance sb1;
 if (isPlayer _x and _dist < _nearestdist) then
 {

	nul = [sb1,"sbshout"] call fn_netSay3D;
		sleep 1;
			"Bo_GBU12_LGB" createVehicle (getPos "sb1");
 };
}

Share this post


Link to post
Share on other sites

There are couple of syntax errors but the main architecture are even worst.

 

You need to make the bomber fallow the nearest player than explode when he is closer than defined distance and still alive

Share this post


Link to post
Share on other sites

params ["_bomber"];

if((_bomber distance player) <15) then

{

"Bo_GBU12_LGB" createVehicle (getPosATL _bomber);

};

start with that...

Share this post


Link to post
Share on other sites

I have seen other bomber scripts out there, perhaps they can help you recreate one for your use. I use goggle. I always have issues with bomber scripts and MP use. Good luck!

 

Hey davidoss, show some love for the guy hes trying!

  • Like 1

Share this post


Link to post
Share on other sites

Here is my suicide bomber script that I have been using for awhile.  I think I modified it from another one out there but I can't remember where.  It works great in MP and on dedicated.  I usually name my Bombers as Bomber_1, Bomber_2 and ID them by the script call as such, but you probablly can just use 'this'.  I keep forgetting to verify.   Example usage: If your bomber is called BomberDude, put this in the init field:  null = [bomberDude,1000] execVM "Scripts\Bomber_snackbar.sqf";   

 

This is assuming you have a Scripts folder and your sqf is named Bomber_snackbar.sqf

Change the second value to whatever distance you want for the bomber to start heading toward your unsuspecting players.

 

// Checks if player is within X meters, moves toward them if they are.
// Will chose a new target player if another comes closer.
// Detonates upon getting within 5 meters of player
// Includes dead man switch (detonates upon death)
// Usage: null = [Bomber,1000] execVM "Scripts\Bomber_snackbar.sqf";

private ["_bomber","_targetdistance","_detonated"];
_bomber = _this select 0;
_targetdistance = _this select 1;
_detonated = 0;

While {alive _bomber} do 
{
	_nearest = objNull;
	_nearestdist = _targetdistance;
	{
		_dist= vehicle _x distance _bomber;
		if (isPlayer _x and _dist < _nearestdist) then
		{
			_nearest= _x;
			_nearestdist = _dist;
		};
	} forEach playableUnits;

	if (!isNull _nearest) then
	{
		_bomber move getPos _nearest;

		if ((_bomber distance _nearest)< 5) then
		{
			_detonated = 1;
			_bomber  say ["snackbar", 40];
			sleep 1.5;
			_bomb = "Bomb_03_F" createVehicle getPos _bomber;

		};
	}
	else
	{
		_bomber moveTo getPos _bomber;
		sleep 1;
	};
	sleep 2;
};

// dead man's switch
if (_detonated < 1) then
{
	sleep 3;
	_bomb = "Bomb_03_F" createVehicle getPos _bomber;      
};

For the "Say" part to work, the caveat is this you need to make a description.ext entry too:

class CfgSounds 
{
   class snackbar
	{
		// how the sound is referred to in the editor (e.g. trigger effects)
		name = "bomber_snackbar";
		// filename, volume, pitch
		sound[] = {"sfx\snackbar.ogg", 1, 1};
		// subtitle delay in seconds, subtitle text 
		titles[] = {0, "Allahu Ackar!"};
	};

};

This will have the effect of a bomber running up to the closest player, yelling whatever snackbar is, and displaying the text just long enough for your player to either go "huh?" or "oh crap!" before their immediate demise.   Also includes a dead man's switch.  If the bomber gets close enough, you're toast.  Enjoy!

Share this post


Link to post
Share on other sites

For better immersion i would attach some charges to the bomber guy.

_explosives = selectRandom ["SatchelCharge_Remote_Ammo", "DemoCharge_Remote_Ammo", "ClaymoreDirectionalMine_Remote_Ammo"];


_expl = _explosives createVehicle (position _bomber);
_expl attachTo [_bomber, [0,0.15,0.15],"Pelvis"];
_expl setVectorDirAndUp [[1,0,0],[0,1,0]];

Share this post


Link to post
Share on other sites

 

Here is my suicide bomber script that I have been using for awhile.  I think I modified it from another one out there but I can't remember where.  It works great in MP and on dedicated.  I usually name my Bombers as Bomber_1, Bomber_2 and ID them by the script call as such, but you probablly can just use 'this'.  I keep forgetting to verify.   Example usage: If your bomber is called BomberDude, put this in the init field:  null = [bomberDude,1000] execVM "Scripts\Bomber_snackbar.sqf";   

 

This is assuming you have a Scripts folder and your sqf is named Bomber_snackbar.sqf

Change the second value to whatever distance you want for the bomber to start heading toward your unsuspecting players.

 

// Checks if player is within X meters, moves toward them if they are.
// Will chose a new target player if another comes closer.
// Detonates upon getting within 5 meters of player
// Includes dead man switch (detonates upon death)
// Usage: null = [Bomber,1000] execVM "Scripts\Bomber_snackbar.sqf";

private ["_bomber","_targetdistance","_detonated"];
_bomber = _this select 0;
_targetdistance = _this select 1;
_detonated = 0;

While {alive _bomber} do 
{
	_nearest = objNull;
	_nearestdist = _targetdistance;
	{
		_dist= vehicle _x distance _bomber;
		if (isPlayer _x and _dist < _nearestdist) then
		{
			_nearest= _x;
			_nearestdist = _dist;
		};
	} forEach playableUnits;

	if (!isNull _nearest) then
	{
		_bomber move getPos _nearest;

		if ((_bomber distance _nearest)< 5) then
		{
			_detonated = 1;
			_bomber  say ["snackbar", 40];
			sleep 1.5;
			_bomb = "Bomb_03_F" createVehicle getPos _bomber;

		};
	}
	else
	{
		_bomber moveTo getPos _bomber;
		sleep 1;
	};
	sleep 2;
};

// dead man's switch
if (_detonated < 1) then
{
	sleep 3;
	_bomb = "Bomb_03_F" createVehicle getPos _bomber;      
};

For the "Say" part to work, the caveat is this you need to make a description.ext entry too:

class CfgSounds 
{
   class snackbar
	{
		// how the sound is referred to in the editor (e.g. trigger effects)
		name = "bomber_snackbar";
		// filename, volume, pitch
		sound[] = {"sfx\snackbar.ogg", 1, 1};
		// subtitle delay in seconds, subtitle text 
		titles[] = {0, "Allahu Ackar!"};
	};

};

This will have the effect of a bomber running up to the closest player, yelling whatever snackbar is, and displaying the text just long enough for your player to either go "huh?" or "oh crap!" before their immediate demise.   Also includes a dead man's switch.  If the bomber gets close enough, you're toast.  Enjoy!

 

 

Hi Folks.

 

I've been trying to get this to work for a few hours now with no luck. I wonder if someone could confirm its working still.

 

I have basically got blufor unit down and a civilian.

civillian is called bomber_1

in the civ init field i have     null = [bomber_1,50] execVM "Scripts\Bomber_snackbar.sqf";

 

Have the scripts folder tree as explained.   

 

Thing is.  If i move towards the civilian to see if its working nothing happens and he just stands there.    

 

If i shoot him the end of the script works and he blows himself up.  Am i missing something at the start of the script that i need to change to make it start.

 

Thanks for any help i get.

 

 

 

Ignore this.   I got it. needs to played out in the host mission as opposed to just the editor.

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

×