Home   Help Search Login Register  

Author Topic: Animated Crate  (Read 963 times)

0 Members and 2 Guests are viewing this topic.

Knightscope

  • Guest
Animated Crate
« on: 01 Dec 2003, 03:47:46 »
I have made a crate in O2 with weapons inside and tried to add a user animation so that the crate could be opened. When I load it in game the crate looks good and all but It won't open. There is no option in the player menu. Why is it not working. Here is my .cpp file.

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 Crate
   {
      units[] = {Crate};
      weapons[] = {};
      requiredVersion = 1.0;
   };
};
class CfgVehicles
{
   class All{};
   class Static: All{};
   class Building: Static{};
   class Strategic: Building{};
   class Fortress1: Strategic{};

   class Crate : Fortress1
   {
      model="\crate\mirv.p3d";
      armor=20000;
      scope=2;
      displayName="Crate";
   };
};

animated=1;
class Animations
{
   //Crate Open
   class ani_crate
   {
      type="rotation";
      animPeriod=3;
      selection="Crate_top";
      axis="Top_axis";
      angle0=0;
      angle1=-1.5;
   };
};

//UserAction
class UserActions
{
   
   class OpenCrate
   {
      displayName="Open Crate";
      position="Pos_switch";
      radius=2.000000;
      condition="this animationPhase ""ani_crate"" <0.5";
      statement="this animate [""ani_crate"", 1]";
   };

   class CloseCrate
   {
      displayName="Close Crate";
      position="Pos_switch";
      radius=2.000000;
      condition="this animationPhase ""ani_crate"" >=0.5";
      statement="this animate [""ani_crate"", 0]";
   };
};

I made the model in 3dsmax, but I don't se how this would affect it. The axis and the position points are defined in the Memory LOD. Please help me!

P.S. I made a Geometry LOD in O2 but I can still walk through the crate, Why?

Lt.Shitkilla

  • Guest
Re:Animated Crate
« Reply #1 on: 01 Dec 2003, 05:36:19 »
have you added mass to the crate in the geo lod? if you have, then have you gone (in O2, not familiar with 3ds) structure-topology-Find Components. this will then make a list of all the components in the model. this should stop the problem of being able to walk through the crate (i should know, i completed a project like this a while ago, with animated doors, but nothing else) if you'd like, i'll upload the project somewhere that u can look at?

i can see one thing that may be wrong, this is what the section of my config looks like:

Code: [Select]
   class BDGCrate: TargetGrenade
   {
      model="\BDGObjects\Crate";
      vehicleclass="Bloody Days MOD";
      armor=10000;
      scope=2;
      mapsize=0.5;
      displayName="Shipping Crate";      animated=1
      class Animations
      {
         class Dvere1
         {
            type="rotation";
            animPeriod=1
            selection="dvere1";
            axis="osa_dvere1";
            angle0=0
            angle1=-1.600000;
         };
         class Dvere2
         {
            type="rotation";
            animPeriod=1
            selection="dvere2";
            axis="osa_dvere2";
            angle0=0
            angle1=1.600000;
         };
      };
      class UserActions
      {
         class OpenDoors
         {
            displayName="Open R.Side";
            position="osa_dvere1";
            radius=2.500000;
            condition="this animationPhase ""Dvere1"" < 0.5";
            statement="this animate [""Dvere1"", 1.25]";
         };
         class CloseDoors
         {
            displayName="Close R.Side";
            position="osa_dvere1";
            radius=2.500000;
            condition="this animationPhase ""Dvere1"" >= 0.5";
            statement="this animate [""Dvere1"", 0]";
         };
         class OpenDoors2
         {
            displayName="Open L.Side";
            position="osa_dvere2";
            radius=2.500000;
            condition="this animationPhase ""Dvere2"" < 0.5";
            statement="this animate [""Dvere2"", 1.25]";
         };
         class CloseDoors2
         {
            displayName="Close L.Side";
            position="osa_dvere2";
            radius=2.500000;
            condition="this animationPhase ""Dvere2"" >= 0.5";
            statement="this animate [""Dvere2"", 0]";
      };
   };


P.S. dvere1 etc, is only the name of the selection and osa_dvere1 is the axis, you can change all of this in your own.

Lt. Shitkilla