Home   Help Search Login Register  

Author Topic: Prob with custom gear  (Read 1064 times)

0 Members and 1 Guest are viewing this topic.

SpclFrcsSnpr

  • Guest
Prob with custom gear
« on: 11 Mar 2003, 02:50:05 »
I have a problem with the custom gear tutorial. I copied the text strait from the tutorial. The addon works without the animation lines for the gear but with them it gives me this error.

'c130\config.cpp/cfgVehicles/c130.': '{' encountered instead of '='

Here is my Config.





// C130 - by SpclFrcsSnpr


// DEFINE SECTION //////////////
#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

#define private 0
#define protected 1
#define public 2


// CfgPatches //////////////////////////
class CfgPatches
{
   class C130
        {
      units[] = {C130};
      weapons[] = {};
      requiredVersion = 1.85;   
   };
};
   


// CfgModels /////////////////////////////
class CfgModels
{
   class Default {};
   class vehicle: default {};
   
   class firstplane: vehicle
   {
      sectionsInherit="Vehicle";
      sections[]={"vrtule staticka","vrtule blur"};
   };

};



// CfgVehicles //////////////////////////////
class CfgVehicles
{
   class All {};
   class AllVehicles: All {};
   class Air: AllVehicles {};
   class Plane: Air {};
   class A10: Plane {};

   class C130: A10
   {
      scope=public;
           side=TWest;
      displayName="C130";
      model="\C130\c130";
      
      accuracy=0.30;
      gearRetracting = true;
      nameSound="plane";

      soundEngine[]={\c130\running.wav,db-1,1};
      //soundEnviron[]={Objects\noise,db-60,1.0};
      maneuvrability=50.0;
      maxSpeed=450;
      armor=100;

      aileronSensitivity = .8;       // relative aileron sensitivity
      elevatorSensitivity = .8;       // relative elevator sensitivity
      noseDownCoef = .3;          // how much goes nose down during turns
      landingAoa = 10*3.1415/180;
      brakeDistance=300;          // vehicle movement precision
      steerAheadSimul=1.0;
      steerAheadPlan=2.0;

      transportSoldier=18;
      crew = "SoldierWPilot";
      driverAction = ManActUH60Pilot;
   
      extCameraPosition[]={0,3,-35};      // 0,5,-30 is standard Air class

      // Radar stuff
      irTarget=true;
      irScanRange = 2000;
      irScanGround = true;      
      
      // Weapon and ammo
      weapons[]={}; // none
      magazines[]={}; // none

// problem is between here.

      animated=1;
      class Animations
      {
         class LeftGear
         {
            type="rotation";
            animPeriod=2;
            selection="left gear";
            axis="axis gear left";
            angle0=0
            angle1=1.55;
         };
         class RightGear
         {
            type="rotation";
            animPeriod=2;
            selection="right gear";
            axis="axis gear right";
            angle0=0
            angle1=-1.55;
         };
         class NoseGear
         {
            type="rotation";
            animPeriod=2;
            selection="nose gear";
            axis="axis nose gear";
            angle0=0
            angle1=2.2;
         };
      };
      class EventHandlers
      {
      gear = "if (_this Select 1) then {(_this Select 0)                             Animate [""LeftGear"", 0]; (_this Select 0) Animate [""RightGear"", 0]; (_this Select 0) Animate [""NoseGear"", 0]} else {(_this Select 0) Animate [""LeftGear"", 1]; (_this Select 0) Animate [""RightGear"", 1]; (_this Select 0) Animate [""NoseGear"", 1]}";
      };




// and here
      {
                      class ramp
                      {
                              type="rotation";
                              animPeriod=1
                              selection="ramp";
                              axis="osa_ramp";
                              angle0=0
                              angle1=-0.700000;
                      };
                 };
              class UserActions
              {
                      class OpenDoors
                      {
                              displayName="$STR_DN_OUT_O_DOOR";
                              position="osa_ramp";
                              radius=18100;
                              condition="this animationPhase ""ramp"" < 0.5";
                              statement="this animate [""ramp"", 1]";
                      };
                      class CloseDoors
                      {
                              displayName="$STR_DN_OUT_C_DOOR";
                              position="osa_ramp";
                              radius=18100;
                              condition="this animationPhase ""ramp"" >= 0.5";
                              statement="this animate [""ramp"", 0]";
                      };
              };
   };
};


      

Any help Will be appreciated

major asshole

  • Guest
Re:Prob with custom gear
« Reply #1 on: 11 Mar 2003, 06:12:56 »
G'day

It's telling you it's finding a { when it's expecting a =

Also, there's a bracket that doesn't appear to do anything...it looks like a class is missing cuz you have an end bracket too


// and here
      { <--------------------------------------   what is this bracket for?                                    
                      class ramp
                      {
                              type="rotation";
                              animPeriod=1
                              selection="ramp";
                              axis="osa_ramp";
                              angle0=0
                              angle1=-0.700000;
                      };
                 };

Hope this helps

L8R
« Last Edit: 11 Mar 2003, 06:15:41 by major asshole »

Skaircro

  • Guest
Re:Prob with custom gear
« Reply #2 on: 11 Mar 2003, 14:13:15 »
I agree with major asshole (there is no way I can say that without it sounding offensive!  ;D )

:edit: heheheh, I've been censored!!  ;D ::) :-X


Your class ramp seems to be out of place.

Try this:

      class Animations
      {
         class LeftGear
         {
            type="rotation";
            animPeriod=2;
            selection="left gear";
            axis="axis gear left";
            angle0=0
            angle1=1.55;
         };
         class RightGear
         {
            type="rotation";
            animPeriod=2;
            selection="right gear";
            axis="axis gear right";
            angle0=0
            angle1=-1.55;
         };
         class NoseGear
         {
            type="rotation";
            animPeriod=2;
            selection="nose gear";
            axis="axis nose gear";
            angle0=0
            angle1=2.2;
         };
         class ramp
         {
            type="rotation";
            animPeriod=1
            selection="ramp";
            axis="osa_ramp";
            angle0=0
            angle1=-0.700000;
         };
      };

      class UserActions
      {
         class OpenDoors
         {
            displayName="$STR_DN_OUT_O_DOOR";
            position="osa_ramp";
            radius=18100;
            condition="this animationPhase ""ramp"" < 0.5";
            statement="this animate [""ramp"", 1]";
         };
         class CloseDoors
         {
            displayName="$STR_DN_OUT_C_DOOR";
            position="osa_ramp";
            radius=18100;
            condition="this animationPhase ""ramp"" >= 0.5";
            statement="this animate [""ramp"", 0]";
         };
      };

      class EventHandlers
      {
      gear = "if (_this Select 1) then {(_this Select 0) Animate [""LeftGear"", 0]; (_this Select 0) Animate [""RightGear"", 0]; (_this Select 0) Animate [""NoseGear"", 0]} else {(_this Select 0) Animate [""LeftGear"", 1]; (_this Select 0) Animate [""RightGear"", 1]; (_this Select 0) Animate [""NoseGear"", 1]}";
      };



Or check out the attached file.  ;)
« Last Edit: 11 Mar 2003, 14:15:12 by Skaircro »

SpclFrcsSnpr

  • Guest
Re:Prob with custom gear
« Reply #3 on: 12 Mar 2003, 01:58:22 »
Thanks guys. I can't believe I missed that. I had to have gone over that config three times. But I'm only human. Thanks again. That fixed it. Now all I have to do is to get the rotation correct and I will have a fully functional C130! I have all the flaps working. The back Ramp. All I have to do is work on the textures and a couple lods then I am done! ;D