Forum Jump :

Author Message


Posts: 8
Rank:


Level: Member

Country: es
Location:
Occupation:
Age:
In-game name:

 
#1 Posted at 2020-01-29 18:00        
     
Hello masters o' scripting.
I made a working mission, it finish with a extraction point in helicopter. I wish to have a helicopter little-bird with sitting soldiers on externals boards turning around de extraction point, shooting the incoming enemies.
I share my script.
I didn't be able to it works :-( , why it doesn't work? any ideas?
if (!isServer) exitWith {};
/*

gunner = soldat BLUFOR

trigger amb Started = true

target = objectiu

*/

// Disparos

[] spawn {
	
	while{true} do {
		sleep 2 + floor(random 10);
		gunner1 doWatch target1;
		gunner1 doTarget target1;
		sleep 0.5;
		if(damage target1 < 1) then { gunner1 forceWeaponFire [currentWeapon gunner1,"Single"]; };
		sleep floor(random 2);
		gunner2 doWatch target2;
		gunner2 doTarget target2;
		sleep 0.5;
		if(damage target2 < 1) then { gunner2 forceWeaponFire [currentWeapon gunner2,"FullAuto"]; };
		sleep floor(random 2);
		gunner3 doWatch target3;
		gunner3 doTarget target3;
		sleep 0.5;
		if(damage target3 < 1) then { gunner3 forceWeaponFire [currentWeapon gunner3,"FullAuto"]; };
		sleep 2;
		target1 setDamage 0;
		target2 setDamage 0;
		target3 setDamage 0;
		if (needReload gunner1 == 1) then {reload gunner1; gunner1 addMagazine "30Rnd_65x39_caseless_mag"; };
		if (needReload gunner2 == 1) then {reload gunner2; gunner2 addMagazine "30Rnd_65x39_caseless_mag"; };
		if (needReload gunner3 == 1) then {reload gunner3; gunner3 addMagazine "30Rnd_65x39_caseless_mag"; };
	};
	
};

sleep 1;
Thanks in advanced


Author Message


Posts: 1523
Rank:


Level: Member

Country: uk
Location:
Occupation:
Age:
In-game name:

 
#2 Posted at 2020-02-01 22:35        
     
Hard to say exactly, units do fire but are totally inaccurate in my test which isn't surprising.
forceWeaponFire dose nothing more that that it just fires the weapon, it doesn't calculate bullet velocity or drop.
dowatch and dotarget don't seem to do a great job either, they're very hit and miss commands.

You could try something simple like SuppressiveFire

gunner1 doSuppressiveFire target1;


Advertisement


Author Message


Posts: 8
Rank:


Level: Member

Country: es
Location:
Occupation:
Age:
In-game name:

 
#3 Posted at 2020-02-08 19:20        
     
Thank you.