Jump to content
Sign in to follow this  
JahBit

What am i doing wrong?

Recommended Posts

I'am trying to animate "sliding" double doors.

The config.cpp should be okay atleast untill the animations are defined...

I searched but didn't find any official definitions/documentation for making animations, so I imitated the animations config from AGS' industrial pack.

The only difference I see is that I havent defined the CfgModels bit (never have - and things have worked before).

I think my broblem is caused because I havent defined the "DoorR" and "DoorL" animation classes prior to using them...

This is the error message I get when trying to start OFP (I've got the GOTY-edition):

'jpt_vault\config.cpp/CfgVehicles/JPT_Vault/Animations.Class': 'E' encountered instead of '='

The E is actually a D. Ie. DoorR, but I changed it for debugging...

Here's the code:

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

#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 private 0

#define protected 1

#define public 2

class CfgPatches

{

class JPT_Vault

{

units[] = {JPT_Vault};

weapons[] = {};

requiredVersion = 1.85;

};

};

//End CfgPatches

class CfgVehicles

{

 class All {};

 class Static: All {};

 class Building: Static {};

 class NonStrategic: Building {};

 class House: NonStrategic {};

 class JPT_Vault: House

 {

   armor=2500000;

   scope = public;

   model="\JPT_Vault\m_p3d\JPT_Vault";

   VehicleClass="Objects";

   nameSound="building";

   mapsize=5;

   side=TCivilian;

   displayName="Vault entrance";

   destrType=DestructNo;

   animated=1;

   Class Animations

   {

     Class EoorR //(D->E for debugging) - this is where the error happens!

     {

       type="rotation";

       animPeriod=10;

       selection="DoorR";

       axis="osa_Door";

       angle0=0;

       angle1=-0.029670;

     };

     Class DoorL

     {

       type="rotation";

       animperiod=10;

       selection="DoorL";

       axis="osa_Door";

       angle0=0;

       angle1=0.029670;

     };

   };

   // End Animations

   Class UserActions

   {

     class OpenDoors

     {

       displayName="Open Vault Doors";

       position="in_range";

       radius=1;

       condition="this animationPhase ""DoorR"" < 0.5";

       statement="this animate [""DoorR"", 1]; this animate [""DoorL"", 1]";

     };

     class CloseDoors

     {

       displayName="Close Vault Doors";

       position="in_range";

       radius=1;

       condition="this animationPhase ""DoorR"" >= 0.5";

       statement="this animate [""DoorR"", 0]; this animate [""DoorL"", 1]";

     };

   };

   // End UserActions

 };

 //End Class JPT_Vault

};

// End CfgVehicles

Oh and the problem is there when the 'EoorR' is 'DoorR' but the error messages E is D... so...

Share this post


Link to post
Share on other sites
Guest BratZ

I looked and can't see anything wrong, it should work.

Shouldn't produce errors even if you have no selections within your model named.

Wondering maybe because of no cfgmodels?

Share this post


Link to post
Share on other sites

I agree with Bratz; I don't see anything wrong with the code snippet you posted. Three questions/suggestions to try and narrow down the issue:

1. Have you put in a CfgModels-section and did it work?

2. Does the add-on work when you leave the whole Animations-class out of the config? Also try only having one of the animations defined ("DoorL" would be your best bet) and see if that works.

3. Have you tried different class names for your animations?

Share this post


Link to post
Share on other sites

Ok this is solved... yep.

I'm not shure if the solution I am presenting is the correct one.

Real simple: I had some extra 'Enters' or "breaklines" or whateveryoucallthem...

I removed the spaces from here:

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

...

destrType=DestructNo;

  animated=1;

  Class Animations

  {

...

and here:

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

...

};

  // End Animations

  Class UserActions

  {

...

I also moved the comment lines to the end of the previous line (ie }; //comment). But this really doesn't make a difference... ?

what I did:

1. Added the CfgModels -> no change

2.1 Added 'Vault_' prefix to doorR & doorL -> no change

2.2a. Removed class animations -> error message: ...'U' instead of '='

2.2b. Removed class useractions too -> addon works. No anims...

3. kept fooling around with the config because you guys said it's basically ok -> removed some 'enters' -> it works!!

Thanks for the encouragement guys!

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  

×