User Tools

Site Tools


arma:howto_animate_model

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
arma:howto_animate_model [2009-04-16 12:44]
snakeman added machine gun belt rotation quick tutorial.
arma:howto_animate_model [2017-10-06 22:08]
snakeman http to https switch.
Line 15: Line 15:
 Besides adding selections (same as in OFP but in ArmA bone selections should never overlap) you also need to add a following named property to your first resolution LOD (press **ALT-P** to open named properties window): Besides adding selections (same as in OFP but in ArmA bone selections should never overlap) you also need to add a following named property to your first resolution LOD (press **ALT-P** to open named properties window):
  
-<​code>​+<​code ​cpp>
    ​property name: autocenter    ​property name: autocenter
    ​value:​ 0    ​value:​ 0
Line 47: Line 47:
 A bone is defined by using two strings: A bone is defined by using two strings:
  
-<​code>​+<​code ​cpp>
 :"​bone",""​ :"​bone",""​
 </​code>​ </​code>​
Line 57: Line 57:
 **Example** **Example**
  
-<​code>​+<​code ​cpp>
 skeletonBones[]= skeletonBones[]=
 { {
Line 69: Line 69:
 The second argument (empty in the example above) is used for linking two bones: The second argument (empty in the example above) is used for linking two bones:
  
-<​code>​+<​code ​cpp>
 :"​bone1","​bone2"​ :"​bone1","​bone2"​
 </​code>​ </​code>​
Line 77: Line 77:
 **Example** **Example**
  
-<​code>​+<​code ​cpp>
 skeletonBones[]= skeletonBones[]=
 { {
Line 89: Line 89:
 You can not link more than two bones in a row! If you do something like You can not link more than two bones in a row! If you do something like
  
-<​code>​+<​code ​cpp>
 "​bone1","​bone2","​bone3"​ "​bone1","​bone2","​bone3"​
 </​code>​ </​code>​
Line 99: Line 99:
 However, it should be possible to use a syntax like this (not tested yet): However, it should be possible to use a syntax like this (not tested yet):
  
-<​code>​+<​code ​cpp>
 skeletonBones[]= skeletonBones[]=
 { {
Line 112: Line 112:
 **cfgSkeletons Example** **cfgSkeletons Example**
  
-<​code>​+<​code ​cpp>
 class cfgSkeletons class cfgSkeletons
 { {
Line 155: Line 155:
 **Example** **Example**
  
-<​code>​+<​code ​cpp>
 sections[]= sections[]=
 { {
Line 195: Line 195:
 **Example** **Example**
  
-<​code>​+<​code ​cpp>
 class mainRotor class mainRotor
 { {
Line 219: Line 219:
 As a short example, the wheels would need "​rotationX"​ as animation type. As a short example, the wheels would need "​rotationX"​ as animation type.
  
-{{http://tactical.nekromantix.com/images/wiki/​howtoanimmodel_axes.jpg}}+{{https://pmc.editing.wiki/​images/​howtoanimmodel_axes.jpg}}
  
 **cfgModels example** **cfgModels example**
  
-<​code>​+<​code ​cpp>
 class cfgModels class cfgModels
 { {
Line 396: Line 396:
  
 Now something worth noticing, let's say that you want the belt to move not straight but unbalanced, for that you will play with the angle0 = ""​. I think most of us won't be using this angle but now you know what it does. Now something worth noticing, let's say that you want the belt to move not straight but unbalanced, for that you will play with the angle0 = ""​. I think most of us won't be using this angle but now you know what it does.
 +
 +
 +====== Animate Cargo Door ======
 +
 +In your model.cfg file in cfgModels put this for example:
 +<code cpp>
 +class Animations
 +{
 + class cargodoor
 + {
 + type = "​rotation";​
 + source = "​MoveX1";​
 + animPeriod = 2.5;
 + sourceAddress = "​clamp";​
 + selection = "​cargodoor";​
 + axis = "​osa_cargodoor";​
 + memory = true;
 + minValue = 0;
 + maxValue = 1;
 + angle0 = 0;
 + angle1 = -0.488690;
 + };
 +</​code>​
 +
 +In config.cpp file in cfgVehicles put this:
 +<code cpp>
 + class AnimationSources:​ AnimationSources
 + {
 + class MoveX1 // Should be the same as your selection name.
 + {
 + source = "​user";​ //The controller is defined as a user animation.
 + animPeriod = 10;  //The animation period used for this controller.
 + initPhase = 0;     //​Initial phase when object is created. 0 = CLOSED
 + };
 + };
 +</​code>​
 +And
 +<code cpp>
 + class UserActions
 + {
 + class CargoDoor_OpenP
 + {
 + displayName = "Open cargodoor";​
 + position = "​pilotcontrol";​
 + onlyforplayer = false;
 + radius = 0.5;
 + condition = "this animationPhase ""​cargodoor_down""​ < 0.5";
 + statement = "this animate [""​cargodoor_down"",​1];​ this animate [""​cargodoor_up"",​1]";​
 + };
 +</​code>​
arma/howto_animate_model.txt ยท Last modified: 2017-10-06 22:08 by snakeman