Jump to content
Sign in to follow this  
1para{god-father}

Car Bomb that drives ???

Recommended Posts

I have looked but could not find the answer, Is there a way I can use the Civilan Vehicle Module with a car bomb script ? or something similar

i.e Civvies drive around the map in there cars but if they are approx 10 feet from you they explode with a little message before so you have time to run or shoot ?

I have seen the IED but nothing that moves in a car

Thanks

Share this post


Link to post
Share on other sites

If it's a single car that should explode at a certain point, you can use a trigger around that area and spawn a GBU or 125 HE Shell on it ?

"Bo_GBU12_LGB" createVehicle getPos carbomb; (if carbomb is the name of the car that you want to explode)

If it's a random thing you're after maybe this thread will help:

http://forums.bistudio.com/showthread.php?t=94985

Edited by Wilf55
Adding example

Share this post


Link to post
Share on other sites

Many thanks I did read that thread but it was not really what I wanted as then cars would be static or I would have to create waypoint for them which would not be random.

Is there a way to use the Ambient civilian Vehicles Module and a % of them would be moving car bombs so they drive about that way that would be truly random and moving car bombs.

Is this possible ?

Share this post


Link to post
Share on other sites

Sounds like you would need to create the car along with the ambient civil vec mod as to hide it. You would still have to make the way points, but you could make 5 or 6 differnt spawns and path's, and have it randomly choose one of those. I would have to look at an old edit, but you can make the script do what your talking about on prox. to yourself or an ally it would create a "shell round explosion" at the car.

Share this post


Link to post
Share on other sites

Another option might be this addon:

http://forums.bistudio.com/showthread.php?t=106258

You want version 05a (NOT the dev version 05c.)

If I recall, you can use the homicide bomber module, and setvariable to a vehicle. You would have to spawn a driver, and give him waypoints, but he would then drive around, and the monitor script would wait until there was an enemy (which you would also designate in the editor) nearby, then it would explode.

Just took another look at the script, and it should work. I recall testing it that way, and not having any problems with it.

Edit:

Oh, and to implement something like what you describe with the BI Ambient Civs, you'd have to create a custom init that would trigger a script on each spawned vehicle. Not super-hard, just a bit complicated. The script could randomly decide if that vehicle was a VBIED, and if it was, start a monitor script that ran every few seconds. If there was a Blufor (assuming that's the enemy you want), it would then give a warning or something, then create the explosion.

Edited by TRexian

Share this post


Link to post
Share on other sites

The Ambient civilian Vehicles and Civilian Module alos includes them driving does it not ?so they just get into a car and drive where they want, so why would I need to place cars and waypoints ?

Or am I missing something here ?

Share this post


Link to post
Share on other sites

Oops, yeah - the Ambient Civ modules can be tweaked to do what you want, but it is a bit complicated.

Share this post


Link to post
Share on other sites

Would this work ?

Carbomb.sqf

_object = _this select 0;
_value = random 100;

if (_value < 25) then {
_trg=createTrigger["EmptyDetector", position _object];
_trg setTriggerArea[8,8,0,false];
_trg setTriggerActivation["WEST","PRESENT",false];
_trg setTriggerStatements["this", "_bomb = nearestObject [getPos (thislist select 0), 'Car']; boom = 'R_57mm_HE' createVehicle position _bomb", ""];
};

nul=[this] execVM "carbomb.sqf";

How can I put that in each Init of the Vehicle module , and would it work if they are moving?

Share this post


Link to post
Share on other sites

That would create the trigger only where the vehicle spawned - the position of _object at the time it was spawned. After that code, you might be able to move the trigger to an updated position of the vehicle, but there would be a lag.

For the object init thing, I've used something like this before (with the ALICE init) - you could put it in the init of the SILVIE module, I believe:

BIS_silvie_mainscope setvariable ["vehicleInit",{[_this] execVM "carbomb.sqf";}];

Notice the "_this" instead of "this" - that will refer to the object being spawned and not the module itself.

Edit:

Scripting like this might work better than the trigger, basically a monitor of the vehicle:

_object = _this select 0;
_value = random 100;

if (_value < 25) then {
_blowup = false;
while {alive _object} do
{
// include vehicles
	_targetArray = nearestObjects [(getPos _bomber), ["MAN", "LandVehicle"], 10];
	if ((count _targetArray) > 0) then
	{
		{
			if (str(side _x) == "WEST") then
			{
			_blowup = true;
			};
		} forEach _targetArray;
	};
	if (_blowup) then
	{
	_boom = "R_57mm_HE" createVehicle (position _object);
	}
	else
	{
	sleep 10;		// change to tweak wait time before checks
	};
};
};

Untested, but should give the idea.

Edit2: oh, and a private command at the top would be worthwhile, with the nested loops. :thumbs:

Edited by TRexian

Share this post


Link to post
Share on other sites

thanks ill give it a go and see what happens :) would be cool to have random cars driving around that could explode makes clearing a town or road blocks a little more risky !

Share this post


Link to post
Share on other sites
Hi TRexian

I am getting an error ...

"Error 0 elements provided, 3 expected"

Any idea ?

Mmm... the variable "_bomber" isn't defined in the script. It should be replaced by "_object" IMO.

Share this post


Link to post
Share on other sites

Oops - yeah. The danger of copying/pasting from an existing script! Sorry! :blush:

Share this post


Link to post
Share on other sites

Just tested that again and OMFG how funny !!

Car drives at you then about 3 -4 sec later it explodes....

One question do you know of a way to stop them spawning into Buildings as i am using Duala and they cannot get out i can see them on the map in debug , so i never get many civis in the street or driving because they are trapped

Many thanks for your help on this !

Should this work on a Dedi server ?

Edited by psvialli

Share this post


Link to post
Share on other sites

Hi ,

I would like a message that will show up before the explosion

I have tried HINT "Car Bomb" but only 1 person can see the message?

What would I use to show the message to all ?

if (_blowup) then

{

HINT "Car Bomb";

Sleep 5;

_boom = "R_57mm_HE" createVehicle (position _object);

}

else

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  

×