View Full Version : Gun fails to slave to turret
I've got a rather strange problem that has been throwing me fits for some time now.
Basically, I've got a turret that animates properly, but the weapon itself does not follow the turret movement - despite the proper selections being bound to the right points in the model, etc.
The gunner view point does follow the turret motion, but when I attempt to switch the firing point to the viewpoint, it changes nothing.
Is there a special code that must be placed in the weapons, or have I missed something?
RN Malboeuf
Jun 29 2007, 08:09
I guess you got an error in cfgSkeletones http://forums.bistudio.com/oldsmileys/wink_o.gif look BMD-1 config as an example
[APS]Gnat
Jun 29 2007, 10:43
Post your config if you want guidance
Sorry, should of thought of that beforehand.
<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">
//B-26G Marauder by Franze
// some basic defines
#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 CanSeeRadar 1
#define CanSeeEye 2
#define CanSeeOptics 4
#define CanSeeEar 8
#define CanSeeCompass 16
//#define CanSeeRadarC CanSeeRadar+CanSeeCompass
#define CanSeeAll 31
class Mode_SemiAuto
{
ammo = "Bullet";
multiplier = 1;
burst = 1;
displayName = "$STR_DN_MODE_SEMIAUTO";
dispersion = 0.000200;
sound[] = {"",10.000000,1};
soundContinuous = 0;
reloadTime = 0.100000;
ffCount = 1;
ffMagnitude = 0.500000;
ffFrequency = 11;
flash = "gunfire";
flashSize = 0.100000;
recoil = "Empty";
recoilProne = "Empty";
autoFire = 0;
aiRateOfFire = 0.500000;
aiRateOfFireDistance = 500;
useAction = 0;
useActionTitle = "";
showToPlayer = 1;
minRange = 30;
minRangeProbab = 0.100000;
midRange = 300;
midRangeProbab = 0.580000;
maxRange = 600;
maxRangeProbab = 0.040000;
};
class CfgPatches
{
class mas_b26
{
units[] = {mas_b26base,mas_b26};
weapons[] = {};
requiredVersion = 1.0;
requiredAddons[] = {"CAWater","CAData", "CACharacters", "CAWeapons", "CASounds", "CA_Anims_Char"};
};
};
class CfgSkeletons
{
class Default
{
isDiscrete = 1;
skeletonInherit = "";
skeletonBones[] = {};
};
class Vehicle : Default{};
class Plane : Vehicle
{
skeletonInherit="Vehicle"; // loads the bones of class Vehicle
skeletonBones[]=
{
"vrtule 0","vrtule 0 blur", // right engine prop
"vrtule 1","vrtule 1 blur", // left engine prop
};
};
class mas_b26_skel : Plane
{
skeletonInherit="Plane"; // loads the bones of class Plane
skeletonBones[]=
{
"leftprop","", // main rotor
"rightprop","", //tail rotor
"nosegear","", //nose gear
"maingear","", //main gear
"otocvez","", // gun body
"otochlaven","otocvez", // gun
"otocvez_tail","", // tailgun body
"otochlaven_tail","otocvez_tail", // tailgun
"otocvez_nose","", // tailgun body
"otochlaven_nose","otocvez_nose", // tailgun
};
};
};
class cfgModels
{
class Default {};
class Vehicle: Default {};
class Plane: Vehicle
{
sectionsInherit="Vehicle";
sections[]=
{
"vrtule 0",
"vrtule 0 blur",
"vrtule 1",
"vrtule 1 blur",
"otochlaven",
"otocvez"
};
skeletonName="Plane";
class Animations
{
class rotation
{
type = "rotationX";
source = "wheel";
selection = "pravy predni";
axis = "";
memory = true;
sourceAddress = "loop";
minValue = 0;
maxValue = 1;
angle0 = 0;
angle1 = "rad -360";
};
class IndicatorAltRadar: Rotation
{
source="altRadar";
sourceAddress="loop";
selection="alt";
axis="osa_alt";
memory=0;
maxValue=304;
angle1="rad -360";
};
class IndicatorAltRadar2: IndicatorAltRadar
{
selection="alt2";
axis="osa_alt2";
};
/*
class IndicatorAltBaro: IndicatorAltRadar
{
selection = "nm_alt";
axis = "osa_nm_alt";
angle = -180;
min = 0;
max = 61;
};
class IndicatorSpeed
{
selection = "mph";
axis = "osa_mph";
angle = -320;
min = 0;
max = 125;
};
class IndicatorVertSpeed
{
selection = "vert_speed";
axis = "osa_vert_speed";
angle = -300;
min = -30;
max = 30;
};
class IndicatorRPM
{
selection = "rpm";
axis = "osa_rpm";
angle = -320;
min = 0;
max = 12;
};
class IndicatorCompass
{
selection = "kompas";
axis = "osa_kompas";
angle = -360;
min = -3.1415926536;
max = 3.1415926536;
};
class IndicatorWatch
{
hour = "hodinova";
minute = "minutova";
axis = "osa_time";
reversed = true;
};
class IndicatorAltRadar2
{
// max for this indicator is 1000 feet (i.e. 304m)
// note: this is actualy Baro altitude (name is wrong)
selection = "alt2";
axis = "osa_alt2";
angle = -360;
min = 0;
max = 304;
};
class IndicatorAltBaro2
{
// max for this indicator is 200 feet (i.e. 61m)
// note: this is actualy Radar altitude (name is wrong)
selection = "nm_alt2";
axis = "osa_nm_alt2";
angle = -180;
min = 0;
max = 61;
};
class IndicatorSpeed2
{
selection = "mph2";
axis = "osa_mph2";
angle = -320;
min = 0;
max = 125;
};
class IndicatorVertSpeed2
{
selection = "vert_speed2";
axis = "osa_vert_speed2";
angle = -300;
min = -30;
max = 30;
};
class IndicatorRPM2
{
selection = "rpm2";
axis = "osa_rpm2";
angle = -320;
min = 0;
max = 12;
};
class IndicatorCompass2
{
selection = "kompas2";
axis = "osa_kompas2";
angle = -360;
min = -3.1415926536;
max = 3.1415926536;
};
class IndicatorWatch2
{
hour = "hodinova2";
minute = "minutova2";
axis = "osa_time2";
reversed = true;
};
*/
};
};
class fz_b26: Plane
{
sectionsInherit="Plane";
sections[]={"vrtule 0","vrtule 1"};
skeletonName = "mas_b26_skel";
class Animations : Animations
{
class rightprop
{
type = "rotationZ";
source = "rotor";
selection = "vrtule 0";
axis = "osa vrtule 0";
memory = 1;
sourceAddress = "loop";
minValue = 0;
maxValue = 1;
angle0 = 0;
angle1 = "rad +360";
};
class leftprop
{
type = "rotationZ";
source = "rotor";
selection = "vrtule 1";
axis = "osa vrtule 1";
memory = 1;
sourceAddress = "loop";
minValue = 0;
maxValue = 1;
angle0 = 0;
angle1 = "rad +360";
};
class nosegear
{
type = "rotationX";
source = "gear";
selection = "ngear";
axis = "osa_ngear";
memory = 1;
minValue = 0;
maxValue = 1;
angle0 = 0;
angle1 = "rad +105";
};
class maingear
{
type = "rotationX";
source = "gear";
selection = "maingear";
axis = "osa_maingear";
memory = 1;
minValue = 0;
maxValue = 1;
angle0 = 0;
angle1 = "rad +73";
};
class mainTurret
{
type = "rotationY";
source = "mainTurret";
selection = "otocvez";
axis = "osaveze";
animPeriod = 0;
memory = 1;
minValue = "rad -360";
maxValue = "rad +360";
angle0 = "rad -360";
angle1 = "rad +360";
};
class mainGun
{
type = "rotationX";
source = "mainGun";
selection = "otochlaven";
axis = "osahlavne";
animPeriod = 0;
memory = 1;
minValue = "rad -360";
maxValue = "rad +360";
angle0 = "rad -360";
angle1 = "rad +360";
};
class tailTurret
{
type = "rotationY";
source = "tailTurret";
selection = "otocvez_tail";
axis = "osaveze_tail";
animPeriod = 0;
memory = 1;
minValue = "rad -360";
maxValue = "rad +360";
angle0 = "rad -360";
angle1 = "rad +360";
};
class tailGun
{
type = "rotationX";
source = "tailGun";
selection = "otochlaven_tail";
axis = "osahlavne_tail";
animPeriod = 0;
memory = 1;
minValue = "rad -360";
maxValue = "rad +360";
angle0 = "rad -360";
angle1 = "rad +360";
};
class noseTurret
{
type = "rotationY";
source = "noseTurret";
selection = "otocvez_nose";
axis = "osaveze_nose";
animPeriod = 0;
memory = 1;
minValue = "rad -360";
maxValue = "rad +360";
angle0 = "rad -360";
angle1 = "rad +360";
};
class noseGun
{
type = "rotationX";
source = "noseGun";
selection = "otochlaven_nose";
axis = "osahlavne_nose";
animPeriod = 0;
memory = 1;
minValue = "rad -360";
maxValue = "rad +360";
angle0 = "rad -360";
angle1 = "rad +360";
};
};
};
};
class CfgAmmo
{
class Default{};
class BulletCore : Default{};
class BulletBase : BulletCore{};
class B_20mm_AA: BulletBase {};
class MissileCore : Default{};
class MissileBase: MissileCore{};
class M_Sidewinder_AA: MissileBase{};
class M_Hellfire_AT: MissileBase{};
class B_30mm_AP: BulletBase{};
/*
class mas_ah64_agm114l: M_Hellfire_AT
{
model = "\mas_ah64\stores\fz_hf1";
proxyShape = "\mas_ah64\stores\fz_hf1";
hit = 1200;
indirectHit = 20;
indirectHitRange = 0.200000;
cost = 10000;
maxSpeed = 425;
irLock = 1;
manualControl = 0;
maxControlRange = 8000;
initTime = 0.150000;
thrustTime = 2.500000;
thrust = 350;
trackOversteer = 1;
trackLead = 1;
maneuvrability = 25;
};
*/
class mas_b26_50calbul: B_30mm_AP
{
hit=30;
indirectHit=3;
indirectHitRange=1;
//airLock=true;
//laserLock=false;
//irLock=true;
cost=15;
explosive=false;
minRange=20;
minRangeProbab=0.20;
midRange=200;
midRangeProbab=0.50;
maxRange=1000;
maxRangeProbab=0.05;
thrust=250;
//soundHit[]={"\mas_heliwep\sounds\hitbull6.wav",3.162278,1};
tracerColor[]={2.000000,0.500000,0.000000,1.000000};
tracerColorR[]={2.000000,0.500000,0.000000,1.000000};
};
};
class CfgWeapons
{
class Default{};
class MGunCore: Default{};
class LauncherCore: Default{};
class CannonCore: Default{};
class M197: CannonCore{};
class MissileLauncher: LauncherCore{};
class SidewinderLaucher: MissileLauncher{};
class mas_b26_4x50: M197
{
displayName="4x50cal Gunpacks";
displayNameMagazine="M2 .50";
shortNameMagazine="M2 .50";
//ammo="fz_m230a";
count=1000;
reloadTime=0.07;
burst=4;
multiplier=1;
//sound[]={"\mas_heliwep\sounds\m230_10rnd.wav",86.162278,1};
//cursorAim="\fz_ah64d\curs_230.paa";
//dexterity=0.001;
dexterity=0.0001;
dispersion=0.001;
initspeed=1800;
soundContinuous=0;
aiRateOfFire=0.1; // delay between shots at given distance
aiRateOfFireDistance=1200; // at shorter distance delay goes lineary to zero
magazines[]={mas_b26_m250_1000rnd};
};
};
class CfgMagazines
{
class Default {};
class CA_Magazine: Default {};
class VehicleMagazine: CA_Magazine {};
class mas_b26_m250_1000rnd: VehicleMagazine
{
scope = 2;
displayName = "1000 Round .50cal Magazine";
ammo = "mas_b26_50calbul";
count = 1000;
initSpeed = 1036;
};
};
class CfgVehicles
{
class All;
class AllVehicles : All {};
class Land : AllVehicles {};
class LandVehicle : Land {};
class Air : AllVehicles {};
class Plane: Air {};
class AV8B: Plane {};
class mas_b26base: AV8B
{
scope=0;
displayName="B-26 Marauder";
side=1;
class NewTurret;
class Turrets;
irScanRangeMin=500;
class viewpilot;
class viewgunner;
};
class mas_b26g: mas_b26base
{
side=1;
scope=2;
displayName="B-26G";
model="\mas_b26\fz_b26.p3d";
//picture="\mas_ah64\ah64_rpic.paa";
//icon ="\mas_ah64\ah64_ricn.paa";
maxSpeed = 510;
weapons[]={"mas_b26_4x50"};
magazines[]={"mas_b26_m250_1000rnd"};
gunAimDown = 0;
//nameSound="chopper";
// 9.162278
//soundEngine[]={"\mas_ah64\sound\hel_rnin.wav",db+10,1};
//insideSoundCoef = 0.006;
vehicleclass="Air";
hasGunner=1;
armor=150;
//audible=2;
//camouflage=1.2;
// 0 1 2 3 4 5 6 7 8 9 10 11 12
//hiddenselections[]={"hf1","hf2","hf3","hf4","hf5","hf6","hf7","hf8","mapev","mapma","mapko","mapdi","mapno"};
transportSoldier=2;
//cargoAction[]={"mas_fz_ah64crgst","mas_fz_ah64crgst_r"};
accuracy=5;
//simulation=helicopter;
driverAction = "UH60_Pilot";
//gunnerAction = "ManActmas_fz_ah64gunner";
enableSweep=1;
//gunnerIsCommander=true;
gunnerUsesPilotView=0;
crew="SoldierWPilot";
animated=1;
//Calculation is visibility*irScanToEyeFactor
//irScanRanges are the limits
irScanToEyeFactor = 4;
irScanRangeMax=8000;
irScanRangeMin=100;
//irScanRange=8000;
laserScanner=1;
//fuelCapacity=110;
nightVision=0;
//mainRotorSpeed = 1;
//threat[] VSoft, VArmor, VAir
threat[]={0.8,1,0.9};
//Armor values
armorStructural=2.5; // structural dammage
armorHull=0.75;
armorEngine=0.9;
armorAvionics=1.6;
armorVRotor=0.75;
armorHRotor=1.0;
armorMissiles=1.8;
armorGlass=1.0;
//driverOpticsModel = "\mas_ah64\optics\ah64d_pnvs.p3d";
//driverCanSee = CanSeeEye+CanSeeOptics+CanSeeEar+CanSeeRadar;
//gunnerCanSee = CanSeeAll;
//unitinfotype="unitinfoapc";
//ARMA CONFIG POINTS
memoryPointLMissile = "l strela";
memoryPointRMissile = "p strela";
memoryPointLRocket = "l raketa";
memoryPointRRocket = "p raketa";
memoryPointsGetInDriver = "pos driver";
memoryPointsGetInDriverDir = "pos_driver_dir";
class Turrets: Turrets {
class MainTurret: NewTurret {
body = "otocvez";
gun = "otochlaven";
animationSourceBody = "MainTurret";
animationSourceGun = "MainGun";
gunnerName = "Top Turret Gunner";
gunnerAction = "AH1Z_Gunner";
proxyIndex = 1;
castGunnerShadow = 1;
ejectDeadGunner = 0;
outGunnerMayFire = 1;
inGunnerMayFire = 1;
proxyType="CPGunner";
sensitivity=1;
soundServo[]={"\ca\wheeled\Data\Sound\servo3",0.000178,0.900000};
minElev = 0;
maxElev = 90;
initElev = 0;
minTurn = -360;
maxTurn = 360;
initTurn = 0;
gunBeg = "usti_hlavne_top";
gunEnd = "konec_hlavne_top";
weapons[]={"mas_b26_4x50"};
magazines[]={"mas_b26_m250_1000rnd"};
gunnerOpticsModel = "\ca\weapons\optika_empty";
memoryPointGun = "konec_hlavne_top";
memoryPointGunnerOptics = "gunnerview";
showgunneroptics = 1;
gunnerForceOptics = 0;
startEngine = 0;
hasgunner=true;
primary = 0;
commanding = 0;
primarygunner = 0;
};
class TailTurret: MainTurret {
body = "otocvez_tail";
gun = "otochlaven_tail";
animationSourceBody = "TailTurret";
animationSourceGun = "TailGun";
gunnerName = "Tail Gunner";
gunnerAction = "AH1Z_Gunner";
proxyIndex = 2;
castGunnerShadow = 1;
ejectDeadGunner = 0;
outGunnerMayFire = 1;
inGunnerMayFire = 1;
proxyType="CPGunner";
sensitivity=1;
soundServo[]={"\ca\wheeled\Data\Sound\servo3",0.000178,0.900000};
minElev = -60;
maxElev = 60;
initElev = 0;
minTurn = -60;
maxTurn = 60;
initTurn = 0;
gunBeg = "usti_hlavne_tail";
gunEnd = "konec_hlavne_tail";
weapons[]={"mas_b26_4x50"};
magazines[]={"mas_b26_m250_1000rnd"};
gunnerOpticsModel = "\ca\weapons\optika_empty";
memoryPointGun = "konec_hlavne_tail";
memoryPointGunnerOptics = "gunnerview2";
showgunneroptics = 1;
gunnerForceOptics = 0;
startEngine = 0;
hasgunner=true;
primary = 0;
commanding = 0;
primarygunner = 0;
};
class NoseGun: MainTurret {
body = "otocvez_nose";
gun = "otochlaven_nose";
animationSourceBody = "NoseTurret";
animationSourceGun = "NoseGun";
gunnerName = "Nose Gunner";
gunnerAction = "AH1Z_Gunner";
proxyIndex = 3;
castGunnerShadow = 1;
ejectDeadGunner = 0;
outGunnerMayFire = 1;
inGunnerMayFire = 1;
proxyType="CPGunner";
sensitivity=1;
soundServo[]={"\ca\wheeled\Data\Sound\servo3",0.000178,0.900000};
minElev = -20;
maxElev = 20;
initElev = 0;
minTurn = -30;
maxTurn = 30;
initTurn = 0;
gunBeg = "usti_hlavne_nose";
gunEnd = "konec_hlavne_nose";
weapons[]={"mas_b26_4x50"};
magazines[]={"mas_b26_m250_1000rnd"};
gunnerOpticsModel = "\ca\weapons\optika_empty";
memoryPointGun = "konec_hlavne_nose";
memoryPointGunnerOptics = "gunnerview3";
showgunneroptics = 1;
gunnerForceOptics = 0;
startEngine = 0;
hasgunner=true;
primary = 0;
commanding = 0;
primarygunner = 0;
};
};
class ViewPilot
{
initFov=0.700000;
minFov=0.400000;
maxFov=0.850000;
initAngleX=0;
minAngleX=-75;
maxAngleX=50;
initAngleY=0;
minAngleY=-150;
maxAngleY=150;
};
class ViewGunner
{
initFov=0.700000;
minFov=0.400000;
maxFov=0.850000;
initAngleX=0;
minAngleX=-75;
maxAngleX=50;
initAngleY=0;
minAngleY=-150;
maxAngleY=150;
};
class ViewOpticsBase
{
initAngleX=0;
minAngleX=-120;
maxAngleX=+120;
initAngleY=0;
minAngleY=-80;
maxAngleY=+15;
initFov=0.7;
minFov=0.7;
maxFov=0.7;
};
class ViewOptics: ViewOpticsBase
{
initAngleX=0;
minAngleX=-120;
maxAngleX=+120;
initAngleY=0;
minAngleY=-80;
maxAngleY=+15;
initFov=0.7;
minFov=0.03;
maxFov=0.7;
};
/*
class IndicatorVertSpeed
{
selection = "vert_speed";
axis = "osa_vert_speed";
angle = 360;
min = -190;
max = 190;
};
class IndicatorAltBaro2
{
// max for this indicator is 200 feet (i.e. 61m)
// note: this is actualy Radar altitude (name is wrong)
selection = "nm_alt2";
axis = "osa_nm_alt2";
angle = 7;
min = 0;
max = 61;
};
class IndicatorRPM
{
selection = "rpm";
axis = "osa_rpm";
angle = -48;
min = 0;
max = 24;
};
class IndicatorRPM2
{
selection = "rpm2";
axis = "osa_rpm2";
angle = -48;
min = 0;
max = 24;
};
*/
class AnimationSources;
class Animations
{
class rightgear
{
type = "rotation";
animperiod = 0.5;
selection ="rgear";
axis = "osa_rgear";
angle0 = 0;
angle1= -0.296705;
};
class leftgear
{
type = "rotation";
animperiod = 0.5;
selection ="lgear";
axis = "osa_lgear";
angle0 = 0;
angle1= -0.296705;
};
class tailwheel
{
type = "rotation";
animperiod = 0.5;
selection ="tailwheel";
axis = "osa_tailwheel";
angle0 = 0;
angle1= -0.261798;
};
};
};
[/QUOTE]
[APS]Gnat
Jun 30 2007, 08:27
Theres always pitfall in any of this code, but my first suggestion is some conistency in you section and animation naming;
i.e.
Quote[/b] ] class GNT_FrigBones: default
{
isDiscrete=1;
skeletonInherit = "";
skeletonBones[]=
{
"main1turret","",
"main1gun","main1turret",
"main2turret","",
"main2gun","main2turret",
"main3turret","",
"main3gun","main3turret",
"main4turret","",
"main4gun","main4turret",
};
};
Quote[/b] ] 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 : main1turret //the horizontal moving part of the turret
{
source="main2turret";
selection="main2turret";
axis="axis2turret";
};
class main2gun : main1gun //the vertical moving part of the turret
{
source="main2gun";
selection="main2gun";
axis="axis2gun";
};
Your Turret definition looks off too. It should look something like this;
Quote[/b] ] class Turrets {
class MainTurret : NewTurret {
body = "main1turret";
gun = "main1gun";
animationSourceBody = "main1turret";
animationSourceGun = "main1gun";
gunnerAction = "BRDM2_Gunner";
gunnerName = "Missile Launcher";
gunnerOpticsModel = "\ca\wheeled\optika_BRDM";
proxyIndex = 1;
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"};
memoryPointGunnerOptics = "gunner1";
memoryPointGun = "konechlavne1";
showgunneroptics = 1;
startEngine = 0;
gunnercansee = 2+4+8+16+1;
outGunnerMayFire = 1;
inGunnerMayFire = 1;
irScanRangeMin = 1000;
irScanRangeMax = 5000;
irScanToEyeFactor = 4;
sensitivity=1;
hasgunner=true;
gunBeg = "ustihlavne1";
gunEnd = "konechlavne1";
gunnerForceOptics = 1;
commanding = -1;
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;
};
};
Start with that I'd suggest, because your current naming is confusing.
Well, thanks for the words of wisdom Gnat - you're probably right, I'm sure it has something to do with my messy config. http://forums.bistudio.com/oldsmileys/wink_o.gif
I'll play around with it until I find out what the problem is.
Small update:
I didn't necessarily get the turrets fixed, however, when I inherited from the AH1W and helicopter class as opposed to AV8B and Plane class, all turrets worked properly. When I turned it back into a plane derived unit, the turret problem came back.
Is it possible that fixed wing aircraft cannot have working turrets in this form? Has anyone tried making a plane with a turret yet?
Big Dawg KS
Jul 20 2007, 06:37
I know someone who had the same problem, I'll see if I can't get him to tell you what the problem is and how to fix it (because I simply forgot).
Edit: I know it has something to do with the animationSourceBody, animationSourceGun, body and gun entries.
Edit2: I think it might be that body and gun actualy require the animation names, not the selection names.
I think I see what you're trying to say... will check it out ASAP.
EDIT -
My little experiment didn't work. I believed that the controller may have been incorrect, so I changed the sources to MainTurret and MainGun, and reflected these changes to the turret code. The firing point remains firmly attached to a fixed position on the aircraft despite turret movement.
Big Dawg KS
Jul 20 2007, 20:08
I think animationSourceBody and body should be the same and animationSourceGun and gun should also be the same because your animation and source names are the same. Ex, with the following in CfgAnimations:
<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">class tailTurret
{
source = "tailTurret";
};
class tailGun
{
source = "tailGun";
};[/QUOTE]
Then in CfgVehicles, for tailTurret you should have:
<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">class TailTurret: MainTurret {
body = "tailTurret";
gun = "tailGun";
animationSourceBody = "tailTurret";
animationSourceGun = "tailGun";
[/QUOTE]
Just tried that; no result.
I think I need to try an experimental platform and then come back to this one... Thanks for trying to help! http://forums.bistudio.com/oldsmileys/smile_o.gif
EDIT - Tried an experimental platform and got the same result. Turret will work, but weapon is fixed forward.
RN Malboeuf
Jul 22 2007, 06:30
Franze
Can you try another vehicle simulation with this model ? Config it like a tank for ex. If turrets will work - it's arma issue if not - search for error
Big Dawg KS
Jul 22 2007, 18:01
How about you post the config of your experimental platform. I've seen this exact problem before and we were able to fix it so I'm pretty sure the solution is the same.
This was the experimental platform:
<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">
// some basic defines
#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
class CfgPatches
{
class mas_orca
{
units[] = {mas_orcabase,mas_orca};
weapons[] = {};
requiredVersion = 1.0;
};
};
class CfgSkeletons
{
class Default
{
isDiscrete = 1;
skeletonInherit = "";
skeletonBones[] = {};
};
class Vehicle : Default{};
class plane : Vehicle
{
skeletonInherit="Vehicle"; // loads the bones of class Vehicle
skeletonBones[]=
{
"otocvez","", // gun body
"otochlaven","otocvez", // gun
};
};
class mas_orca_skel : plane
{
isDiscrete=1;
skeletonInherit=""; // loads the bones of class Plane
skeletonBones[]=
{
"otocvez","", // gun body
"otochlaven","otocvez", // gun
};
};
};
class cfgModels
{
class Default {};
class Vehicle: Default {};
class Plane: Vehicle{};
class Orca: Plane
{
sectionsInherit="Vehicle";
sections[]={"velka vrtule staticka","velka vrtule blur","mala vrtule staticka","mala vrtule blur"};
skeletonName = "mas_orca_skel";
class Animations
{
class MainTurret
{
type = "rotationY";
source = "MainTurret";
selection = "otocvez";
axis = "osaveze";
animPeriod = 0;
memory = 1;
minValue = "rad -360";
maxValue = "rad +360";
angle0 = "rad -360";
angle1 = "rad +360";
};
class MainGun
{
type = "rotationX";
source = "MainGun";
selection = "otochlaven";
axis = "osahlavne";
animPeriod = 0;
memory = 1;
minValue = "rad -360";
maxValue = "rad +360";
angle0 = "rad -360";
angle1 = "rad +360";
};
};
};
};
class CfgVehicles
{
class All;
class AllVehicles : All {};
class Land : AllVehicles {};
class LandVehicle : Land {};
class Air : AllVehicles
{
class NewTurret;
};
class Plane: Air {};
class AV8B: Plane {};
class mas_orcabase: AV8B
{
scope=0;
displayName="Orca";
side=0;
class Turrets
{
class MainTurret: NewTurret
{
outGunnerMayFire = 1;
commanding = -1;
memoryPointsGetInGunner = "pos gunner";
memoryPointsGetInGunnerDir = "pos gunner dir";
memoryPointGun = "machinegun";
memoryPointGunnerOptics = "gunnerview";
selectionFireAnim = "zasleh";
castGunnerShadow = 1;
viewGunnerShadow = 1;
gunnerAction = "AH1Z_Gunner";
gunnerInAction = "AH1Z_Gunner";
gunnerOpticsModel = "\ca\air\optika_heli_gunner";
gunnerForceOptics = 0;
startEngine=0;
class HitTurret
{
armor = 0.800000;
material = 51;
name = "vez";
visual = "vez";
passThrough = 1;
};
class HitGun
{
armor = 0.400000;
material = 51;
name = "zbran";
visual = "zbran";
passThrough = 1;
};
};
};
irScanRangeMin=500;
class viewpilot;
class viewgunner;
};
class Orca: mas_orcabase
{
scope=public;
//icon="\quetzal\qtzl_icn.paa";
displayName="Orca";
//vehicleclass="Heavy Gear - Aircraft";
nameSound="plane";
accuracy=10.0;
precision=200;
model="\mas_orca\orca.p3d";
driverAction="AH1Z_Gunner";
//commanderAction="AH1Z_Gunner";
driverIsCommander=1;
//gunnerAction="ManActUH60Pilot";
//gunnerOpticsModel="optika_empty";
//gunnerUsesPilotView=1;
enableSweep=true;
weapons[]={};
magazines[]={};
hasGunner=1;
crew="SoldierEPilot";
transportSoldier="20"
memoryPointGun = "machinegun";
picture="";
maxSpeed=200;
side=0;
armor=400;
soundEngine[]={"\orca\orca_engine.wav",10,0.9};
//soundDammage[]={Objects\alarm_loop1,db+5,1};
cost=10000000;
type=2;
threat[]={1,0.050000,0.050000};
secondaryExplosion=-0.025;
transportAmmo=90000;
transportRepair=90000;
animated=1;
class Turrets
{
class MainTurret: NewTurret
{
gunnerAction = "AH1Z_Gunner";
gunnerInAction = "AH1Z_Gunner";
body = "MainTurret";
gun = "MainGun";
animationSourceBody = "MainTurret";
animationSourceGun = "MainGun";
primary = 1;
primarygunner = 1;
weapons[]={"fz_m230a"};
magazines[]={"fz_ah64_m230_350rnd"};
memoryPointsGetInGunner = "pos gunner";
memoryPointsGetInGunnerDir = "pos_gunner_dir";
memoryPointGun = "machinegun";
minElev = 0;
maxElev = 90;
initElev = 0;
minTurn = -360;
maxTurn = 360;
initTurn = 0;
gunnerOpticsModel = "\ca\weapons\optika_empty";
gunnerName = "Top Turret Gunner";
commanding = 0;
ejectDeadGunner=0;
forceHideGunner=1;
gunBeg = "usti_hlavne_top";
gunEnd = "konec_hlavne_top";
gunnerForceOptics=0;
gunnerOutOpticsModel="\ca\Weapons\optika_empty";
gunnerForceOutOptics=0;
gunnerUsesPilotView=1;
hasGunner=1;
hideWeaponsGunner=1;
inGunnerMayFire=1;
lockWhenDriverOut=0;
maxHorizontalRotSpeed=1.200000;
maxVerticalRotSpeed=1.200000;
outGunnerMayFire=1;
primaryObserver=0;
proxyType="CPGunner";
proxyIndex=1;
selectionFireAnim="";
soundServo[]={"",0.003162,1.000000};
startEngine=0;
viewGunnerInExternal=1;
};
};
};
[/QUOTE]
@<hidden>
Problem is that figuratively, I can just change it to a different type of vehicle and turret will work magically. I tried it as deriving from the AH1W class and the turrets worked; but when I derived from AV8B and tried simulation="helicopter", resulted in a crash. There's plenty more to try, I'm sure.
RN Malboeuf
Jul 28 2007, 17:11
I had the same experience recently. I configured a plane with back turret - turret rotates, view point rotates, zasleh animated ,view point moves (but faced ahead not backwards as i wanted), and bullets come out of the nose http://forums.bistudio.com/oldsmileys/sad_o.gif though i defined the point for this turret. I defined memoryPointGunnerOutOptics too. I inherited the plane from helicopter and... it works! butnot with plane simulation http://forums.bistudio.com/oldsmileys/sad_o.gif
Thus it looks like a bug... i really wonder if turrets can be set on the plane http://forums.bistudio.com/oldsmileys/sad_o.gif
I'm afraid that at this time, the only thing you can use turrets for on a plane is for observation - targeting pods and the like. Which isn't too hot because the pilot can't steer the turret.
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.