Jump to content
Sign in to follow this  
[aps]gnat

Missile Turret not attacking

Recommended Posts

Driving me batty ....

Got a ship with 2 turrets, 1 a Gun, 1 a Missile Launcher

If I have a ship with JUST 1 of these turrets/configs each weapon will engage the enmy no problem.

But once I put both weapons on the same ship the Missile Launcher wont shoot.

It will generally follow targets, but not shoot

Even if I make the Missile gunner commander, it will issue orders to attack many things, but wont shoot itself.

Even if I take a lone AI and MoveinGunner into that particular turret, by himself, he wont shoot anything.

If a human gets in it, no problems shoot whatever you like ... sad_o.gif

Any thoughts on why my mixed turret doesn't work.

Scars09 .... can't see how you config gets it to work .... sad_o.gif

Quote[/b] ]// -----------------------------------------------

// Gnat's PB test rig for ArmA

// May 2007

// © p3d models and code

// permission required before using code or models

// Not for commercial use

// See readme for more detail

// -----------------------------------------------

#define TEast 0

#define TWest 1

#define TGuerrila 2

#define TCivilian 3

#define TSideUnknown 4

#define TEnemy 5

#define TFriendly 6

#define TLogic 7

#define true 1

#define false 0

// type scope

#define private 0

#define protected 1

#define public 2

#define WeaponNoSlot 0// dummy weapons

#define WeaponSlotPrimary 1// primary weapons

#define WeaponSlotSecondary 16// secondary weapons

#define WeaponSlotItem 256// items

#define WeaponSlotBinocular 4096// binocular

#define WeaponHardMounted 65536

#define CanSeeRadar 1

#define CanSeeRye 2

#define CanSeeOptics 4

#define CanSeeEar 8

#define CanSeeCompass 16

#define CanSeeAll 31

class CfgPatches

{

class GNTMB2

       {

        units[] = {GNTMB2};

weapons[] = {};

requiredAddons[] = {"CAWater","CAData", "CACharacters", "CAWeapons", "CASounds", "CA_Anims_Char"};

       };

};

class CfgSkeletons

{

class default

{

isDiscrete = 1;

skeletonInherit = "";

skeletonBones[] = {};

};

class GNT_MB2Bones: default

{

isDiscrete=1;

skeletonInherit = "";

skeletonBones[]=

{

"radar","",

"main1turret","",

"main1gun","main1turret",

"main2turret","",

"main2gun","main2turret",

};

   };

};

class cfgWeapons

{

class D30;

class GNT_D30 : D30 {

scope = 1;

displayName = "Naval D30";

magazines[] = {"30Rnd_122mmHE_D30"};

minRange = 1;

minRangeProbab = 0.1;

midRange = 1800;

midRangeProbab = 0.7;

maxRange = 3000;

maxRangeProbab = 0.1;

reloadTime = 3;

magazineReloadTime = 8;

maxLeadSpeed = 100;

autoReload = 1;

canLock = 0;

};

};

class CfgModels

{

class Default

{

sectionsInherit="";

sections[] = {};

skeletonName = "";

};

class allvehicle : Default

{

sectionsInherit="";

sections[] = {};

skeletonName = "";

};

class Ship : allvehicle

    {

        sectionsInherit="";

        sections[] = {"otocvez","otochlaven","radar","kompas","fue

l","hodinova","minutova","mph","rpm","rp

m2"};

        skeletonName = "";

    };

class BBoat : Ship

{

skeletonName = "GNT_MB2Bones";

sectionsInherit="Ship";

sections[] = {"radar","main1turret","main1gun","main2turret",&q

uot;main2gun"};

class Animations

{

class main1turret //the horizontal moving part of the turret

{

type="rotationY";

source="main1turret";

selection="main1turret";

axis="axis1turret";

animPeriod=0;

memory=1;

minValue="rad -360";

maxValue="rad +360";

angle0="rad -360";

angle1="rad +360";

};

class main1gun //the vertical moving part of the turret

{

type="rotationX";

source="main1gun";

selection="main1gun";

axis="axis1gun";

animPeriod=0;

memory=1;

minValue="rad -360";

maxValue="rad +360";

angle0="rad -360";

angle1="rad +360";

};

class main2turret //the horizontal moving part of the turret

{

type="rotationY";

source="main2turret";

selection="main2turret";

axis="axis2turret";

animPeriod=0;

memory=1;

minValue="rad -360";

maxValue="rad +360";

angle0="rad -360";

angle1="rad +360";

};

class main2gun //the vertical moving part of the turret

{

type="rotationX";

source="main2gun";

selection="main2gun";

axis="axis2gun";

animPeriod=0;

memory=1;

minValue="rad -360";

maxValue="rad +360";

angle0="rad -360";

angle1="rad +360";

};

class radar

{

type="rotation";

animPeriod=4;

source = "radar";

sourceAddress = "loop";

selection="Radar";

axis="osa radaru";

angle0=0;

angle1="rad +360";

};

};

};

};

class CfgVehicles

{

class All;

class AllVehicles : All {};

class Land : AllVehicles {};

class LandVehicle : Land {};

class Ship : AllVehicles {};

class GNTShip4 : Ship

{

class NewTurret;

class Turrets;

irScanRangeMin=500;

class viewpilot;

class viewgunner;

};

class GNTMB2: GNTShip4

{

scope=public;

displayName="Fast Patrol Boat";

crew="SoldierEPilot";

side=TEast;

picture="\GNT_MB2\miraj.paa";

mapSize=70;

model="\GNT_MB2\BBoat.p3d";

unloadInCombat = false;

armorHull=1;

armorTurret=0.800000;

armorGun=0.600000;

armorEngine=0.800000;

armorLights=0.400000;

armorTracks=0.600000;

soundEngine[] = {"\ca\Water\Data\Sound\RHIB_1", 7.94328, 0.8};

soundEnviron[] = {"\ca\Water\Data\Sound\Water_v5", 0.00562341, 1.0};

weapons[]={};

magazines[]={};

castDriverShadow = 0;

castCargoShadow = 0;

castGunnerShadow = 0;

hasdriver = true;

hasCommander = 0;

hasGunner=1;

driverisCommander=1;

gunneriscommander = 0;

getInRadius=80;

driverCanSee = 31+32;

gunnerCanSee = 2+4+8+16+1;

memoryPointDriver = {"pilot"};

memoryPointsGetInDriver = "pos driver";

memoryPointsGetInDriverDir = "pos driver dir";

hideWeaponsGunner=true;

hideWeaponsCommander=true;

hideWeaponsDriver = true;

hideWeaponsCargo = true;

hideProxyInCombat = false;

ejectDeadGunner=1;

ejectDeadDriver=1;

ejectDeadCargo=0;

insideSoundCoef = 0.05;

irTarget=true;

irScanRangeMin=500;

irScanRangeMax=4000;

irScanToEyeFactor=7;

irScanGround= false;

nightVision = true;

threat[] = {0.8,1,0.8};

type = 1;

secondaryExplosion = -1;

simulation = "Ship";

namesound = "Ship";

maxSpeed=80;

fuelCapacity=10000;

transportSoldier=2;

typicalCargo[] = {"OfficerE","SoldierEB"};

cargoAction[] = {"RHIB_Driver","RHIB_Driver"};

  getInAction="RHIB_Driver";

driverAction = "RHIB_Driver";

gunnerAction = "BRDM2_Gunner";

class TransportMagazines {};

transportAmmo = 10000;

accuracy = 1.25;

transportVehiclesCount = 0;

enableGPS = 1;

cost=2000000;

armor=2500;

armorStructural=40.0;

extCameraPosition[] = {0, 24.0, -54.0};

animated=1;

memoryPointCommonDamage = "zamerny";

memoryPointCameraTarget = "pilot";

memoryPointcommanderOptics = "pilot";

commanderOpticsModel = "\ca\weapons\optika_D30";

memoryPointMissile[] = {"spicerakety", "ustihlavne2"};

memoryPointMissileDir[] = {"konecrakety", "konechlavne2"};

class Turrets {

class MainTurret : NewTurret {

body = "main1turret";

gun = "main1gun";

animationSourceBody = "main1turret";

animationSourceGun = "main1gun";

gunnerName = "Naval D30";

gunnerAction = "BRDM2_Gunner";

proxyIndex = 1;

castGunnerShadow = 1;

ejectDeadGunner = 0;

outGunnerMayFire = 1;

inGunnerMayFire = 1;

proxyType="CPGunner";

sensitivity=1;

minElev = -3;

maxElev = 35;

soundServo[]={"\ca\wheeled\Data\Sound\servo3",0.000178,0.900000};

initElev = 15;

minTurn = -155;

maxTurn = 155;

initTurn = 0;

gunBeg = "ustihlavne1";

gunEnd = "konechlavne1";

weapons[] = {"GNT_D30"};

magazines[] = {"30Rnd_122mmHE_D30", "30Rnd_122mmHE_D30"};

gunnerOpticsModel = "\ca\wheeled\optika_BRDM";

memoryPointGun = "gunner1";

memoryPointGunnerOptics = "gunner1";

showgunneroptics = 1;

gunnerForceOptics = 0;

startEngine = 0;

hasgunner=true;

primary = 0;

commanding = 0;

primarygunner = 1;

class ViewPilot  {

initAngleX = 15;

minAngleX = 25;

maxAngleX = 55;

initAngleY = 0;

minAngleY = -85;

maxAngleY = 85;

};

class ViewOptics {

initAngleX = 10;

minAngleX = 5;

maxAngleX = 45;

initAngleY = 0;

minAngleY = -100;

maxAngleY = 100;

initFov = 0.6;

minFov = 0.22;

maxFov = 0.9;

};

class ViewGunner {

initAngleX = 20;

minAngleX = 15;

maxAngleX = 60;

initAngleY = 0;

minAngleY = -85;

maxAngleY = 85;

initFov = 0.75;

minFov = 0.6;

maxFov = 0.9;

};

};

class Main2Turret : NewTurret {

body = "main2turret";

gun = "main2gun";

animationSourceBody = "main2turret";

animationSourceGun = "main2gun";

gunnerAction = "BRDM2_Gunner";

gunnerName = "Missile Launcher";

gunnerOpticsModel = "\ca\wheeled\optika_BRDM";

proxyIndex = 2;

castGunnerShadow = 1;

ejectDeadGunner = 0;

proxyType="CPGunner";

minElev = -3;

maxElev = 35;

soundServo[]={"\ca\wheeled\Data\Sound\servo3",0.000178,0.900000};

initElev = 15;

minTurn = -155;

maxTurn = 155;

initTurn = 0;

weapons[] = {"R73Launcher"};

magazines[] = {"4Rnd_R73","4Rnd_R73"};

memoryPointGun = "gunner2";

memoryPointGunnerOptics = "gunner2";

showgunneroptics = 1;

startEngine = 0;

primarygunner = 1;

gunnercansee = 2+4+8+16+1;

outGunnerMayFire = 1;

inGunnerMayFire = 1;

irScanRangeMin = 1000;

irScanRangeMax = 5000;

irScanToEyeFactor = 4;

sensitivity=1;

hasgunner=true;

gunBeg = "ustihlavne2";

gunEnd = "konechlavne2";

gunnerForceOptics = 1;

primary = 1;

commanding = 1;

class ViewPilot  {

initAngleX = 15;

minAngleX = 25;

maxAngleX = 55;

initAngleY = 0;

minAngleY = -85;

maxAngleY = 85;

};

class ViewOptics {

initAngleX = 10;

minAngleX = 5;

maxAngleX = 45;

initAngleY = 0;

minAngleY = -100;

maxAngleY = 100;

initFov = 0.6;

minFov = 0.22;

maxFov = 0.9;

};

class ViewGunner {

initAngleX = 20;

minAngleX = 15;

maxAngleX = 60;

initAngleY = 0;

minAngleY = -85;

maxAngleY = 85;

initFov = 0.75;

minFov = 0.6;

maxFov = 0.9;

};

};

};

};

};

class AnimationSources

{

class  radar

{

source = "time";

sourceAddress = "loop";

animPeriod=5;

};

};

class CfgNonAIVehicles

{

};

Share this post


Link to post
Share on other sites

Hi Gnat,

i found out what messes up the weaponsnames and classes.

delete the simulation "ship" and namesound "ship" entries.

(i deleted them both, the simulation entry should be the problem, but since the original ship class has a namesound="boat" entry the namesound entry can be deleted aswell)

Turret1

Quote[/b] ] primary = 0;

commanding = 0;

primarygunner = 1

Turret2

Quote[/b] ] primarygunner = 1;

primary = 1;

commanding = 1;

delete the primary entry completly,

and of course only 1 primarygunner = 1, all other turrets primarygunner=0.

all the rest should be ok.

Quote[/b] ]

class All;

class AllVehicles : All {};

class Land : AllVehicles {};

class LandVehicle : Land {};

class Ship : AllVehicles {};

class GNTShip4 : Ship

class AllVehicles;

class Ship;

class BBoat : Ship {

class NewTurret;

class Turrets;

irScanRangeMin=500;

class viewpilot;

class viewgunner;

};

class GNTMB2 : BBoat

{

scope=public;

displayName="Fast Patrol Boat";

and so on....

make a backup of your config before you try it.

test it one after another, i actually think that the primarygunner=1 in both turrets is the main problem, maybe in conjunction with the primary=0 (wich seems to be obsolete since arma 1.05 and up)

BTW i got those mines working, thx for the idea how to do it.

sm1.jpg

good luck m8, hope i could help a little wink_o.gif

Share this post


Link to post
Share on other sites

Thanks Scars, did all that, but seemed that was not enough.

I then changed the "commanding" to the likes of -1 and -2 and changed the primarygunner = 1 to the Missile launcher and it started to work ... ya!

But, always a but ... the main gun stopped targeting stuff, only the missile turret was attacking.

I then went back to the Frigate with 4 turrets and did the same changes, now the frigate fires missiles and the CIWS, but again, not the main gun.

So ..... nearly there

I'm thinkin its related to 1 or both;

a) proxy(index) for missile may have to be #1 not #2 as in both my models. Maybe the "primarygunner" has to be first and therefore all other guns will work (like the CIWS which are proxies #3 and #4)

b) Ammo and/or Weapons setup. Maybe thats why the CIWS fire (copies of Vulcan and Shilka weapons) and not the D30 copy.

Thanks for you help again .... we're getting there smile_o.gif

Oh and nice Mine ! So does the Minlayer drop them yet ?

Share this post


Link to post
Share on other sites

Well, its not the gun, changed the Main gun to a M168 also and it failed to open fire as well ..... I'll try the next theory tonight.

Share this post


Link to post
Share on other sites

guns doesnt seem to be the problem. i can add as many as i want, they do attack. only 1 missile launcher, no matter what i tried so far.

i messed up my config, and no turret was firing. all cause i forgot the class viewpilot entry. that brought me on a idea. maybe its possible to set up several different gunnerviews with class gunnerview : class gunnerview1 and so on. i will keep trying.

the mines are working but only as static object so far. so the have to be placed in the editor. but the minesweeper can blow them up from distance when one of the buoys is lowered. could look better, only a cheap animation used, but the script stuff works and i somehow managed a particle effect for the blowing mines, that looks quite ok. so im happy with them so far, i placed them under the surface with some random high and if weather is bad sometimes the stings are visible. but most of the time they the hidden death, for player and ai. smile_o.gif

sooner or later we will make it Gnat, im sure wink_o.gif

Share this post


Link to post
Share on other sites

Yeh, been wondering how I get different gunner views without see the proxy of the other gunner .... might be on to something there.

OK, the turret pain .... seems to be some weapon hierarchy thing going on.

- Now with the main gun as #2 and the missile as #1 turret

- As a D30, main gun wouldnt fire still. Missile did, so did CIWS

- Changed D30 to another M168 and bingo, main gun fired

- BUT of course, the missile and CIWS then stopped !!!  crazy_o.gif

And they dont operate similtaniously, I saw a CIWS start to fire then bang, the main gun started up and the CIWS stopped instantly.

Seem that once the ArmA engine picks the best weapon/turret to shoot a target, all other turret fall silent, even if there are multiple different targets available!

Only exception seem to be a certain combination were different weapons types can fire together, ie Missile Launcher and MG, but that config is touchy.

Gotta get these bloody gunners to be more independant!

..... still experimenting  confused_o.gif

Share this post


Link to post
Share on other sites

Hi Gnat,

did you made any advance? after some experiments i think the config of the vehicle isnt that important. the turret config and the weapon config seem to be the main factors if a gunner shoots or not.

f.e. i wanted the flak turrets to engage airtargets only, so i set the min elevation from -5 to +1. result was that the turret refused to engage any targets.

Another thing i tried was this: i deleted 2 gunner proxies and their named selections from 2 turrets and in their config the proxytype and proxyindex entry. Its kind of an invisible gunner then, only visible after leaving the turret. thing is that they seem to react much better then the proxyindexed guys at least on my testrig. next thing i try is to take all gunnerproxies out, except of the maingunner.

i will report back in after this is done.

goodnight.gif

Share this post


Link to post
Share on other sites
after some experiments i think the config of the vehicle isnt that important. the turret config and the weapon config seem to be the main factors if a gunner shoots or not.

Yeh, think your right Scars.

I fooled around some more with the turrets and managed to get all 4 units shooting (3 M168s and 1 missile) but as soon as I changed the main gun back to a cannon, if stopped engaging.

Initially I didn't realise "MemoryPointGunner" was where MG bullets emerge from turrets and after I moved that to the end of the barrel thing improved. Maybe because the optic position was originally exactly the same point I was using! Maybe it was that or some othe stuff I messed with, its hard to tell at times.

I tried to "separate" the turrets, each with independant turret definitions but not being a config expert it caused crashes each time I went to use ingame. Looking at the standard definitions I suspect you can't have several Turret sections in 1 vehicle.

My current line of experimenting is along similar lines to you, changing ammo and weapon configs to maybe get a more independant gunners.

Quote[/b] ]Its kind of an invisible gunner then, only visible after leaving the turret. thing is that they seem to react much better then the proxyindexed guys at least on my testrig. next thing i try is to take all gunnerproxies out, except of the maingunner.

Interesting ! I'll try some of this too ... cheers and best of luck to us both thumbs-up.gif

Share this post


Link to post
Share on other sites

Hey Gnat,

i think i found something interesting.

I tested one of my ships in the armory. configured as gunner=commander i thought i would be the gunner. but i was the driver and ordered the config defined commander aka the gunner what to do. i did that as "quartermaster".

i didnt define a quartermaster in my ships. the game crashed shortly after. i think it must be related with the compardments command wich i spotted few times in the official configs. it seem that you can issue orders to compardments wich contain serveral units. this should make it possible to use different weaponsystems and to make them engage different targets i think. its all theory at the moment but i will experiment with this, ill keep you updated.

wink_o.gif

Share this post


Link to post
Share on other sites

Hello

I am not a scripter and maybe one of you guys could help me out here..

Im trying to make a quad gun and because i dont like to see multiple barrels fire as one heres what ive done so far.

Using the new animation system of arma i have created 4 turrets and i am still trying to make them all work all in one place but using a diferent barrel to shoot ( i still cant move the other turrets but they are attached to the 1st barrel and move with it).

My first idea is making the player move fast from turret to turret (empty turrets btw) between shots using the "fired" code from a script but like i said im not a scripter..any ideas?

The second idea was to use the commandfire and order the "now manned turrets with invisible gunners" to fire when i press the trigger...

For AI i still dont know but maybe if all gunners look to the same spot they may all fire ( not probable) to the same target and look like a multibarrel gun.

Thanx in advance

Gyr

Share this post


Link to post
Share on other sites

Guys, just a hint for copying large configs and scripts... especially handy to keep the tabs and all other kinds of formatting is posting ur code on a Pastebin:

pastebin.ca

pastebin.com

pastebin.co.uk

etc. etc. simply copy/paste ur code in there, you can even select Syntax highlighting (C++ does fine for ArmA code afaik). Then just copy the pastebin link in ur post, and voila biggrin_o.gif

Sry that I dont have anything to contribute to the real question at hand though sad_o.gif Goodluck with it, can't wait to see your Naval stuff mate!

Share this post


Link to post
Share on other sites

Gyr, you have gone about as far as I have ever gone, I can't think of any way to get it any better.

Thanks for the tip sickboy wink_o.gif

Share this post


Link to post
Share on other sites

sorry gyr, my english is bad, i dont get what exactly you want.

4 barrels firing one after another?

4 barrels firing at once?

or something completly different?

i have a 3 barrel turret and i added 3 weapons to it, ai switch them nicely but the smoke and fire when firing is only at one barrel.

Share this post


Link to post
Share on other sites

@Gnat

i think i saw u wrote somewhere that u can link turrets and shoot them all at the same time, but maybe it was in OFP i cant find that or maybe im just mistaken..anyway thx for reply

@scars

yes im trying to make a quad gun and the desired effect is to change from barrel to barrel in each shot. i cant make a working script with the "fired" handler so i could change from turret to turret instantaniously and i have tried to use the "vehicle fire weapon" command but it doesnt work so it seems..oh well

Gyr

Share this post


Link to post
Share on other sites

if it would be easy to shoot with every barrel, the shilka would do it.instead they use a mixture of 2 config commands to fake it.

burst

multiplier

both can fake a 4 barrel weapon by using burst=4 or multiplier=4

burst, one shot after another.

multiplier, all shots at once.

thats how every weapon in the game is configured when having multiple barrels. all fake.

another, fake, possibility is to give the turret 4 identical weapons, wich need to be switched by ai after every shot (this means the reload time need to be quite big, otherwise they just wait for reload).

the difference to the burst and multiplier method is that it is possible to fire real single shots, wich isnt possible with burst (always 4 shorts in a row), or multiplier (always 4 shot at once).

thats why i used the last method with my 3 barrel turret, works nicely, if target destroyed they stop at the fired barrel and reload, if target still alive they switch weapon to next "barrel" and shoot and so on.

still all methods are fake cause the use a single point were the bullets are created and therefor a single firefx. to get around that a fired eventhandler triggering a particlescript would be the right solution, or to config individual fireeffect for the 4 used weapons (all firing at barrel1, but the last 3 firefx offset to fit to other barrels).

im sure you can get around this issue with other methods aswell, but honestly, its too much work just to have a (realistic) visual effect.

Share this post


Link to post
Share on other sites

Gyr,

I did get other gunners to exactly follow another turret (by accident really), but I didn't get them to fire.

Maybe you could have 4 turrets (and gunners) all using the same axis, but I'm not sure if you can even force them to fire seeing it was an messed up Config that made it "work".

Share this post


Link to post
Share on other sites

Just bumping this because I had the same problem (my 2 turret boat was being weird and not using the rear gun, though it would follow targets). This thread pointed me toward the solution so hey I might as well post what made it work for me in case it helps someone.

I modded the RHIB2Turret so both turrets could rotate 360 degrees, then made variants with different weapons for the rear turret. Anyway, this seems to work:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">class Turrets : Turrets {

class MainTurret : MainTurret {

[...]

primaryGunner = 0;

primaryObserver = 1;

commanding = 1;

primary = 0;

};

class BackTurret : BackTurret {

[...]

primaryGunner = 1;

primaryObserver = 0;

commanding = 0;

primary = 1;

};

};

The [...] is just the gun angle and weapon stuff, there's nothing else in there but that.

Either gun worked for the primaryObserver/commander, but the front gun had better results because it tended to be facing forward. Moving the commander from the driver to a gunner also seemed to make the AI much more alert. Before, I could fly right over a boat and it sometimes wouldn't even react.

Share this post


Link to post
Share on other sites

Thanks for the contribution Hondo ...... going to check my code over again with your info smile_o.gif

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  

×