Jump to content
Sign in to follow this  
x3kj

Twin Cannon turret problem

Recommended Posts

Hi, i have a problem once again -

I have a Turret which has 2 guns, and they are supposed to fire at the same time (like a Battleship turret).

The blufor AA APC at first glance fires 2 shots at the same time, but it's just higher ROF+ burst 2 setting. So i did the same for my cannon, high ROF+ burst 2. The drawback is that i have to add alot of magazine :j:

For the Cannons it's not so much of a problem, but i would like to create a Autocannon Quad turret, where always 2 guns fire simultaneously, but with relatively low ROF... Is there another way?

The biggest problem for my Twin Cannon is, that the shots don't come from the two barrel memory points i defined. They seem to shoot from the view-mempoint of the turret. The AA APC uses "memoryPointGun[]={"usti hlavne 1","usti hlavne 2"};" for Barrel definition, I did the same but it's not working :/ Does anybody know what the problem could be?

Turret:

class TurretMain: NewTurret {
weapons[]={"M_V_Mach_Battlecannon_200mm_2x"};
magazines[]={M_V_BattleCannon_200mm_HE_2rnd,M_V_BattleCannon_200mm_HE_2rnd,M_V_BattleCannon_200mm_HE_2rnd,M_V_BattleCannon_200mm_HE_2rnd,M_V_BattleCannon_200mm_HE_2rnd, //10 HE
							M_V_BattleCannon_200mm_HE_2rnd,M_V_BattleCannon_200mm_HE_2rnd,M_V_BattleCannon_200mm_HE_2rnd,M_V_BattleCannon_200mm_HE_2rnd,M_V_BattleCannon_200mm_HE_2rnd, //10 HE
							M_V_BattleCannon_200mm_HE_2rnd,M_V_BattleCannon_200mm_HE_2rnd,M_V_BattleCannon_200mm_HE_2rnd,M_V_BattleCannon_200mm_HE_2rnd,M_V_BattleCannon_200mm_HE_2rnd, //10 HE

							M_V_BattleCannon_200mm_AP_2rnd,M_V_BattleCannon_200mm_AP_2rnd,M_V_BattleCannon_200mm_AP_2rnd,M_V_BattleCannon_200mm_AP_2rnd,M_V_BattleCannon_200mm_AP_2rnd, //10 AP
							M_V_BattleCannon_200mm_AP_2rnd,M_V_BattleCannon_200mm_AP_2rnd,M_V_BattleCannon_200mm_AP_2rnd,M_V_BattleCannon_200mm_AP_2rnd,M_V_BattleCannon_200mm_AP_2rnd, //10 AP				
};


turretAxis="ax_tur1_trav"; 					
gunAxis="ax_tur1_elev"; 		

minElev=-5; maxElev=+20; initElev=0;
minTurn=-360; maxTurn=+360; initTurn=0;
maxVerticalRotSpeed= 0.55; 					
maxHorizontalRotSpeed=0.55;

body="PrimaryTurret";						
gun="PrimaryGun";			//
animationSourceBody="tur1_trav_AnimSrc"; 		
animationSourceGun="tur1_elev_AnimSrc";


// Main gun
//gunBeg = "tur1_mzl_r_start"; 						//usti hlavne (barrel tip)
//gunEnd = "tur1_mzl_r_end"; 						//konec hlavne (barrel root)
memoryPointGun[]={"tur1_mzl_r_start","tur1_mzl_l_start"};	

selectionFireAnim = "tur1_mzl_r";				//zasleh

///class HitPoints {};


class AnimationSources:AnimationSources
{
	class recoil_source {source = "reload"; weapon = "M_V_Mach_Battlecannon_200mm_2x";};
};


// FCS...

// Optics view...
};

Weapon:

class M_V_Mach_Battlecannon_200mm_2x:  M_V_BattleCannon_base {

muzzleEnd="tur1_mzl_r_end";
muzzlePos="tur1_mzl_r_start";
selectionFireAnim="tur1_mzl_r";
displayName="Twin Battle Cannon";
magazines[]={"M_V_BattleCannon_200mm_HE_2rnd","M_V_BattleCannon_200mm_AP_2rnd"};	
class GunParticles
{
	class FireEffect_L	{
		effectName="CannonFired";
		positionName="tur1_mzl_l_start";
		directionName="tur1_mzl_l_end";
	};
	class FireEffect_R	{
		effectName="CannonFired";
		positionName="tur1_mzl_r_start";
		directionName="tur1_mzl_r_end";
	};
};

modes[]={"player2x",	"close2x",	"short2x",	"medium2x",	"far2x"};

class player2x: Mode_SemiAuto
{
	begin1[]={"A3\Sounds_F\weapons\Cannons\cannon_1",3.1622777,	1,1500};
	soundBegin[]={"begin1",1};
	weaponSoundEffect="DefaultRifle";
	burst = 2;
	soundContinuous=0;
	//soundContinuous=1; //next sound does not play before other is finished

	//reloadTime=0.001;
	reloadTime=1.500;  ///for testing animation
	magazineReloadTime=6;
	autoReload=1;
	ballisticsComputer=1;
	canLock=2;
	autoFire=0;
};
};	

Share this post


Link to post
Share on other sites

haven't tested it myself in arma 3, but my understanding so far:

turret:

gunEnd/gunBeg is used for defining the barrel of the weapon of a turret.

memorypointgun([]) is for defining different source point(s) for e.g. coaxial mounted weapons

they use the direction vector of gunBeg - > gunEnd but memorypointgun as source

weapon:

with shotFromTurret = 1 in the config of the weapon gunBeg gets used as source

with shotFromTurret = 0 memorypointgun is the source

Edited by Master85

Share this post


Link to post
Share on other sites

You might want to look at these two links. They might give you some guidance, I believe it's a known issue. The Turrets depend on a seated player, and the shot comes from their view point. IE you need 2 gunners to fire 2 guns. But I think people have both scripted, and model edited their way around it.

Issue on the issuetracker that was assigned but never completed:

https://dev.withsix.com/issues/27764

an older thread that inspired the scripted solution below:

http://forums.bistudio.com/showthread.php?157834-double-barrel-turret

scripted fix:

http://forums.bistudio.com/showthread.php?159574-Double-Barrel-Guns-via-attached-gun-pod

Share this post


Link to post
Share on other sites
IE you need 2 gunners to fire 2 guns.

I have only 1 weapon however, it just fires a 2x burst - just like the Arma 3 AA Apc's. Memory points are also set up like the AA Apc

And i have another turret, where i use a coaxial Machinegun type, with 2 barrel memory points and that works (alternating between shots)

Share this post


Link to post
Share on other sites

The Cannon type weapons can't yet use 2 points natively in A3. Support for multiple fire points seem to be for machinegun and missile types sofar.

There was fabulous fix script addon for this in A2 and our coder is working on a similar solution. Multiplayer end is still a bit sketchy but probably wont take long for him to figure out. It will also be released as an separate addon once it works in MP and as a independent addon.

I'll try to remember to send you a message when its done. Im sure you could benefit from it too if you haven't found a solution to it by then!

Edited by HorribleGoat

Share this post


Link to post
Share on other sites

How are you doing with the twin guns? We got our script in a pretty good shape but theres still some trouble with moving the particle effects with the projectile!

Share this post


Link to post
Share on other sites

Haven't continued working on the config so far, so no progress in this regard from my side

What i had tried before i stopped is to use one barrel, and move it's memory points via animation but i must have done something wrong as nothing moved at all

Edited by Fennek

Share this post


Link to post
Share on other sites

i tried again and %&!`?=)"($&!%)(&ZT°!")($§& it's annoying. It's something about the weapons class config. If i inherit from autocanon_35mm or just use it directly it shoots from the 2 memory points. If i make a very similar weapon using other ammo and stats it doesnt work anymore. I must have restartet arma 20 times by now ARGHHH i'm going mad :mad:

Share this post


Link to post
Share on other sites

if it's any consolation we have a load of twin and quad turrets in unsung, and while we can make them fire twin tracers if the weapon is aimed in one direction, using a fired eventhandler to spawn another bullet at the tip of the other barrel, it works in a limited way when turning the turret, but gets all messed up in MP when the vehicle is also moving. amazing that the helicopters get this feature but not the planes or tanks... i wouldn't bother tbh. we've spent months on it...

but, if you do work it out, do share !

Share this post


Link to post
Share on other sites

I'll be damned, should have tried that before... I shot the same ammo as the AA tank from my tank gun -> works as expected, shots alternate from muzzle zu muzzle.

Now i have to investigate what makes the difference in the Ammo. B_35mm inherits from BulletBase & BulletCore whereas my tank round inherits from ShellBase & ShellCore.

Edit: Apparently the only thing really is simulation="shotBullet" vs simulation="shotShell"

Edited by Fennek

Share this post


Link to post
Share on other sites

Maybe it's of interest to someone ... i got a 4 barrel turret working, shooting with 2 guns at once, alternating.

I had to use fired Eventhandler to hide muzzleflashes that are currently not in use (otherwise they are all displayed whenever a single shot is fired) The smoke effect positions have to be animated via EH as well, and the recoil too, as the reloading source for animationsources doesnt work with such a short reloadtime. And there is of course the annoying thing with the several hundred magazines you need to add (each salvo=1 magazine) for autocannon turrets.

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  

×