Home   Help Search Login Register  

Author Topic: Vehicle config problem (Turrets & scope)  (Read 11113 times)

0 Members and 1 Guest are viewing this topic.

Offline Wolfrug

  • Addons Depot
  • Former Staff
  • ****
  • Official OFPEC Old Timer
Vehicle config problem (Turrets & scope)
« on: 17 Feb 2010, 19:47:21 »
Hello all,

I've got a bit of a problem with a vehicle config. It's a real simple one: replace the default weapons of a vehicle with my own weapons (which I've defined elsewhere and which work - tested ingame using addweapon). Here's the config, a part of cfgVehicles:

Code: [Select]
class BRDM2_Base;
class Turrets;
class MainTurret;


class RUG_HD_BRDM2_CDF2 : BRDM2_Base
{
faction = "RUG_HD_CDF";
scope = 2;
side = 1;
displayName = "CDF HD BRDM2";
crew = "RUG_HD_CDF_Soldier_Crew";
class Turrets  : Turrets
{

class MainTurret  : MainTurret {
weapons[] = {"RUG_HD_KPVT","RUG_HD_PKT" };
magazines[] = {"500Rnd_145x115_KPVT","1500Rnd_762x54_PKT" };
};
};
};

The "Turrets" and "MainTurret" classes are there to avoid the "undefined base class" error that will prevent Arma 2 from starting. Anyway, once the game loads, I get the following error:

Quote
No entry "bin\config.bin/CfgVehicles/Turrets.scope".

The unit shows up in-game in its proper faction etc (the above error repeats itself whenever I click to add a new unit), but when I place it and then try to preview, the following error appears:

Quote
No entry "bin\config.bin/CfgVehicles/RUG_HD_BRDM2_CDF2/Turrets/MainTurret/selectionFireAnim."

I believe this means that the config, as it stands, is simply incomplete. What I want to know now is whether or not I am actually going to have to include the -whole goddamned vehicle config- to be able to change this one thing (namely the weapons)? Please note I have tried changing the RUG_HD_ weapons to their regular counterparts, but the same errors occur.

At the moment, I'm considering simply using a script to exchange the weapons, but the problem then is that none of the animations follow - this is especially noticeable on the static weapons which have simulated recoil and reload animations, which won't work the same if the weapon has just been added with a script. This in turn makes me wonder if it is at all possible to change the weapons in this way, or if the weapons are integrated with the vehicle on a model-level somehow, meaning I'd have to use a replacement config (which is not an option - and neither is obviously adding the whole of air.pbo, wheeled.pbo and so forth to my addon :P).

Thoughts? Note: the above IS the entire config, as it stands, as it is. Replace RUG_HD_PKT/KPVT with just the regular "PKT" and "KPVT" & remove the custom crew/faction, and then try running it - nothing changes.

Thanks!

Wolfrug out.
"When 900 years YOU reach, look as good you will not!"

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re: Vehicle config problem (Turrets & scope)
« Reply #1 on: 17 Feb 2010, 20:50:09 »
Try this snippet:

Code: [Select]
class CfgVehicles
{
  class Land;
  class LandVehicle: Land
  {
    class NewTurret;
  };

  class Car: LandVehicle
  {
    class Turrets;
  };

  class BRDM2_Base;

  class RUG_HD_BRDM2_CDF2 : BRDM2_Base
  {
    faction = "RUG_HD_CDF";
    scope = 2;
    side = 1;
    displayName = "CDF HD BRDM2";
    crew = "RUG_HD_CDF_Soldier_Crew";

    class Turrets: Turrets
    {
      class MainTurret: MainTurret
      {
        weapons[] = {"RUG_HD_KPVT","RUG_HD_PKT" };
        magazines[] = {"500Rnd_145x115_KPVT","1500Rnd_762x54_PKT" };
      };
    };
  };
};

The 'selectionFireAnim' is part of CfgWeapons -- class Default definition, do you have 'class Default;' at the start of your CfgWeapons section?


Planck
I know a little about a lot, and a lot about a little.

Offline Wolfrug

  • Addons Depot
  • Former Staff
  • ****
  • Official OFPEC Old Timer
Re: Vehicle config problem (Turrets & scope)
« Reply #2 on: 18 Feb 2010, 00:09:46 »
Hey,

Sadly, nothing changed. I had to add class Turrets; and class MainTurret; again, otherwise it complained about missing base class, and once I got in-game the exact same errors popped up. So no dice. :confused:

I suppose I could just copy the whole BRDM2 config over, get it working, and then start removing stuff that isn't necessary.  :dry:

Thank you anyway! Oh, and I do have a class Default; in my weapons config!

Wolfrug out.
"When 900 years YOU reach, look as good you will not!"

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re: Vehicle config problem (Turrets & scope)
« Reply #3 on: 18 Feb 2010, 05:27:58 »
You do have your cfgpatches section as well?


Planck
I know a little about a lot, and a lot about a little.

Offline kju

  • Members
  • *
    • PvPScene - The ArmA II multiplayer community
Re: Vehicle config problem (Turrets & scope)
« Reply #4 on: 18 Feb 2010, 10:49:15 »
Please post your complete config in pastebin.
http://pastebin.jonasscholz.de

You know the RPT right?
http://community.bistudio.com/wiki/arma.RPT

Offline Wolfrug

  • Addons Depot
  • Former Staff
  • ****
  • Official OFPEC Old Timer
Re: Vehicle config problem (Turrets & scope)
« Reply #5 on: 18 Feb 2010, 10:55:09 »
I do, the actual config looks like this:

Code: [Select]
class CfgPatches
{
class RUG_HD
{
units[] = {};
weapons[] = {};
requiredVersion = 1.05;
requiredAddons[] = {"CAWeapons","CAWeapons_AK", "RUG_HD"};
};
};

#include "weaponscfg.h"

class cfgvehicles
{
#include "vehiclescfg.h"
};

Hmm...should the requiredAddons have some mention of CA_Vehicles (or whatever they're called, CA_Wheeled?). Might that be the problem?

@kju

It's not very exciting - the whole config IS there in essence. As mentioned, if I replace the modded weapons with standard weapons, the same still happens. As to the .rpt...yeah.  :confused: As far as I can tell it's complaining about everything that's missing in the config. Here, I'll make a pastebin copy of it for you:

http://pastebin.jonasscholz.de/641

That's probably over a couple of restarts, anyway. Basically it wants all the stuff that's not there - so it somehow seems like the class isn't inheriting properly, or something.

Wolfrug out.
"When 900 years YOU reach, look as good you will not!"

Offline kju

  • Members
  • *
    • PvPScene - The ArmA II multiplayer community
Re: Vehicle config problem (Turrets & scope)
« Reply #6 on: 18 Feb 2010, 15:43:44 »
Thanks.

Yes either the rpt contains problems from previous sessions or you do not (yet)
seem to use the config posted by Planck.
It says the your turret definitions are wrong.

You always have to add the cfgPatches classes of BI,
where the unit/vehicle/weapon/etc is defined.

In other words, you need to make your addon loaded after the BI configs,
after those have defined the config tree.
Otherwise you config will partially overwritten or even broken as the basics
are missing (for class inheritance).

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re: Vehicle config problem (Turrets & scope)
« Reply #7 on: 18 Feb 2010, 16:01:58 »
Quote
use the config posted by Planck
I doesn't work :(

This however does:
Code: [Select]
class CfgVehicles
{
   class Land;
   class LandVehicle : Land {
    class NewTurret;
};

   class Car : LandVehicle {
class Turrets {
class MainTurret : NewTurret {
   };
};
   };

  class BRDM2_Base: Car {};

  class RUG_HD_BRDM2_CDF2 : BRDM2_Base
  {
    faction = "RUG_HD_CDF";
    scope = 2;
    side = 1;
    displayName = "CDF HD BRDM2";
    crew = "RUG_HD_CDF_Soldier_Crew";

    class Turrets: Turrets
    {
      class MainTurret: MainTurret
      {
        weapons[] = {"RUG_HD_KPVT","RUG_HD_PKT" };
        magazines[] = {"500Rnd_145x115_KPVT","1500Rnd_762x54_PKT" };
      };
    };
  };
};

Turret definitions for some weird reason don't get transferred over with external reference so you have to use the old "OFP style" inheriting (was the same in A1)..

Oh and Wolfrug, you might wanna remove the RUG_HD from the required addons, causes you one more error ;)
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline DeanosBeano

  • Addons Depot Staff
  • *****
  • SirDeanosbeano bstowed on me by sui ;)
    • Fraghaus
Re: Vehicle config problem (Turrets & scope)
« Reply #8 on: 18 Feb 2010, 21:11:26 »

 Just a point of note about the above config,
 Bis originally make the BRDM2_base inherit  from :

  class BRDM2_Base : Wheeled_APC
    {

 where as the above  inherits from car .

  class BRDM2_Base: Car {};

 this may have consequences beyond Wolfrugs addon.

  Without having time to put a config in game i would suggest that the original failed because 

A it was not wrapped within the classCFGvehicles
B the turret inheritance was not done correctly ,therefore at the point of  class Turrets: Turrets

 there was No entry of the original Turrets and therefore given as error no entry .

 Wish i had more time to make this post more proven  but real busy, please read this as an unfounded observation rather than Facts ;).

I love ofp

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re: Vehicle config problem (Turrets & scope)
« Reply #9 on: 19 Feb 2010, 01:05:17 »
The example from h- is in error as you say because "BRDM2_Base" inherits directly from "Wheeled_APC" not "Car".

"Wheeled_APC" inherits directly from "Car".

My previous example was correct with 'class BRDM2_Base;'.

Using the amended bits from h- for class Car should work fine though ... I hope, thusly:

Code: [Select]
class CfgVehicles
{
   class Land;
   class LandVehicle : Land
   {
   class NewTurret;
   };

   class Car : LandVehicle
   {
class Turrets
        {
class MainTurret : NewTurret {};
};
   };

   class BRDM2_Base;

   class RUG_HD_BRDM2_CDF2 : BRDM2_Base
   {
    faction = "RUG_HD_CDF";
    scope = 2;
    side = 1;
    displayName = "CDF HD BRDM2";
    crew = "RUG_HD_CDF_Soldier_Crew";

    class Turrets: Turrets
    {
      class MainTurret: MainTurret
      {
        weapons[] = {"RUG_HD_KPVT","RUG_HD_PKT" };
        magazines[] = {"500Rnd_145x115_KPVT","1500Rnd_762x54_PKT" };
      };
    };
  };
};

It gets a bit convoluted doesn't it?


Planck
I know a little about a lot, and a lot about a little.

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re: Vehicle config problem (Turrets & scope)
« Reply #10 on: 19 Feb 2010, 07:49:25 »
Oops, sorry, missed that APC thing.

Planck, that still doesn't work. Try that yourself and you get the missing turret definition error..

I went on and tested further and even though going with the style of the earlier example of mine I can't get the turrets to actually work in-game (changed stuff to not be dependant on the rest of Wolfrug's addon); I either get turning working turret but the gunner view has some missing textures (or the camera view is clipping) and the scope is also missing textures and there's no weapon available (used the default weapons), if I add the turret inheritance stuff into all of the classes in the BRDM inheritance tree I get a non-functional turret..  :dunno:
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline Wolfrug

  • Addons Depot
  • Former Staff
  • ****
  • Official OFPEC Old Timer
Re: Vehicle config problem (Turrets & scope)
« Reply #11 on: 19 Feb 2010, 08:22:15 »
I just wanted to say thank you for all your help so far. I think this is valuable work overall for anyone wanting to create a replacement for only certain parts of an addon.  :) Only wish the inheritance system would be as translucent as it SEEMS to be on the surface...

Wolfrug out.
"When 900 years YOU reach, look as good you will not!"

Offline kju

  • Members
  • *
    • PvPScene - The ArmA II multiplayer community
Re: Vehicle config problem (Turrets & scope)
« Reply #12 on: 19 Feb 2010, 09:12:33 »
This is the clean way.

Code: [Select]
class CfgVehicles
{
class Wheeled_APC;
class BRDM2_Base: Wheeled_APC
{
class Turrets;
};
class BRDM2_CDF: BRDM2_Base
{
class Turrets: Turrets
{
class MainTurret;
};
};
class RUG_HD_BRDM2_CDF: BRDM2_CDF
{
displayName = "CDF HD BRDM2";
faction = "RUG_HD_CDF";
crew = "RUG_HD_CDF_Soldier_Crew";
class Turrets: Turrets
{
class MainTurret: MainTurret
{
weapons[] = {"RUG_HD_KPVT","RUG_HD_PKT"};
};
};
};
};

This works too, as only need to get pass the parser (as long as your design is correct).

Code: [Select]
class Turrets;
class MainTurret;
class CfgVehicles
{
class BRDM2_CDF;
class RUG_HD_BRDM2_CDF: BRDM2_CDF
{
displayName = "CDF HD BRDM2";
faction = "RUG_HD_CDF";
crew = "RUG_HD_CDF_Soldier_Crew";
class Turrets: Turrets
{
class MainTurret: MainTurret
{
weapons[] = {"RUG_HD_KPVT","RUG_HD_PKT"};
};
};
};
};

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re: Vehicle config problem (Turrets & scope)
« Reply #13 on: 19 Feb 2010, 09:32:30 »
Thanks kju, that was actually the only option I didn't test..  ::)
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline moviemaker100

  • Members
  • *
Re: Vehicle config problem (Turrets & scope)
« Reply #14 on: 15 Jan 2012, 15:03:41 »
Hi, I got a similar problem.
I ported an addon from ofp to Arma2 and all works (it is driveable and so on) - except that the vehicle shoots.
The secondary error is, that it is not showen up in the editor, correctly.
Quote
Zitat
// HKAerial by X. PETIT

// some basic defines
#define TEast 0
#define BLUFOR 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 HKAerial
{
units[]={HKAerial};
weapons[]={HKAerialCannon};
requiredVersion=1;
};

};

class CfgModels
{
class default{};
class Vehicle: default{};
class HKAerial: Vehicle
{
sectionsInherit="Vehicle";
sections[]={"velka vrtule staticka", "velka vrtule blur", "mala vrtule staticka", "mala vrtule blur", "C svetlo", "P svetlo", "L svertlo"};
};

};

class CfgAmmo
{
class Default{};
class BulletSingle: Default{};
class BulletSingle7_6: BulletSingle{};
class BulletSingle12_7: BulletSingle7_6{};
class ExplosiveBullet: BulletSingle{};
class HKAerialCannonMun: ExplosiveBullet
{
hit=100;
indirectHit=20;
indirectHitRange=4;
minRange=20;
minRangeProbab=0.800000;
midRange=500;
midRangeProbab=0.950000;
maxRange=3500;
maxRangeProbab=0.050000;
cost=50;
visibleFire=16.000000;
visibleFireTime=10;
tracerColor[]={0.2,0.2,1,10.10000};
tracerColorR[]={0.2,0.2,1,10.10000};
};

};

class CfgWeapons
{
class Default{};
class MGun: Default{};
class MachineGun7_6: MGun{};
class MachineGun12_7: MachineGun7_6{};
class MachineGun30: MachineGun7_6{};
class HKAerialCannon: MachineGun30
{
ammo="HKAerialCannonMun";
displayName="HFLaser";
displayNameMagazine="Laser";
shortNameMagazine="Laser"
sound[]={"\HKAerial\Sounds\laserT2g.wav",db+30,1};
reloadSound[]={"",0.0,1};
soundContinous=0;
count=1500;
reloadTime=0.08;
magazineReloadTime=10;
initSpeed=1500;
flash="";
flashsize=0.000000;
dispersion=0.00750;
maxLeadSpeed=900;
aiRateOfFire=0.020;
aiRateOfFireDistance=10000;
autoFire=1;
optics=1;
};

};

class WeaponFireGun
{
cloudletDuration=0;
cloudletGrowUp=0.000000;
cloudletFadeIn=0;
cloudletFadeOut=0.000000;
interval=0.000000;
size=0.000000;
sourceSize=0.000000;
initT=3200;
deltaT=-3000;
};
class WeaponFireMGun: WeaponFireGun{};

class WeaponCloudsGun
{
access=3;
cloudletGrowUp=0.000000;
cloudletFadeIn=0;
cloudletFadeOut=0.000000;
cloudletDuration=0.000000;
cloudletAnimPeriod=0.000000;
cloudletSize=0.000000;
cloudletAlpha=1.000000;
cloudletAccY=0
cloudletMinYSpeed=0
cloudletMaxYSpeed=0
interval=0.000000;
size=0.000000;
sourceSize=0.000000;
};
class WeaponCloudsMGun: WeaponCloudsGun{};

class CfgVehicles
{
class All{};
class AllVehicles: All{};
class Air: AllVehicles{};
class Helicopter: Air{};
class HKAerialBase: Helicopter
{
side=Blufor;
scope=0;
displayName="HKAerial";
};
class HKAerial: HKAerialBase
{
picture="\HKAerial\icoHKA";
icon="\HKAerial\icnHKA.paa";
crew="USMC_Soldier_Pilot";
scope=0;
side=Blufor;
faction = "USMC";
displayName="HK A400w";
type=VAir;
cost=1600000;
vehicleClass="Air";
accuracy=5.0;
audible=4;
camouflage=4;
threat[]={0.6,1.0,0.9};
nightVision=1;
irScanRange=2500;
irScanGround=1;
laserScanner=1;
weapons[]={"HKAerialCannon"};
magazines[]={"HKAerialCannon"};
secondaryExplosion=-0.025;
model="\HKAerial\HKAerial.p3d";
hiddenSelections[]={};
rotorBig="vrtule_velka";
rotorBigBlend="vrtule_velka_bl";
rotorSmall="vrtule_mala";
rotorSmallBlend="vrtule_mala_bl";
dammageHalf[]={"\data\uh60_kab_sklo2.paa","\data\uh60_kab_skl o2b.paa"};
dammageFull[]={"\data\uh60_kab_sklo2.paa","\data\uh60_kab_skl o2c.paa"};
insideSoundCoef=0.000800;
soundEngine[]={"\HKAerial\Sounds\xlbn25.wav",db+30,1};
soundEnviron[]={};
maxSpeed=400;
enableSweep=true;
mainRotorSpeed=1.500000;
backRotorSpeed=2.00000;
maxMainRotorDive=0;
maxBackRotorDive=0;
minMainRotorDive=0;
minBackRotorDive=0;
neutralMainRotorDive=0;
neutralBackRotorDive=0;
steerAheadSimul=0.300000;
steerAheadPlan=0.500000;
armor=75;
armorStructural=3.0;
armorHull=1.9;
armorEngine=1.6;
armorAvionics=1.8;
armorVRotor=0.5;
armorHRotor=0.8;
armorMissiles=1.6;
armorGlass=1.8;
transportSoldier=0;
hasGunner=1;
driverIsCommander=1;
driverIsgunner=1;
cargoIsCoDriver[]={false};
driverAction="AH64_Pilot";
gunnerAction="AH64_Gunner";
class ViewPilotBase
{
initFov=0.7; minFov=0.7; maxFov=0.90;
initAngleX=0; minAngleX=-25; maxAngleX=25;
initAngleY=0; minAngleY=-70; maxAngleY=70;
};
class ViewPilot: ViewPilotBase {}
class ViewOptics
{
initAngleX=0; minAngleX=-30; maxAngleX=30;
initAngleY=0; minAngleY=-86; maxAngleY=86;
initFov=0.05; minFov=0.01; maxFov=0.05;
};

driverOpticsColor[]={255,0,0,1};
gunnerOpticsColor[]={0,0,0,1};
driverOpticsModel="optika_heli_gunner";
gunnerOpticsModel="optika_zsu_gunner";
driverCanSee=31;
gunnerCanSee=31;


class TurretBase
{
gunAxis="OsaHlavne";
turretAxis="OsaVeze";
gunBeg="usti hlavne";
gunEnd="konec hlavne";
soundServo[]={};
minElev=-150
maxElev=0
minTurn=-360
maxTurn=360
body="otocVez";
gun="otocHlaven";
};
class Turret: TurretBase{};


class Reflectors
{
class Left
{
color[]={0.8,0.8,1,1};
ambient[]={0.07,0.07,0.07,1};
position="svetlo L";
direction="konec svetla L";
hitpoint="";
selection="svetlo PL";
size=0.5;
brightness=1.0;
};

class Right
{
color[]={0.8,0.8,1,1};
ambient[]={0.07,0.07,0.07,1};
position="svetlo P";
direction="konec svetla P";
hitpoint="";
selection="svetlo PP";
size=0.5;
brightness=1.0;
};

class Middle
{
color[]={0.8,0.8,1,1};
ambient[]={0.07,0.07,0.07,1};
position="svetlo M";
direction="konec svetla M";
hitpoint="";
selection="C svetlo";
size=0.5;
brightness=1.0;
};
};


animated=1;

class Animations
{
class Maingear1
{
type=rotation;
animPeriod=1.0;
selection=s2av;
axis=osa_main2b;
angle0=0;
angle1=0.55;
};
class backgear1
{
type=rotation;
animPeriod=1.0;
selection=s2ar;
axis=osa_back2b;
angle0=0;
angle1=-0.61;
};
class flammen
{
type=rotation;
animPeriod=0.01;
selection=flammen;
axis=osa_flammen;
angle0=0;
angle1=3.141581;
};
class thrust
{
type=rotation;
animPeriod=0.01;
selection=thrust;
axis=osa_flammen;
angle0=0;
angle1=3.141581;
};
class gearlights
{
type=rotation;
animPeriod=0.01;
selection=gearlights;
axis=osa_gearlights;
angle0=0;
angle1=3.141581;
};
class switch
{
type=rotation;
animPeriod=0.35;
selection=switch;
axis=osa_switch;
angle0=0;
angle1=1.396258;
};
};


class UserActions
{
class GearUp
{
displayName = "$STR_ACTION_GEAR_UP";
position = "osa_Nose";
radius = 2;
condition = "getpos this select 2 > 0.5 and this animationPhase ""maingear1"" < 0.5 and this animationPhase ""backgear1"" < 0.5";
statement = "[this, 0] exec ""\HKAerial\Scripts\HKAerialanim2.sqs""";
};
class GearDown
{
displayName = "$STR_ACTION_GEAR_DOWN";
position = "osa_Nose";
radius = 2;
condition = "speed this < 150 and speed this > -150 and this animationPhase ""maingear1"" >= 0.5 and this animationPhase ""backgear1"" >= 0.5";
statement = "[this, 1] exec ""\HKAerial\Scripts\HKAerialanim2.sqs""";
};
class Boost
{
displayName = "Booster";
position = "osa_main1";
radius = 20;
condition = "speed this > 1 and speed this < 300 and getpos this select 2 > 5 and this animationPhase ""maingear1"" >= 0.5";
statement = "[this] exec ""\HKAerial\Scripts\boost.sqs""";
};

};


class EventHandlers
{
Init="if (getpos (_this select 0) select 2 > 2) then {[_this select 0, 0] exec ""\HKAerial\Scripts\HKAerialanim2.sqs"";}";
Engine ="if (_this select 1) then {[_this select 0] exec ""\HKAerial\Scripts\rspecial.sqs""}";
};
};

};

class CfgRadio
{
class HKAerialGearDown
{
sound[]={"\HKAerial\Sounds\Gear.ogg",db+50,1};
name="HKAerialGearDown";
title="GearDown";
};
class HKAerialGearUp
{
sound[]={"\HKAerial\Sounds\Gear.ogg",db+50,1};
name="HKAerialGearUp";
title="Gear Up";
};
class HKAerialPowerUp
{
name="HKAerialPowerUp";
sound[]={\HKAerial\Sounds\xlan1str.ogg, db+20,1};
title="System Ok: All are green! Ready for takeoff!";
};
};

class CfgSounds
{
class Booster
{
name="Booster";
sound[]={"\HKAerial\Sounds\boost.ogg", db+20,1};
titles[]={};
};
class BoosterStop
{
name="BoosterStop";
sound[]={\HKAerial\Sounds\boostout.ogg, db+20,1};
titles[]={};
};
};
This is the config.cpp befor I make it a config.bin.
If I re-export the bin to cpp, it shows errors and there is no way to make it a bin again.

Errors are shown around "HKAerialCannon".

Have you any ideas, what I should edit, to make the vehicle fire..?

Thanx!

Here the bin:
Quote
class CfgPatches {

   class HKAerial {
      units = {"HKAerial"};
      weapons = {"HKAerialCannon"};
      requiredVersion = 1;
   };
};

class CfgModels {

   class default {
   };

   class Vehicle: default {
   };

   class HKAerial: Vehicle {
      sectionsInherit = "Vehicle";
      sections = {"velka vrtule staticka", "velka vrtule blur", "mala vrtule staticka", "mala vrtule blur", "C svetlo", "P svetlo", "L svertlo"};
   };
};

class CfgAmmo {

   class Default {
   };

   class BulletSingle: Default {
   };

   class BulletSingle7_6: BulletSingle {
   };

   class BulletSingle12_7: BulletSingle7_6 {
   };

   class ExplosiveBullet: BulletSingle {
   };

   class HKAerialCannonMun: ExplosiveBullet {
      hit = 100;
      indirectHit = 20;
      indirectHitRange = 4;
      minRange = 20;
      minRangeProbab = 0.800000;
      midRange = 500;
      midRangeProbab = 0.950000;
      maxRange = 3500;
      maxRangeProbab = 0.050000;
      cost = 50;
      visibleFire = 16.000000;
      visibleFireTime = 10;
      tracerColor = {0.200000, 0.200000, 1, 10.100000};
      tracerColorR = {0.200000, 0.200000, 1, 10.100000};
   };
};

class CfgWeapons {

   class Default {
   };

   class MGun: Default {
   };

   class MachineGun7_6: MGun {
   };

   class MachineGun12_7: MachineGun7_6 {
   };

   class MachineGun30: MachineGun7_6 {
   };

   class HKAerialCannon: MachineGun30 {
      ammo = "HKAerialCannonMun";
      displayName = "HFLaser";
      displayNameMagazine = "Laser";
      shortNameMagazine = "Laser";
      sound = {"\HKAerial\Sounds\laserT2g.wav", 31.622776, 1};
      reloadSound = {"", 0.000000, 1};
      soundContinous = 0;
      count = 1500;
      reloadTime = 0.080000;
      magazineReloadTime = 10;
      initSpeed = 1500;
      flash = "";
      flashsize = 0.000000;
      dispersion = 0.007500;
      maxLeadSpeed = 900;
      aiRateOfFire = 0.020000;
      aiRateOfFireDistance = 10000;
      autoFire = 1;
      optics = 1;
   };
};

class WeaponFireGun {
   cloudletDuration = 0;
   cloudletGrowUp = 0.000000;
   cloudletFadeIn = 0;
   cloudletFadeOut = 0.000000;
   interval = 0.000000;
   size = 0.000000;
   sourceSize = 0.000000;
   initT = 3200;
   deltaT = -3000;
};

class WeaponFireMGun: WeaponFireGun {
};

class WeaponCloudsGun {
   access = 3;
   cloudletGrowUp = 0.000000;
   cloudletFadeIn = 0;
   cloudletFadeOut = 0.000000;
   cloudletDuration = 0.000000;
   cloudletAnimPeriod = 0.000000;
   cloudletSize = 0.000000;
   cloudletAlpha = 1.000000;
   cloudletAccY = 0;
   cloudletMinYSpeed = 0;
   cloudletMaxYSpeed = 0;
   interval = 0.000000;
   size = 0.000000;
   sourceSize = 0.000000;
};

class WeaponCloudsMGun: WeaponCloudsGun {
};

class CfgVehicles {

   class All {
   };

   class AllVehicles: All {
   };

   class Air: AllVehicles {
   };

   class Helicopter: Air {
   };

   class HKAerialBase: Helicopter {
      side = 1;
      scope = 0;
      displayName = "HKAerial";
      faction = "USMC";
      accuracy = 0.500000;
   };

   class HKAerial: HKAerialBase {
      picture = "\HKAerial\icoHKA";
      icon = "\HKAerial\icnHKA.paa";
      crew = "USMC_Soldier_Pilot";
      scope = 2;
      side = 1;
      displayName = "HK A400w";
      type = "VAir";
      cost = 1600000;
      vehicleClass = "Air";
      accuracy = 5.000000;
      audible = 4;
      camouflage = 4;
      threat = {0.600000, 1.000000, 0.900000};
      nightVision = 1;
      irScanRange = 2500;
      irScanGround = 1;
      laserScanner = 1;
      weapons = {"HKAerialCannon"};
      magazines = {"HKAerialCannon"};
      secondaryExplosion = -0.025000;
      model = "\HKAerial\HKAerial.p3d";
      hiddenSelections = {};
      rotorBig = "vrtule_velka";
      rotorBigBlend = "vrtule_velka_bl";
      rotorSmall = "vrtule_mala";
      rotorSmallBlend = "vrtule_mala_bl";
      dammageHalf = {"\data\uh60_kab_sklo2.paa", "\data\uh60_kab_sklo2b.paa"};
      dammageFull = {"\data\uh60_kab_sklo2.paa", "\data\uh60_kab_sklo2c.paa"};
      insideSoundCoef = 0.000800;
      soundEngine = {"\HKAerial\Sounds\xlbn25.wav", 31.622776, 1};
      soundEnviron = {};
      maxSpeed = 400;
      enableSweep = 1;
      mainRotorSpeed = 1.500000;
      backRotorSpeed = 2.000000;
      maxMainRotorDive = 0;
      maxBackRotorDive = 0;
      minMainRotorDive = 0;
      minBackRotorDive = 0;
      neutralMainRotorDive = 0;
      neutralBackRotorDive = 0;
      steerAheadSimul = 0.300000;
      steerAheadPlan = 0.500000;
      armor = 75;
      armorStructural = 3.000000;
      armorHull = 1.900000;
      armorEngine = 1.600000;
      armorAvionics = 1.800000;
      armorVRotor = 0.500000;
      armorHRotor = 0.800000;
      armorMissiles = 1.600000;
      armorGlass = 1.800000;
      transportSoldier = 0;
      hasGunner = 1;
      driverIsCommander = 1;
      driverIsgunner = 1;
      cargoIsCoDriver = {0};
      driverAction = "AH64_Pilot";
      gunnerAction = "ManActAH1Gunner";

      class ViewPilotBase {
         initFov = 0.700000;
         minFov = 0.700000;
         maxFov = 0.900000;
         initAngleX = 0;
         minAngleX = -25;
         maxAngleX = 25;
         initAngleY = 0;
         minAngleY = -70;
         maxAngleY = 70;
      };

      class ViewPilot: ViewPilotBase {
      };

      class ViewOptics {
         initAngleX = 0;
         minAngleX = -30;
         maxAngleX = 30;
         initAngleY = 0;
         minAngleY = -86;
         maxAngleY = 86;
         initFov = 0.050000;
         minFov = 0.010000;
         maxFov = 0.050000;
      };
      driverOpticsColor = {255, 0, 0, 1};
      gunnerOpticsColor = {0, 0, 0, 1};
      driverOpticsModel = "optika_heli_gunner";
      gunnerOpticsModel = "optika_zsu_gunner";
      driverCanSee = 31;
      gunnerCanSee = 31;

      class TurretBase {
         gunAxis = "OsaHlavne";
         turretAxis = "OsaVeze";
         gunBeg = "usti hlavne";
         gunEnd = "konec hlavne";
         soundServo = {};
         minElev = -150;
         maxElev = 0;
         minTurn = -360;
         maxTurn = 360;
         body = "otocVez";
         gun = "otocHlaven";
      };

      class Turret: TurretBase {
      };

      class Reflectors {

         class Left {
            color = {0.800000, 0.800000, 1, 1};
            ambient = {0.070000, 0.070000, 0.070000, 1};
            position = "svetlo L";
            direction = "konec svetla L";
            hitpoint = "";
            selection = "svetlo PL";
            size = 0.500000;
            brightness = 1.000000;
         };

         class Right {
            color = {0.800000, 0.800000, 1, 1};
            ambient = {0.070000, 0.070000, 0.070000, 1};
            position = "svetlo P";
            direction = "konec svetla P";
            hitpoint = "";
            selection = "svetlo PP";
            size = 0.500000;
            brightness = 1.000000;
         };

         class Middle {
            color = {0.800000, 0.800000, 1, 1};
            ambient = {0.070000, 0.070000, 0.070000, 1};
            position = "svetlo M";
            direction = "konec svetla M";
            hitpoint = "";
            selection = "C svetlo";
            size = 0.500000;
            brightness = 1.000000;
         };
      };
      animated = 1;

      class Animations {

         class Maingear1 {
            type = "rotation";
            animPeriod = 1.000000;
            selection = "s2av";
            axis = "osa_main2b";
            angle0 = 0;
            angle1 = 0.550000;
         };

         class backgear1 {
            type = "rotation";
            animPeriod = 1.000000;
            selection = "s2ar";
            axis = "osa_back2b";
            angle0 = 0;
            angle1 = -0.610000;
         };

         class flammen {
            type = "rotation";
            animPeriod = 0.010000;
            selection = "flammen";
            axis = "osa_flammen";
            angle0 = 0;
            angle1 = 3.141581;
         };

         class thrust {
            type = "rotation";
            animPeriod = 0.010000;
            selection = "thrust";
            axis = "osa_flammen";
            angle0 = 0;
            angle1 = 3.141581;
         };

         class gearlights {
            type = "rotation";
            animPeriod = 0.010000;
            selection = "gearlights";
            axis = "osa_gearlights";
            angle0 = 0;
            angle1 = 3.141581;
         };

         class switch {
            type = "rotation";
            animPeriod = 0.350000;
            selection = "switch";
            axis = "osa_switch";
            angle0 = 0;
            angle1 = 1.396258;
         };
      };

      class UserActions {

         class GearUp {
            displayName = "$STR_ACTION_GEAR_UP";
            position = "osa_Nose";
            radius = 2;
            condition = "getpos this select 2 > 0.5 and this animationPhase "maingear1" < 0.5 and this animationPhase "backgear1" < 0.5";
            statement = "[this, 0] exec "\HKAerial\Scripts\HKAerialanim2.sqs"";
         };

         class GearDown {
            displayName = "$STR_ACTION_GEAR_DOWN";
            position = "osa_Nose";
            radius = 2;
            condition = "speed this < 150 and speed this > -150 and this animationPhase "maingear1" >= 0.5 and this animationPhase "backgear1" >= 0.5";
            statement = "[this, 1] exec "\HKAerial\Scripts\HKAerialanim2.sqs"";
         };

         class Boost {
            displayName = "Booster";
            position = "osa_main1";
            radius = 20;
            condition = "speed this > 1 and speed this < 300 and getpos this select 2 > 5 and this animationPhase "maingear1" >= 0.5";
            statement = "[this] exec "\HKAerial\Scripts\boost.sqs"";
         };
      };

      class EventHandlers {
         Init = "if (getpos (_this select 0) select 2 > 2) then {[_this select 0, 0] exec "\HKAerial\Scripts\HKAerialanim2.sqs";}";
         Engine = "if (_this select 1) then {[_this select 0] exec "\HKAerial\Scripts\rspecial.sqs"}";
      };
   };
};

class CfgRadio {

   class HKAerialGearDown {
      sound = {"\HKAerial\Sounds\Gear.ogg", 316.227753, 1};
      name = "HKAerialGearDown";
      title = "GearDown";
   };

   class HKAerialGearUp {
      sound = {"\HKAerial\Sounds\Gear.ogg", 316.227753, 1};
      name = "HKAerialGearUp";
      title = "Gear Up";
   };

   class HKAerialPowerUp {
      name = "HKAerialPowerUp";
      sound = {"\HKAerial\Sounds\xlan1str.ogg", 10.000000, 1};
      title = "System Ok: All are green! Ready for takeoff!";
   };
};

class CfgSounds {

   class Booster {
      name = "Booster";
      sound = {"\HKAerial\Sounds\boost.ogg", 10.000000, 1};
      titles = {};
   };

   class BoosterStop {
      name = "BoosterStop";
      sound = {"\HKAerial\Sounds\boostout.ogg", 10.000000, 1};
      titles = {};
   };
};
« Last Edit: 15 Jan 2012, 15:19:33 by moviemaker100 »