Home   Help Search Login Register  

Author Topic: Building Animation Prob  (Read 7785 times)

0 Members and 2 Guests are viewing this topic.

Offline Pilot

  • Contributing Member
  • **
Building Animation Prob
« on: 28 Nov 2004, 02:19:46 »
I have been making an island for Ofp for the last year and a half.  Everything is going well except for one thing.  I have made several buildings for my island, and a few of them have animations defined in the config.  When I place these buildings in the mission editor, the animations work.  However, when I place them into the map using WRPTool, the animations don't work.  

What do I need to do to get the animations to work when the buildings are placed in WRPTool?

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:Building Animation Prob
« Reply #1 on: 28 Nov 2004, 02:53:59 »
I think the addon needs to be in ODOL format to work correctly with animations when placed in .wrp files.

I'm presuming your building addon is still in MLOD format, if so you may need to convert it to ODOL format with BIS's Binarize utility.

Hope that sorts your problem.


Planck
« Last Edit: 28 Nov 2004, 02:54:55 by Planck »
I know a little about a lot, and a lot about a little.

Offline Pilot

  • Contributing Member
  • **
Re:Building Animation Prob
« Reply #2 on: 28 Nov 2004, 02:57:01 »
I have binarized my buildings, and to no avail

Thanks for the quick response!

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:Building Animation Prob
« Reply #3 on: 28 Nov 2004, 03:03:34 »
Have you looked at the Commented Configs from BIS in case there is something missing from your config or even a selection not defined as it should be.


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

Offline Pilot

  • Contributing Member
  • **
Re:Building Animation Prob
« Reply #4 on: 28 Nov 2004, 03:14:48 »
I'll check my config, but why would the animations work when the building is placed in the mission editor, and not when they are placed in WRPTool?

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:Building Animation Prob
« Reply #5 on: 28 Nov 2004, 03:21:26 »
Strange things happen like that in OFP.

You could always post the config here for people to check for you.


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

Offline Pilot

  • Contributing Member
  • **
Re:Building Animation Prob
« Reply #6 on: 28 Nov 2004, 03:30:49 »
Here is my config.

Code: [Select]
#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

class CfgPatches
{
   class Larsen
    {
        worlds[] = {"Larsen"};
      units[] = {Tower, CTerminal, LTerminal, RTerminal, StraightTerminal, Apartment, Radar, BrickPath, ParkingLot, CastleWall, CastleWallDestroyed, CastleGate, CastleWallCorner, Shops, Concourse, Airport2};
        requiredVersion = 1.85;
   };
};
class CfgEnvSounds {};
class CfgWorlds
{
   class DefaultWorld {};
   class  Larsen: DefaultWorld
   {
      access=3;
      description="Larsen Island";
      icon="\Larsen\Larsen.paa";
      worldName="Larsen.wrp";
      cutscenes[]={"..\Res\AddOns\Larsen\Larsen\intro"};
      plateFormat="         ";
      plateLetters="ABCDEFGHIJKLMNOPQRSTUVWXYZ";
      startTime="00:00";
      startDate="01/01/00";
      startWeather=0;
      startFog=0;
      forecastWeather=0;
      forecastFog=0;
      ilsPosition[]={4225,1540};
      ilsDirection[]={0, 0.122, 1};
      ilsTaxiIn[]=
      {
         4625,950,
         4625,1217,
         4617,1225,
         4283,1225,
         4275,1233,
         4275,1617,
         4267,1625,
         4230,1625,
         4225,1617,
         4225,1607,
         4225,1597,
         4225,1587,
      };
      ilsTaxiOff[]=
      {
         4225,1540,
         4225,1133,
         4228,1125,
         4417,1125,
         4425,1117,
         4425,933,
         4433,925,
         4553,925,
         4560,917,
         4560,870,
         4567,863,
         4624,863,
         4631,870,
         4631,910,
      };
      seagullPos[]={0,0,0};
      centerPosition[]={6000,1500,5000};
      class Sounds
      {
         sounds[]={};
      };
      class Animation
      {
         vehicles[]={};
      };
      class Names
      {
         class Unknown
         {
            name="Unknown City";
            position[]={6075,1050,20};
         };
         class UnknownIntlAirport
         {
            name="Unknown Airport";
            position[]={4200,0925,10};
         };
         class WestCove
         {
            name="West Cove";
            position[]={1200,4825,20};
         };
         class SaintMichael
         {
            name="Saint Michael";
            position[]={417,1510,20};
         };

      };
   };
};
class CfgWorldList
{
   class  Larsen{};
};
class CfgVehicles
{
   class All{};
   class Static: All{};
   class Building: Static{};
   class NonStrategic: Building{};

   class Tower: NonStrategic
   {
      model="..\Res\AddOns\Larsen\TowerBalcony.p3d";
      armor=1000;
      scope=2;      
      displayName="Tower";
      vehicleClass="Tom's Stuff";
      ladders[]={ {"start1","end1"}, {"start2", "end2"} };
      animated=1;
      class Animations
      {
         class ani_beacon
         {
            angle0=0;
            angle1="-20000 * 3.141592654";
            multiplyer=20;
            type="rotation";
            animperiod=100000;
            selection="beacon";
            axis="beacon_axis"
         };
      };
      class eventhandlers
      {
         init="(_this select 0) animate [""ani_beacon"", 1]";
      };
   };
   class CTerminal: NonStrategic
   {
      model="..\Res\AddOns\Larsen\CTerminal.p3d";
      armor=2000;
      scope=2;      
      displayName="Center Terminal";
      vehicleClass="Tom's Stuff";
   };         
   class LTerminal: NonStrategic
   {
      model="..\Res\AddOns\Larsen\LTerminal.p3d";
      armor=2000;
      scope=2;      
      displayName="Left Terminal";
      vehicleClass="Tom's Stuff";
   };         
   class RTerminal: NonStrategic
   {
      model="..\Res\AddOns\Larsen\RTerminal.p3d";
      armor=2000;
      scope=2;      
      displayName="Right Terminal";
      vehicleClass="Tom's Stuff";
      animated=1;
      class Animations
      {
         class ani_Sign1_1
         {
            angle0=0;
            angle1=1.57;
            type="rotation";
            animperiod=.01;
            selection="Sign1";
            axis="Sign1_axis"
         };
         class ani_Sign1_2
         {
            angle0=1.57;
            angle1=3.14;
            type="rotation";
            animperiod=.01;
            selection="Sign1";
            axis="Sign1_axis"
         };
         class ani_Sign1_3
         {
            angle0=3.14;
            angle1=4.71;
            type="rotation";
            animperiod=.01;
            selection="Sign1";
            axis="Sign1_axis"
         };
         class ani_Sign1_4
         {
            angle0=4.71;
            angle1=6.28;
            type="rotation";
            animperiod=.01;
            selection="Sign1";
            axis="Sign1_axis"
         };
      };
      class eventhandlers
      {
         init=_this exec "..\Res\AddOns\Larsen\Sign.sqs";
      };
   };               
   class StraightTerminal: NonStrategic
   {
      model="..\Res\AddOns\Larsen\StraightTerminal.p3d";
      armor=2000;
      scope=2;      
      displayName="Straight Terminal";
      vehicleClass="Tom's Stuff";
   };         
   class Apartment: NonStrategic
   {
      model="..\Res\AddOns\Larsen\Apartment.p3d";
      armor=1500;
      scope=2;      
      displayName="Apartment";
      vehicleClass="Tom's Stuff";
   };         
   class Radar: NonStrategic
   {
      model="..\Res\AddOns\Larsen\Radar.p3d";
      armor=300;
      scope=2;      
      displayName="Radar";
      vehicleClass="Tom's Stuff";
      animated=1;
      class Animations
      {
         class ani_radar
         {
            angle0=0;
            angle1="-50000 * 3.141592654";
            multiplyer=20;
            type="rotation";
            animperiod=100000;
            selection="radar";
            axis="radar_axis"
         };
      };
      class eventhandlers
      {
         init="(_this select 0) animate [""ani_radar"", 1]";
      };
   };      
   class BrickPath: NonStrategic
   {
      model="..\Res\AddOns\Larsen\BrickPath.p3d";
      scope=2;      
      displayName="Brick Path";
      vehicleClass="Tom's Stuff";
   };         
   class ParkingLot: NonStrategic
   {
      model="..\Res\AddOns\Larsen\ParkingLot.p3d";
      scope=2;      
      displayName="Parking Lot";
      vehicleClass="Tom's Stuff";
   };         
   class CastleWall: NonStrategic
   {
      model="..\Res\AddOns\Larsen\CastleWall.p3d";
      scope=2;      
      displayName="Castle Wall";
      vehicleClass="Tom's Stuff";
   };         
   class CastleWallDestroyed: NonStrategic
   {
      model="..\Res\AddOns\Larsen\CastleWallDestroyed.p3d";
      scope=2;      
      displayName="Destroyed Castle Wall";
      vehicleClass="Tom's Stuff";
   };         
   class CastleGate: NonStrategic
   {
      model="..\Res\AddOns\Larsen\CastleGate.p3d";
      scope=2;      
      displayName="Castle Gate";
      vehicleClass="Tom's Stuff";
   };         
   class CastleWallCorner: NonStrategic
   {
      model="..\Res\AddOns\Larsen\CastleWallCorner.p3d";
      scope=2;      
      displayName="Castle Wall Corner";
      vehicleClass="Tom's Stuff";
   };         
   class Shops: NonStrategic
   {
      model="..\Res\AddOns\Larsen\Building.p3d";
      scope=2;      
      displayName="Building";
      vehicleClass="Tom's Stuff";
   };
   class Concourse: NonStrategic
   {
      model="..\Res\AddOns\Larsen\Concourse.p3d";
      scope=2;      
      displayName="Concourse";
      vehicleClass="Tom's Stuff";
   };
   class Airport2: NonStrategic
   {
      model="..\Res\AddOns\Larsen\Airport2.p3d";
      scope=2;      
      displayName="Airport 2";
      vehicleClass="Tom's Stuff";
   };
};

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:Building Animation Prob
« Reply #7 on: 28 Nov 2004, 03:40:53 »
It would be best if you had your models along with their config separate from your .wrp config.

Also you have no cfgModels section defined.

I'll have a better look through it later today, but for now it is bedtime.


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

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:Building Animation Prob
« Reply #8 on: 28 Nov 2004, 15:10:01 »
Ok

I had a longer look at your config and the news isn't good.

You are using the init eventhandler for the animations, unfortunately the init eventhandler doesn't work for .wrp placed objects.


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

Offline Pilot

  • Contributing Member
  • **
Re:Building Animation Prob
« Reply #9 on: 28 Nov 2004, 17:40:42 »
ok, I now have 2 questions

(1).  What do I need to do to get the animations working for .wrp placed objects?

(2).  How necessary is it to have a CfpModels section?  I have looked at several addons recently, and some don't have it.

Thank you for taking the time to work with me!


Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:Building Animation Prob
« Reply #10 on: 28 Nov 2004, 18:57:54 »
Here is an example from one of BIS's configs, this portion is for one of the buildings that have openable doors.

Code: [Select]
class Dum04: HousesDatadisk
   {
      model="\O\Hous\Hlidac_budka";
      animated=1
      class Animations
      {
         class Dvere1
         {
            type="rotation";
            animPeriod=1
            selection="dvere1";
            axis="osa_dvere1";
            angle0=1.600000;
            angle1=0
         };
         class Dvere2
         {
            type="rotation";
            animPeriod=1
            selection="dvere2";
            axis="osa_dvere2";
            angle0=1.600000;
            angle1=0
         };
      };
      class UserActions
      {
         class OpenDoors1
         {
            displayName="$STR_DN_OUT_O_DOOR";
            position="osa_dvere1";
            radius=2.500000;
            condition="this animationPhase ""Dvere1"" < 0.5";
            statement="this animate [""Dvere1"", 1]";
         };
         class CloseDoors1
         {
            displayName="$STR_DN_OUT_C_DOOR";
            position="osa_dvere1";
            radius=2.500000;
            condition="this animationPhase ""Dvere1"" >= 0.5";
            statement="this animate [""Dvere1"", 0]";
         };
         class OpenDoors2
         {
            displayName="$STR_DN_OUT_O_DOOR";
            position="osa_dvere2";
            radius=2.500000;
            condition="this animationPhase ""Dvere2"" < 0.5";
            statement="this animate [""Dvere2"", 1]";
         };
         class CloseDoors2
         {
            displayName="$STR_DN_OUT_C_DOOR";
            position="osa_dvere2";
            radius=2.500000;
            condition="this animationPhase ""Dvere2"" >= 0.5";
            statement="this animate [""Dvere2"", 0]";
         };
      };
   };

Of course that puts the door open/close in the user menu when the player is close enough.


As for the cfgModels, here is what BIS says inside their main config, as a comment:

Quote
// describe some properties models need to meet
// this was introduces in order to maintain consistent
// section management for HW T&L

Sometimes without a cfgModels section it will refuse to work.


Planck
« Last Edit: 28 Nov 2004, 18:59:56 by Planck »
I know a little about a lot, and a lot about a little.

Offline Pilot

  • Contributing Member
  • **
Re:Building Animation Prob
« Reply #11 on: 28 Nov 2004, 20:23:06 »
If the init eventhandler doesn't work for .wrp placed objects, then what eventhandler will?

Also,

Quote
// describe some properties models need to meet
// this was introduces in order to maintain consistent
// section management for HW T&L

What does this mean?

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:Building Animation Prob
« Reply #12 on: 28 Nov 2004, 21:33:18 »
To the best of my knowledge no eventhandlers work with .wrp placed objects.........but I am willing to be proved wrong.   ::)

The text I posted was a comment inserted by BIS into their game config in relation to the cfgModels section.

Quite often models will not load in-game unless they have this section in their config.cpp

The cfgModels section defines the class of object and any sections or selections it has defined in the p3d model and also from where it might inherit from if that is relevant to the model..


Planck
« Last Edit: 28 Nov 2004, 21:34:33 by Planck »
I know a little about a lot, and a lot about a little.

Offline Pilot

  • Contributing Member
  • **
Re:Building Animation Prob
« Reply #13 on: 28 Nov 2004, 21:37:34 »
So are you saying there's no way to get the animations to work on .wrp placed objects?

Also, I am a complete idiot with writing configs (It's a miracle it's gotten as far as it has).  How would I go about adding a CfgModels section, and do I need one for every object in the addon?

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:Building Animation Prob
« Reply #14 on: 28 Nov 2004, 21:51:34 »
Yes there is a way, look at the code sample I posted above.....the one from the game config.
The animations can be activated by the player when he is close enough.....to a door for instance, or a switch if it is to turn on a rotating animation.

I'm not an expert on getting animations to work however and someone else might know another way of doing it.

If you wait a while I will see what I can do about a cfgModels section.
It requires that your object models and all their texture files are in their own PBO.

Are you interested?


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