Announcement

Collapse
No announcement yet.

Bomber Script

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Bomber Script

    Based on a script made by Zooloo75/Stealthstick (source). I cleaned it up some and made some modifications to make it more reliable. It will target both infantry and land vehicles but it can be expanded to other classes if needed. Also added the area radius as another input variable.



    Add to bomber unit(s) init or call using that unit's name.
    Code:
    null = [unit_name,[sides,...],"explosive_ammo_classname",area_radius] execVM "suicideBomber.sqf";
    Example
    Code:
    null = [this,[WEST],"R_60mm_HE",30] execVM "suicideBomber.sqf";
    Also add the following to your "description.ext" file.
    Code:
    class CfgSounds
    {
    	#include "Sounds.hpp"
    };
    Include "suicideBomber.sqf", "Sounds.hpp", and "shout.ogg" in your mission folder.
    Attached Files
    Last edited by DeF; 10-19-2013, 07:51 AM. Reason: Added original source link.
    sigpic


  • #2
    Re: Bomber Script

    Awesome work! Here's a little something I threw together that will spawn a bomber randomly around a object of choice, barring a marker 'safe zone'.

    Code:
    Spawns a suicide bomber (using DeF's script) within a certain radius of a target object.
    
    [target,[marker1,marker2,...],radius,percentage] call fn_sBomber;
    
    target = Object. If calling in the init field, use "this";
    [marker1,marker2,marker3] = List of marker names considered a 'safe zone'
    radius = Number. Distance they will spawn.
    percentage = Number. 0 - 100. Chance a sBomber will spawn every five minutes. Suggested you keep this... low.
    
    fn_sBomber = {
    	private ["_target","_markers","_radius","_perc","_go","_test","_ran","_angle","_plDir","_final","_x","_y","_z","_bomber"];
    	_target = _this select 0;
    	_markers = _this select 1;
    	_radius = _this select 2;
    	_perc = _this select 3;
    	while{true} do {
    		_go = false;
    		if(count _markers > 0) then {
    			{
    				_test = [_x,getPos _target] call BIS_fnc_inTrigger;
    				if(_test) then { _go = true};
    			} forEach _markers;
    		} else { _go = true };
    		if(_go) then {
    			_ran = random 100;
    			if(_ran < _perc) then {
    				_angle = floor(random 180);
    				_plDir = _target getDir;
    				_final = _plDir - (_angle/2);
    				if(_final < 0) then { _final = (abs _final) };
    				_final = 360 - _final;
    				_x = (cos _final)*_radius;
    				_y = (sin _final)*_radius;
    				_z = 0;
    				_bomber = "C_man_1" createVehicle [_x,_y,_z];
    				[_bomber,[WEST],"R_60mm_HE",30] execVM "suicideBomber.sqf";
    			};
    		};
    		sleep 300;
    	};
    };
    I didn't test it, so someone will have to run through and make sure it actually works :P.

    I know not with what weapons World War III will be fought, but World War IV will be fought with sticks and stones. -Albert Einstein

    Comment


    • #3
      Re: Bomber Script

      Nice, Butler! I will try that out.
      sigpic

      Comment

      Connect

      Collapse

      TeamSpeak 3 Server

      Collapse

      Advertisement

      Collapse

      Twitter Feed

      Collapse

      Working...
      X