Jump to content
Sign in to follow this  
x3kj

Two different machineguns on Plane / Alternative

Recommended Posts

Hey guys

I have an aircraft that has 2 different gun weapons. One machinegun type and one autocannon type. Think of WW2 planes (e.g. BF109 E3 for example, or FW190)

They are seperate weapons in the config. The problem is that if i define both memory points of the guns into the muzzles part, each weapon will use both points (alternating).

What i tried to do was to use a single memorypoint and use a translate animation to move it to the correct spot when weapons are selected. The animation works fine (i defined a box with the same selection name as the memorypoint), but the origin where the bullets come from does not change at all.

Does anyone have an idea how this could be solved? Can anybody with experience with the iron front mod how they handled it ?

Share this post


Link to post
Share on other sites

hi fennek

yeah i'm working on this right now in A2!

we're adding gunpods to the Su25 this week, so trying to get the result you also seek, but also with nose gun single tracer and wing guns dual tracers.

pook has previously attached a second gunpod to his skymaster and used scripts to make an invisible AI occupy the pod and fire when you do - this isn't my preferred option now we understand it better.

now we know we can do this in a chopper, as it has two turrets - example of our ka52 with gunpods and nose gun:

http://i162.photobucket.com/albums/t247/eggbeast/gunpodplan_zps6b9e559d.jpg

http://i162.photobucket.com/albums/t247/eggbeast/ka52_pods7_zpsf7412175.jpg

http://i162.photobucket.com/albums/t247/eggbeast/ka52_pods6_zpsf24a29db.jpg

http://i162.photobucket.com/albums/t247/eggbeast/ka52pods2_zpscd3628fd.jpg

http://i162.photobucket.com/albums/t247/eggbeast/ka52pods1_zps1ce5ff41.jpg

so i was thinking of either:

a) (easiest but not very elegant) having an added turret for the plane (with an EH that locks it so you cannot get into it) so selecting manual fire can select the cannons, or

b) trying to use the firedfromturret setting to differentiate between a cannon and an MG, which requires setting up your heavier calibre weapon as a cannon class in weapons/mags/ammo, and then making custom muzzleeffects etc

either way will take some experimentation to perfect.

any other ideas?

if you like you can add me on steam -=xtra=-eggbeast or or skype rgraham.ld for a chat

Share this post


Link to post
Share on other sites

are you sure you can add a turret? because thats the main difference between helicopter and plane -> according to the plane sample, bad things will happen if you add turrets to the plane. I havent tried adding a turret however.

Share this post


Link to post
Share on other sites

the su34 has a turret, so does the su24, the a6, F4, F16 and F15, FA18, F105, B52, Tu22, Tu95, most of which i have played with in config or o2.

we can have moving guns in a plane no problem. I'm trying to get twin tracers working at the moment for the bear rear gun blister, and the tucano/A1 akyraider/ su25 with gunpods etc

Share this post


Link to post
Share on other sites

turrets work on planes? oh... finally some good news.

Setting up the heavier one as cannon wont work in my case i think - it's also dual barreled, so using gunbeg and gunend for cannon definition won't be usefull, as i would have to move the gun memorypoints once again.- it has to be a machinegun with memorypoints.

The problem with the manual fire thing is that AI wont be able to use it correctly i think ?

Could a scripting command be used to force fire from the artificial turret? Does that command exist?

That way you could have a fake weapon, that triggers the fired EH, and the EH in turn forces the turret to shoot properly

Edited by Fennek

Share this post


Link to post
Share on other sites

yeah AI is a different story. you could allow the AI to occupy the turret, as a second crewman of course...

i'm thinking with the su25, of making the nose cannon into a cannon, allowing me to keep dual tracers on the mguns on the wing...

Share this post


Link to post
Share on other sites
yeah AI is a different story. you could allow the AI to occupy the turret, as a second crewman of course...

but that would require 2 ai crews for a single seat aircraft... thats bad, as every AI requires extra ressources and it destroys the immmersion.

So i need a way to script-forcefire from that unmanned turret in some way.

Share this post


Link to post
Share on other sites

a weapon is unlikely to fire without a man crewing it i think.

Share this post


Link to post
Share on other sites

ok adding a turret works inasmuch as you get pairs (ormore, depending on what proxy muzzleflashes you add to the selection - you could have 8) of muzzleflashes in the locations you want them

BUT the plane does not respond at all to the twin memory point logic, so i fear it is still an engine limitation. the gun fires from one point only... :(

twinmuzzles_zps507316f4.jpg

Share this post


Link to post
Share on other sites

If you're not in a hurry we got multiturret weapon script working where you can define any point you want as the muzzle point. Works with multiple turrets and multiple weapons on one turret/vehicle. It's currently part of our competition mod but it works independently and could be useful in this case. It needs a bit tweaking and we're releasing our alphas under non derivative license but when we change that it would be great if you want to try it out.

Separate turret would do of course but it would count as a extra seat in the plane and needs AI to fire it as eggbeast said. Empty turret can't fire.

We've got 1 turret with a cannon class weapon here and the muzzle points are distributed 2 on the both arms of the walker and the actual turret is in the middle with the camera.

Edited by HorribleGoat

Share this post


Link to post
Share on other sites
ok adding a turret works inasmuch as you get pairs (ormore, depending on what proxy muzzleflashes you add to the selection - you could have 8) of muzzleflashes in the locations you want them

BUT the plane does not respond at all to the twin memory point logic, so i fear it is still an engine limitation. the gun fires from one point only...

I'm not exactly sure what you mean by 1 point only. If you have only a single weapon with multiple barrels everything is fine.

e.g.

memorypointgun[] = {"w_AC4_mzl_start","w_AC1_mzl_start", "w_AC2_mzl_start", "w_AC3_mzl_start"};

selectionFireAnim="w_AC1_mzl";

It alternates fire between those 4 muzzles in ordered fashion (always starting with the second muzzle - thats why AC1 is second here). However the muzzle flash is always shown (4 muzzleflashes -> all 4 show after one shot). But this is not a problem, you can animate those via fired EH to switch location or hide the other ones you dont need. You can also move the particle memory points. But animating (moving) the gun origin points does not work on a plane, not sure about tanks/etc.

Maybe it could work if i define the big cannon as (dumb) rocketlauncher and have different mempoints for it? In my case i want to create some sort of lasercannon, so it doesnt really matter if bullet or rocket - both are kinda unsuited to it. I just need to make sure somehow that it doesnt destroy my other missile/bomb weapon proxies someway

Hm maybe i just need to make the memorypoints child of another selection/bone and animate the parent? Think about it, a tank turret rotates and moves the gun origin with it. I'll try that next. Atm i think i animated the memorypoint selection directly.

If you're not in a hurry we got multiturret weapon script working where you can define any point you want as the muzzle point. Works with multiple turrets and multiple weapons on one turret/vehicle.
Not sure if i follow correctly, i dont know the how your vehicle you show there works/looks to make sense of it, the video doesnt explain much to me. I'm not taking part in the competition so waiting doesnt matter.

Edit: no parent bone animation doesnt work either. fuck! why does all this stuff have to be hardcoded ?

Edited by Fennek

Share this post


Link to post
Share on other sites
Not sure if i follow correctly, i dont know the how your vehicle you show there works/looks to make sense of it, the video doesnt explain much to me. I'm not taking part in the competition so waiting doesnt matter.

Sorry about that, here this is whats firing in the video.

I didn't actually know that the gun memorypoint was an array, thats great. We encountered couple of problems with cannon type weapons in aircraft and with multiple barrels and thats why the whole script was created in the first place.

In your case you would only need to define the weapons you want to the aircraft and the in the scripts multiturret class you would then define the weapon and the muzzle points and wanted effects for it and it wouldn't need anything else.

class LoDR_MultiTurret

{

class MyTurret

{

//Weapon and muzzle. Used to identify turret. (same weapon

//and muzzle will lead to unexpected results)

id[]={"XC_125mm_T1","XC_125mm_T1"};

//Turret path (-1 == commander, 0... other turrets)

turretPath[] = {1};

//Multiturret muzzles

muzzles[]= {"T1_Muzzle1","T1_Muzzle2","T1_Muzzle3"};

//Optional effects

turretEffects[] = {{"CannonFired1", 2,1.0},

{"CannonFired2",0.24,1.0},

{"CannonFired3",0.1,1.0}};

};

};

heres example of our new class.

Share this post


Link to post
Share on other sites
In your case you would only need to define the weapons you want to the aircraft and the in the scripts multiturret class you would then define the weapon and the muzzle points and wanted effects for it and it wouldn't need anything else.

Do you need an AI in the turrets? I guess i would have to look at the entire thing to understand it.

Is there a script command to can just create projectiles with speed, direction and so on? This would allow for a way more direct approach then all the turret shenanigans.

Share this post


Link to post
Share on other sites

All the weapons would be in the main plane class and you would need only player to operate them if it is a single seat fighter.

Im not sure about the script created projectiles, makes me think if it would become straining on the server to spawn such an amount of stuff with scripts.

We got an early Alpha out with a large flying battleship that utilizes the turret script if you want to see it in action:

ModDB Download

Share this post


Link to post
Share on other sites

that's a great concept hg. really nice idea.

Share this post


Link to post
Share on other sites
Im not sure about the script created projectiles, makes me think if it would become straining on the server to spawn such an amount of stuff with scripts.

in my case the fire rate would be pretty low, 1-2 shots every 6 seconds. I dont see that as a problem, there are worse offenders regarding performance i'd say. I just need to know if it's even possible (script newb here) and what commands i could use so i can try it. I'll check out your alpha in the meantime.

Edit:

So with my newb scripting fu i looked at your multiturret script and you are essentially just catching the projectile with a fired EH and set another position? ... hm guess that is another possibility compared to creating a fake projectile. if that works reliable in multiplayer?

Edited by Fennek

Share this post


Link to post
Share on other sites

we had that in unsung on the original uh1's and the quad 50cal turret

it was a mess!

basically, as you turn the turret, the scripts can come out of alignment if they are not perfect in the modeltoworld data

quad and dual gun turret tracers is perfectly feasible now in A2 for trucks, statics, helicopters, tanks etc. just look the the tools version of the tunguska or shilka to see dual and quad in action

but planes... they don't allow gunbeg[] = {"gun1","gun2"};

they only allow gunbeg ="gun"

joining up muzzleflashes for any number of them is also easy - just copy the approach in the ah6j... add as many zasleh proxies as you want in the places you want them, then select them all and make a new selection "zasleh_1" then add this to your sections list in the model.cfg and add selectionfireanim = "zasleh_1"; to select that - you can do this for any number of turrets.

so if you have twin guns and a single - this works fine in heli and plane. but the dual firing tracer will not work in a plane :( without some additional messy scripting.

pook uses the invisible crew option in his skymaster

http://www.armaholic.com/page.php?id=21672

---------- Post added at 08:57 AM ---------- Previous post was at 08:53 AM ----------

swapping the weapon to a cannon was always my second choice... but this obviously relies on different muzzle flashes etc and may need custom effects to look right. will it make tracer? could do, as shells do support tracer. can you specify two muzzles in a PLANE? not sure yet myself, but HG above seems to think they've done it

here's what i tried on the su25

nosegun and 2 wing guns

class FRL_Su25_CAP:  FRL_Su25_Base
{
	scope = 2;
	displayName = "Su-25 Frogfoot-A (CAP)";
//		weapons[] = {"GSh302","EB_SPPU22x4","EB_R77_Launcher","EB_R60_Launcher","EB_R73_Launcher","EB_ASO2V_FlareLauncher"};
	weapons[] = {"EB_SPPU22x4","EB_R77_Launcher","EB_R60_Launcher","EB_R73_Launcher","EB_ASO2V_FlareLauncher"};
	magazines[] = {
	"EB_1120Rnd_23mm_SPPU22",//"EB_1120Rnd_23mm_SPPU22",
//station 1
	"EB_R60x2",
//station 2
	"EB_R77x2",
//station 3
	"EB_R73x2",
//station 4
	"EB_4rnd_SPPU22pod",
//station 5

//2x4
	"EB_36Rnd_pylonblank",
//3x4
//4x4
//5x4
//INVISIBLE		
	"EB_ASO2V_Mag"};
//adding turret
	enableManualFire = 1;
	gunBeg[] = {"muzzle_1", "muzzle_2"};
	gunEnd[] = {"chamber_1", "chamber_2"};
	selectionFireAnim = "zasleh_1";
	class Turrets
	{
		class MainTurret: NewTurret
		{
			selectionFireAnim = "zasleh";
			memoryPointGun = "machinegun";
			gunBeg = "gunstart";
			gunEnd = "gunend";
			weapons[] = {"GSh302"};
			magazines[] = {"EB_250Rnd_30mm_GSh301"};
			commanding = -1;
			memoryPointsGetInGunner = "pos gunner";
			memoryPointsGetInGunnerDir = "pos gunner dir";
			castGunnerShadow = 1;
			viewGunnerShadow = 1;
			gunnerAction = "Su34_Gunner";
			gunnerInAction = "Su34_Gunner";
			soundServo[] = {"",0.0031622776,1};
			gunnerCompartments = "Compartment1";
			stabilizedInAxes = "StabilizedInAxesBoth";
			gunnerForceOptics = 0;
			gunnerOpticsModel = "\ca\air\optika_Ka50_gun";
			gunnerOutOpticsModel = "\ca\air\optika_Ka50_gun";
			gunnerOpticsEffect[] = {"TankCommanderOptics1","BWTV"};
			TurretInfoType = "RscUnitInfo_AH64D_gunner";
			gunnerOpticsColor[] = {0.227,0.769,0.24,1};
			gunnerForceOutOptics = 0;
			gunnerUsesPilotView = 0;
			hasGunner = 1;
			hideWeaponsGunner = 1;
			inGunnerMayFire = 1;
			lockWhenDriverOut = 0;
			maxHorizontalRotSpeed = 3;
			maxVerticalRotSpeed = 3;
			outGunnerMayFire = 1;
			proxyType = "CPGunner";
			proxyIndex = 1;
			gunnerOpticsShowCursor = 1;
			showgunneroptics = 0;
			startEngine = 0;
			initTurn = 0;
			minTurn = 0;
			maxTurn = 0;
			initElev = -10;
			minElev = -30;
			maxElev = 0;
			initFov = 0.95;
			class ViewOptics
			{
				directionStabilized = 1;
				horizontallyStabilized = 1;
				initAngleX = 0;
				minAngleX = 0;
				maxAngleX = 0;
				initAngleY = -10;
				minAngleY = -30;
				maxAngleY = 0;
				initFov = 0.2;//.15
				minFov = 0.01004; //.025;
				maxFov = 0.3;
				visionMode[] = {"Normal","NVG","Ti"};
				thermalMode[] = {0,1,6};
			};
			class ViewGunner
			{
				directionStabilized = 1;
				horizontallyStabilized = 1;
				initAngleX = 0;
				minAngleX = 0;
				maxAngleX = 0;
				initAngleY = -10;
				minAngleY = -30;
				maxAngleY = 0;
				initFov = 0.8;
				minFov = 0.25;
				maxFov = 1.255;
			};

		};
	};
	class EventHandlers: EventHandlers
	{
		Init = "_this execVM ""\EB_Air\scripts\common_init.sqf"";_scr = _this execVM ""\ca\Data\ParticleEffects\SCRIPTS\init.sqf"";[this,player] execVM ""\EB_Air\scripts\AB_init.sqf""; (_this select 0) lockturret [[0],true];";
	};
};

putting gunBeg[] setting into main plane or gunner turret caused a popup "error gunbeg/ is not a value" meaning the plane will not take a gunbeg array of more than one point (for an mg weapon).

the muzzleflashes worked fine, just not the dual tracers

this system works perfectly on ka52, mi24, mi8, mi28, ah6, etc

Edited by eggbeast

Share this post


Link to post
Share on other sites

I tried the setpos now and it looks silly, even in singleplayer so it certainly wont get better in multiplayer

Here you can see the muzzle array + EH script for fire effects switching in action, and the setpos delay by the script, which no doubt would increase in multiplayer.

I tried what happens if you go close to an object (wall) and shoot at it. First you hit, then the setpos takes the projectile after the hit (which has lost alot of energy on first contact) and resets it to the muzzle so it continues from there. Bad. Especially not suited for weapons with high initspeed.

Share this post


Link to post
Share on other sites

it works fine for a tank so why not plane eh... they just dont take gunbeg as an array. awful really...

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  

×