Home   Help Search Login Register  

Advertisement

Author Topic: Animations help  (Read 2445 times)

0 Members and 1 Guest are viewing this topic.

Offline Radiator

  • Members
  • *
Animations help
« on: 05 Jul 2010, 04:19:19 »
Hi all, I am new to Arma modding and have done alot of modding in Graw2 but the scripting is way deferent in Arma.
So I have a question or two for oxygen 2 and animations.

(1) Can you move two objects at the same time in the bulldozer. ( two windows side beside opening from the middle )

I can only move them one at a time (anim-0 then anim-1) mmb wheel

(2) Can you make two doors open from one side ( bi-fold doors - one door pivots on the wall and the second door pivots from the first door.)

If someone can help this would be nice.

Rad..

Offline DeanosBeano

  • Addons Depot Staff
  • *****
  • SirDeanosbeano bstowed on me by sui ;)
    • Fraghaus
Re: Animations help
« Reply #1 on: 05 Jul 2010, 18:05:41 »


 The answer to Both solutions is to make the Source of the second object = the first object , this way when the first window moves so will the second, in addition when your door pivots from the wall and traverses , the second will pivot and traverse.
 you will need to apply this to your skeleton bones too so the engine knows that not only do they move as one part but also independently.

 Watch out in your Arma.rpt for unkown animation source, you may have to do it all by user source and use a script.

I love ofp

Offline Radiator

  • Members
  • *
Re: Animations help
« Reply #2 on: 10 Jul 2010, 14:05:52 »
Hi Deanos, Sorry mate, it been a big week at work, I just sat down at the computer. I have had a play around but I still can't seem to get it to work.

when you say
Quote
"make the Source of the second object = the first object"
are you talking about scripting in side the "model.cfg"?

And

Quote
"you will need to apply this to your skeleton bones too so the engine knows that not only do they move as one part but also independently."

Do you mean this: -
skeletonBones[]=
      {
         "door_1",
         "door_2",
         "",
         "door_2",
                  ""
      };
   };


this is what I have in my model.cfg

class CfgSkeletons
{
   class Default
   {
      isDiscrete=0;
      skeletonInherit="";
      skeletonBones[]={};
   };

   class TUT_doors_skeleton: Default
   {
      isDiscrete=0;
      skeletonInherit="";
      skeletonBones[]=
      {

         "door_1",
         "door_2",
         "",
         "door_2",
         ""
      };
   };

};
class CfgModels
{
   class rotation;
   class Default
   {
      sectionsInherit="";
      sections[]={};
      skeleton="";
      class Animations
      {
      };
   };
   class TUT_doors
   {
      sectionsInherit="";
      sections[]={};
      skeletonName="TUT_doors_skeleton";
   };

   class my_doors: TUT_doors
   {
      sectionsInherit="TUT_doors";
      sections[]={};
      class Animations
      {
         class move_door_1: rotation
         {
            type="rotation";
            source="user";
            selection="door_1";
            axis="pivit_point_door_1";
            memory=1;
            angle0=0;
            angle1=-1.8;
         };

         class move_door_2: rotation
         {
            type="rotation";
            source="user";
            selection="door_2";
            axis="pivit_point_door_2";
            memory=1;
            angle0=0;
            angle1=1.8;
         };
      };
   };
};


Thanks Rad...

Offline DeanosBeano

  • Addons Depot Staff
  • *****
  • SirDeanosbeano bstowed on me by sui ;)
    • Fraghaus
Re: Animations help
« Reply #3 on: 10 Jul 2010, 15:48:16 »
Sorry mate,
 very busy too with RL and PR.
 what i meant was  use your first door animation as the source



Code: [Select]

class CfgSkeletons
{
   class Default
   {
      isDiscrete=0;
      skeletonInherit="";
      skeletonBones[]={};
   };

   class TUT_doors_skeleton: Default
   {
      isDiscrete=0;
      skeletonInherit="";
      skeletonBones[]=
      {

         "door_1","",
         "door_2","door_1",
         "door_2",""
      };
   };

};
class CfgModels
{
   class rotation;
   class Default
   {
      sectionsInherit="";
      sections[]={};
      skeleton="";
      class Animations
      {
      };
   };
   class TUT_doors
   {
      sectionsInherit="";
      sections[]={};
      skeletonName="TUT_doors_skeleton";
   };

   class my_doors: TUT_doors
   {
      sectionsInherit="TUT_doors";
      sections[]={};
      class Animations
      {
         class door_1: rotation
         {
            type="rotation";
            source="door_1";
            selection="door_1";
            axis="door_1";
            memory=1;
            angle0=0;
            angle1=-1.8;
         };

         class door_2: door_1

         {
            selection="door_2";
            source="door_1";
            axis="door_2";
            memory=1;
            angle0=0;
            angle1=3.0;
         };
      };
   };
};
that should now give you the option to see both move in Bulldozer  I have extended the ablge on the secoind door too so it closes fully ,Try the example below and let me know.

« Last Edit: 10 Jul 2010, 16:16:33 by DeanosBeano »
I love ofp

Offline Radiator

  • Members
  • *
Re: Animations help
« Reply #4 on: 11 Jul 2010, 13:22:45 »
Thanks, It works fine.  I was looking right at it "SOURCE" and it didn't even click to me. Late nights.

What I can't work out is the  SkeletonBones. I understand

"door_1","", this is the make up or the moving part of door 1

"door_2","door_1", this is the make up or the moving part of door 2 and it's linked to door 1

But I don't understand  why you had "door_2","" ???



One more thing, how many different movements (type="rotation") are there.

Because have a ramp at the end of a trailer that lowers down for vehicles to drive up on to the trailer. To make it look realistic, I have added a hydraulic ram to it . So it looks like it pushes the ramp down.

: - I have two cylinders: one on the trailer (outer ram) and the second smaller cylinder (inner ram) is attached to the ramp and it also sits in the middle of the outer_ram. They are both moved by rotation.

With the ramp up everything is in-line and when the ramp is in the down position the inner_ram has slid out of the outer ram and everything is in-line.

The problem is when the ramp is half way, the two rams (cylinders) are bent, not in-line.

Can I pivot one end of the outer_ram to the trailer and make the other end to keep in-line with a point on the ramp. And the same with the inner_ram pivot on the ramp.

Rad.. 

Offline DeanosBeano

  • Addons Depot Staff
  • *****
  • SirDeanosbeano bstowed on me by sui ;)
    • Fraghaus
Re: Animations help
« Reply #5 on: 11 Jul 2010, 19:00:31 »


hey mate,

 Door_2 was  because i have about 12 in mine like a big folding door and i left there . try it without and see if it still works.

 If you want to turn that into a ramp you simply need to flip using o2 and tick all LODS.

  The best way to do rams is , where the top vertices of the RAM meet the rest of the model , dont select them as part of the Ram itself , so the ram stretches almost and make your texture slightly squahsed , this way when the ram expands  the texture looks good. Obviously this is good if you can make your ram vertical, if not then you may need to use translation type to keep alignment , two or more anims can be applied to any selections (max total is about 40 i think) .

 There are x y z in all anims in terms of Rotation and Translation , you can also offest from the axis using the model.cfg if you sont want to keep adding verts to your model.

 
I love ofp