Announcement

Collapse
No announcement yet.

Buffing the A-164 Wipeout

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

  • Buffing the A-164 Wipeout

    this script will buff the main gun on the Wipeout by X times.
    it can apply to other weapons/vehicles as well

    heres the code:
    Code:
    vehicle_name addeventhandler 
    	[
    	"fired",
    	"if ((_this select 4)=='Gatling_30mm_HE_Plane_CAS_01_F') then
    		{
    			_unit = _this select 0;
    			_unit allowdamage false;
    			_ammo = _this select 6;
    			for [{_i=5},{_i>0},{_i=_i-1}] do {
    			_weapon = (_this select 4) createvehicle ([((getpos _ammo) select 0),((getpos _ammo) select 1),((getpos _ammo) select 2) - 3]);
    	
    			_direction = getdir (_ammo);
    
    			if(_direction < 0) then 
    				{
    					_direction = _direction + 360
    				};
    		
    			_x1 = ((getpos _ammo) select 0) + ((sin _direction)* 10);
    			_y1 = ((getpos _ammo) select 1) + ((cos _direction)* 10);
    			_weapon setpos [_x1,_y1,(getpos (_ammo)) select 2];
    			_weapon setVectorDir (vectorDir (_ammo));
    			_weapon setvelocity (velocity (_ammo));
    			_unit allowdamage true;
    		};
    		};"
    	];
    this adds an event handler onto the aircraft (aircraft_name) that whenever it fires it checks if the round fires is a gatling round. if it is, it spawns another round about 2 meters in front of that one and set its vectorUp (pitch and direction) and velocity equal to the former's.

    the firepower amplifier (as I like to call it) is changed by changing the counter _i in the for loop
    Code:
    for [{_i=5},{_i>0},{_i=_i-1}] do {
    here _i=5, which means every time a round is fired 5 more are spawned with it. anything above 10 starts making things lag too much.

    to change the round being duplicated change the string in the first statement to the ammo's classname
    Code:
    "if ((_this select 4)=='Gatling_30mm_HE_Plane_CAS_01_F') then
    I was fairly disappointed by the firepower of this gun so this makes it similar to its ArmA 2 counterpart (which could kill a tank with a single burst of 30)

    I will working on a script that also makes it shake a bit when you fire.
    Last edited by woesterudolf; 03-28-2014, 05:21 PM.
    Yink | Vanilla Pilot | Killer of Stirling | CS GOD | Projects Team


  • #2
    more immersion

    here is the updated code that will make the Wipeout shake when you fire the gun.


    this version will shake for every original round, not be to be confused with the extra spawned rounds.
    Code:
    vehicle_name addeventhandler 
    	[
    	"fired",
    	"if ((_this select 4)=='Gatling_30mm_HE_Plane_CAS_01_F') then
    		{
    			_unit = _this select 0;
    			_unit allowdamage false;
    			_ammo = _this select 6;
    			for [{_i=5},{_i>0},{_i=_i-1}] do {
    			_weapon = (_this select 4) createvehicle ([((getpos _ammo) select 0),((getpos _ammo) select 1),((getpos _ammo) select 2) - 3]);
    	
    			_direction = getdir (_ammo);
    
    			if(_direction < 0) then 
    				{
    					_direction = _direction + 360
    				};
    		
    			_x1 = ((getpos _ammo) select 0) + ((sin _direction)* 10);
    			_y1 = ((getpos _ammo) select 1) + ((cos _direction)* 10);
    			_weapon setpos [_x1,_y1,(getpos (_ammo)) select 2];
    			_weapon setVectorDir (vectorDir (_ammo));
    		_weapon setvelocity (velocity (_ammo));
    		};
    
    		_vecDir = vectorDir _unit;
    		_vel = velocity _unit; 
    		_unit setVectorDir [(_vecDir select 0) + (((round(random 1))-0.5)/360),(_vecDir select 1) + (((round(random 1))-0.5)/360),(_vecDir select 2) + (((round(random 1))-0.5)/360)];
    		_unit setVelocity _vel;
    		_unit allowdamage true;
    		};"
    	];
    I would recommend using this one. you could move the bracket ( } ) from the for loop to below the _unit setVelocity _vel but that would make it too hectic.

    to decrease the amount of shaking just increase shake. default is 360.

    I will continue to improve this if people will use this script. such as decrease shaking when going certain speeds/having gear and flaps down or up.
    Last edited by Yink; 03-28-2014, 05:14 PM.
    Yink | Vanilla Pilot | Killer of Stirling | CS GOD | Projects Team

    Comment

    Connect

    Collapse

    TeamSpeak 3 Server

    Collapse

    Advertisement

    Collapse

    Twitter Feed

    Collapse

    Working...
    X