banner



How To Play An Animation In Arma 3

Contents

  • 1 model.cfg
  • ii cfgSkeletons
    • 2.1 Defining a os
      • two.1.1 A single bone
        • ii.i.1.i Example
      • 2.ane.2 Linked bones
        • 2.1.2.one Instance
    • 2.ii cfgSkeletons Example
  • 3 cfgModels
    • iii.1 Sections
      • 3.one.1 Example
    • three.2 Animations
      • 3.ii.1 Attention
      • iii.ii.2 Example
      • 3.2.3 Axes
    • 3.3 Rules Of Date
      • 3.3.one cfgSkeletons
      • 3.3.ii cfgModels
    • 3.4 User Animation
    • 3.5 cfgModels example

Attending: This article is a tutorial on how to animate parts of your model (eastward.g. wheels, rotors, etc.). Take all information of this article with a pinch of salt: everything is based on experiments and has not been confirmed nor documented by BIS, withal.

To animate a model, you take to brand use of both, the cfgModels and cfgSkeletons class.

The cfgSkeletons class defines the bones of a vehicle. Basic are, more or less, the animated selections of a model.

The cfgModels class is an extended version of the OFP cfgModels class. It defines the selections of a model which you want to animate or use with the setObjectTexture command, but since ArmA, y'all have to put everything related to animate your model in here.

Model preparation: Besides adding selections (same as in OFP but in ArmA bone selections should never overlap) you lot also demand to add a post-obit named belongings to your starting time resolution LOD (printing Alt+P to open named properties window):

          belongings proper noun: autocenter          value: 0        

If your model has Geometry LOD the above needs to be also done for your Geometry LOD. This property stopps engine from shifting the animation axes.

If you come across a bug when your weapon bones autumn apart after you dropp it to the ground the reason might exist lack of Geometry or View - airplane pilot LODs.

model.cfg

According to the article about Model Config, the cfgSkeletons and cfgModels course should be part of a model.cfg file which is located in the addon pbo file.
However, if you lot use the model.cfg file, you always need to binarize your addon - otherwise, your animations won't work.
Some other option is to add both classes (cfgSkeletons and cfgModels) to the config.cpp file of your addon.
This way, you do not need to binarize your addon, then it is a perfect manner to exam it. However, the commencement method is prefered and should e'er be used when releasing your addon.

cfgSkeletons

The cfgSkeletons class defines, every bit mentioned before, the bones (= animated selections) of a vehicle.

Each skeleton is a bracket within the cfgSkeletons class, consisting of iii parameters:

Parameter Clarification
isDiscrete currently unknown, set up to i.
skeletonInherit inherit bones from given grade.
skeletonBones[] define your ain bones hither.

Defining a bone

Bones are defined in the skeletonBones[]-array which is made of a list of unsorted bones. Each os is the proper name of a choice yous want to animate.

A single bone

A bone is defined past using 2 strings:

"bone",""

You may define multiple bones past strining them togeter.

Attention: Practise non exit out the 2nd string as this will lead to errors! (see linked basic for more information on the second string argument)

Instance
                        skeletonBones            []            =            {            "bone1"            ,            ""            ,            //defines bone1            "bone2"            ,            ""            //defines bone2            };          

Linked basic

The second argument (empty in the instance above) is used for linking two bones:

"bone1","bone2"

Linking is used to make the blitheness of "bone1" depending on the motion of "bone2". If you eastward.chiliad. accept a turret, you lot have to make employ of linking here, because the upward and downwardly move of the turrets weapon is typically influenced by left and right motion of the turret:

Example
                        skeletonBones            []            =            {            "turret_x"            ,            ""            ,            // defines bone turret_x            "turret_y"            ,            "turret_x"            // defines os turret_y and makes it linked to bone turret_x            };          

Attention:
Yous can not link more than two basic in a row!
If you exercise something similar

this will result in an fault, equally Armed Assault interprets this as

  • defining "bone1" which is linked to "bone2"
  • defining "bone3", which misses the second statement.

Even so, information technology should be possible to utilize a syntax similar this (not tested nonetheless):

                        skeletonBones            []            =            {            "bone1"            ,            "bone2"            ,            // defines bone "bone1" and makes it linked to "bone2"            "bone2"            ,            "bone3"            ,            // defines bone "bone2" and makes it linked to "bone3"            "bone3"            ,            ""            // defines bone "bone3".            };          

In conclusion, "bone1" is linked to "bone2", which is linked to "bone3".
So "bone1" should be depending on the movement of both, "bone2" and "bone3".

cfgSkeletons Example

                        class            cfgSkeletons            {            form            BWMod_Tiger_Skeleton            {            isDiscrete            =            1            ;            skeletonInherit            =            ""            ;            skeletonBones            []            =            {            "wheelL"            ,            ""            ,            "wheelR"            ,            ""            ,            "turret_RMK_x"            ,            ""            ,            "turret_RMK_y"            ,            "turret_RMK_x"            ,            "turret_OSIRIS_y"            ,            ""            ,            "turret_OSIRIS_x"            ,            "turret_OSIRIS_y"            };            };            };          

cfgModels

The cfgModels grade is used to declare the selections of a model you want to animate or access via the setObjectTexture control. Since ArmA, the cfgModels class has been extended an is now used to define all animations of a model.

Each of your model is a bracket within of the cfgModels course and the models filename is used every bit the name of your class (without .p3d). E.g. your model p3d is named "myVehicle.p3d" your class is "class myvehicle {}". We volition call them "modelclasses" in this commodity for the sake of simplicity.

Each modelclass consists of three parameters and an boosted subclass which defines the animations of your models:

Parameter Description
sectionsInherits inherit sections (= selections) from given glass.
sections[] ascertain your sections here.
skeletonName class name of skeleton used by this model.
grade Animations {} bracket which defines the animations of your model.

Sections

A department is the same as a option: a part of the model which may be blithe or inverse via the setObjectTexture command. To define selections in your modelclass make use of the section[]-array. This array is an unordered list of all selections you desire to use in the means described higher up.

Example

                        sections            []            =            {            "mainRotor"            ,            "mainRotor_static"            ,            "mainRotor_blur"            ,            "mainRotor_dive"            ,            "tailRotor"            ,            "tailRotor_static"            ,            "tailRotor_blur"            ,            "tailRotor_dive"            ,            "turret_RMK_x"            ,            "turret_RMK_y"            };          

Animations

To define animations for your model, yous have to make utilize of the course animations in your modelclass. Each animation is a subclass in the class animations with a userdefinable proper noun and consists of the following parameters:

Parameter Description
type the type of the animation, due east.yard. rotating or translation. Refer to Model Config for a listing of all blitheness types.
source The source used to breathing the option. Refer to Model Config for a list of all sources.
selection The proper noun of the bone (= option) you desire to animate. Has to be defined in the cfgSkeletons grade.
axis The proper noun of the axis you desire to use (merely necessary for types rotation and translation).
memory If using an own centrality (by the axis-parameter) use value ane if centrality is located in the memory lod of your model or 0 if the axis is located in the lod (or better: every lod) where your animated selection is used.
sourceAdress Use "loop" if you want your blitheness to "loop" (e.yard. on wheels) or "clamp" if you want your blitheness to stop at a specific angle (eastward.k. on the steering wheel of a machine).
minValue If source returns a value <= minValue, the blitheness is animated with angle0 (encounter below)
maxValue If source returns a value >= maxValue, the animation is animated with angle1 (see below)
angle0 The angle the selection is blithe when minValue is reached.
angle1 The angle the pick is blithe when maxValue is reached.
offset0 The distance the os is moved when using blazon="Translation" and minValue is returned. Altitude is calculated by the distance of centrality' vertices. If the take a distance of 1m and you are using offset0 = 1, the bone will be moved by 1m. If using offset0=0.5, the os will be moved by 0.5m, etc.
offset1 Same every bit offset0, merely when maxValue is returned.

Attending

I am assuming that each source is returning a value between 0 and one (the animationPhase) which is used to breathing your selection. Some may even return a value from -ane to i:

  • If using source="speed", the source is returning 0 when the vehicle is not moving and i when the vehicle is moving at maximum speed.
  • If using source="drivingWheel", the source is returning -i when the vehicle is turning left, 0 when the vehicle is not turning and 1 when the vehicle is turning correct.

On turrets, information technology is necessary that the classnames of the animations match the according turret selection names.
So if you're mainTurret selection is named "turret_RMK_x" yous have to name your grade "turret_RMK_y", besides. The same goes for the mainGun choice.

Example

                        class            mainRotor            {            type            =            "rotationY"            ;            //rotation around the Y axis            source            =            "rotorH"            ;            choice            =            "mainRotor"            ;            axis            =            ""            ;            //no ain axis, use centre of selection            memory            =            1            ;            sourceAddress            =            "loop"            ;            minValue            =            0            ;            maxValue            =            1            ;            angle0            =            0            ;            angle1            =            "rad -360"            ;            };          

Axes

Since the axes seem a bit messed up when using rotationX, rotationY, rotationZ, translationX, translationY, translationZ, here is a small image of how the axes are arranged.

Keep in heed that this prototype shows only the management of these axes and not their position. The position is always defined by the centre of your animated selection.

Every bit a short examle, the wheels would need "rotationX" every bit animation blazon.

Howtoanimmodel axes.jpg

Rules Of Engagement

cfgSkeletons

  • Binarise gets confused if your cfgSkeletons classname is same as your cfgModels.
    • Declare your skeleton course equally MyModelSkeleton vs MyModel
  • Similar to any other classes in any standard config.cpp of any pbo, information technology is possible, albeit less likely, to have same grade(es) over declared in multiple folders. This is typical if you are running more than one project on the p: drive. Far improve, yous ever use an OFPEC_TAG proper name
                        course            OFPEC_TAG_MyModelSkeleton          
  • Declaring not-existent bones in a skeleton is 'ok'

Typically, you will have a base of operations course skeleton (such equally a 'vehicle') from which, yous derive a tank.

Typically, all vehicles take number plates (vez, spz). Some, don't.

It is 'ok' to format for the general example. The only effect is that this non-existent os will appear in the binary p3d as part of the skeleton listing. No harm done.

cfgModels

  • sections[]= take zippo to do with this document. They are a list of NamedSelections, from which, setObjectTexture tin be used in-game. They are office of hiddenselections[]= and are, confusingly, non related to skeletons and animations. If a not-real NamedSelection is, in fact, listed in this segment, it is ignored, and non present in the binary model.
  • source= is the ANIMATION Grade name. Often called 'controller'
  • option= is the BONE Proper noun in cfgSkeletons
  • axis= is an axis. it is rarely alleged as a bone, it rarely appears in sections[]=. Information technology often appears in the NamedSelections list of the model.
  • When creating form blitheness{... information technology is ok to declare non real bones.

This is very prevalent, very common, and very 'ok' when you have a generalised base class that deals with four standard doors, simply one of which appears in a *specific* model.

                        form            WideDoor            {...            class            FrontDoor            {...            course            BackDoor            {...            class            EmergencyExit            {....          

Highly complex models such as aircraft frequently have multiple compass, rpm, altimeter and other classes in their base classes which may, or may not be present in THE model.

If the bone is non in cfgSkeletons, the cfgModel class is entirely ignored during the binarisation process.

If the bone IS declared in the skeleton but doesn't actually be in the model. The cfgModel class IS binarised (probably non what you want to happen).

User Animation

                        class            Rotation            ;            //very standard, most frequently divers in the offset model.cfg of the p:tree            cfgModels            {            class            InheritedFromSomething            //near often divers in the offset model.cfg of the p:tree            {            class            Animations            ;            };            class            PinkElephant            :            InheritedFromSomething            // this is for the PinkElephant.p3d and no other            {            form            Animations            :            Animations            // bring in all the base of operations class classes            {            class            OFPEC_TAG_MyPinkElephant_SlidingDoor            :            Rotation            {            source            =            SomeClassName            ;            // defined in config.cpp            animPeriod            =            1            ;            option            =            SomeBoneName            ;            axis            =            SomeAxis            ;            angle1            =            rad            85            ;            };            };            };            };          

config.cpp

                        grade            CfgVehicles            {            course            SomeBaseClass            {            class            AnimationSources            {            class            UserActions            ;            // mayhap            };            };            class            OFPEC_TAG_MyPinkElephant            :            SomeBaseClass            {            // ...            model            =            PinkElephant            ;            course            AnimationSources            :            AnimationSources            {            class            OFPEC_TAG_MyPinkElephant_SlidingDoor            /// <<<<<THE proper name used in THE cfgModels for THIS p3d            {            source            =            "user"            ;            animPeriod            =            1            ;            initPhase            =            0            ;            };            class            UserActions            :            UserActions            {            class            OFPEC_TAG_OpenDoor1            // ensure no possibilty of a clash with base names (if whatsoever)            {            displayName            =            "Open Sliding door"            ;            onlyforplayer            =            "true"            ;            position            =            "SomeAxis"            ;            // THE axis alleged in the model            radius            =            18100            ;            status            =            "this animationPhase ""OFPEC_TAG_MyPinkElephant_SlidingDoor"" < 0.5 "            ;            statement            =            "this animate [""OFPEC_TAG_MyPinkElephant_SlidingDoor"", i]; this say ""OFPEC_TAG_ElephantOpenSound"""            ;            };            class            OFPEC_TAG_CloseDoor1            :            OFPEC_TAG_OpenDoor1            {            displayName            =            "Shut Sliding door"            ;            condition            =            "this animationPhase ""OFPEC_TAG_MyPinkElephant_SlidingDoor"" >= 0.5 "            ;            argument            =            "this animate [""OFPEC_TAG_MyPinkElephant_SlidingDoor"", 0]; this say ""OFPEC_TAG_ElephantCloseSound"""            ;            };            };            };            };            };            course            CfgSounds            {            class            OFPEC_TAG_ElephantOpenSound            // <<< brand certain no other class could possibly chosen this            {            name            =            "whatever"            ;            sound            []            =            {            "\some\stupid\difficult\path\somesound.ogg"            ,            one            ,            1            };            titles            []            =            {};            };            class            OFPEC_TAG_ElephantCloseSound            :            OFPEC_TAG_ElephantOpenSound            {            proper name            =            "think of a number"            ;            sound            []            =            {            "\some\stupid\hard\path\someOthersound"            ,            ane            ,            one            };            // wss equivalent            };            };          

cfgModels instance

                        class            cfgModels            {            class            bwmod_tiger            {            sectionsInherit            =            ""            ;            sections            []            =            {            "mainRotor"            ,            "mainRotor_static"            ,            "mainRotor_blur"            ,            "mainRotor_dive"            ,            "tailRotor"            ,            "tailRotor_static"            ,            "tailRotor_blur"            ,            "tailRotor_dive"            ,            "turret_RMK_x"            ,            "turret_RMK_y"            };            skeletonName            =            "BWMod_Tiger_Skeleton"            ;            class            Animations            {            grade            mainRotor            {            type            =            "rotationY"            ;            source            =            "rotorH"            ;            selection            =            "mainRotor"            ;            axis            =            ""            ;            retentiveness            =            1            ;            sourceAddress            =            "loop"            ;            minValue            =            0            ;            maxValue            =            1            ;            angle0            =            0            ;            angle1            =            "rad -360"            ;            };            class            tailRotor            {            blazon            =            "rotationX"            ;            source            =            "rotorV"            ;            choice            =            "tailRotor"            ;            axis            =            ""            ;            memory            =            one            ;            sourceAddress            =            "loop"            ;            minValue            =            0            ;            maxValue            =            1            ;            angle0            =            0            ;            angle1            =            "rad -360"            ;            };            class            wheelL            {            type            =            "translation"            ;            source            =            "altRadar"            ;            // using altRadar, since damper doesn't seem to piece of work on                        // helicopters, even though [[Model_Config]] states something else.            selection            =            "wheelL"            ;            axis            =            "axis_damper"            ;            // vertical centrality, vertex altitude 1 m            retention            =            0            ;            animPeriod            =            0            ;            minValue            =            0            ;            maxValue            =            0.05            ;            // max value 0.05m in a higher place ground            offset0            =            0            ;            offset1            =-            0.05            ;            // animate wheels downwardly for 0.05m when maxValue is reached.            };            course            wheelR            {            type            =            "translation"            ;            source            =            "altRadar"            ;            option            =            "wheelR"            ;            centrality            =            "axis_damper"            ;            retentivity            =            0            ;            animPeriod            =            0            ;            minValue            =            0            ;            maxValue            =            0.05            ;            offset0            =            0            ;            offset1            =-            0.05            ;            };            class            turret_RMK_x            //the horizontal moving part of the turret            {            type            =            "rotationY"            ;            source            =            "mainTurret"            ;            selection            =            "turret_RMK_x"            ;            centrality            =            "axis_turret_RMK_x"            ;            animPeriod            =            0            ;            memory            =            1            ;            minValue            =            "rad -360"            ;            maxValue            =            "rad +360"            ;            angle0            =            "rad -360"            ;            angle1            =            "rad +360"            ;            };            class            turret_RMK_y            //the vertical moving part of the turret            {            type            =            "rotationX"            ;            source            =            "mainGun"            ;            pick            =            "turret_RMK_y"            ;            axis            =            "axis_turret_RMK_y"            ;            animPeriod            =            0            ;            memory            =            ane            ;            minValue            =            "rad -360"            ;            maxValue            =            "rad +360"            ;            angle0            =            "rad -360"            ;            angle1            =            "rad +360"            ;            };            };            };            };          

Source: https://community.bistudio.com/wiki/ArmA:_Armed_Assault:_How_to_animate_a_model

Posted by: mcnultyshosselame.blogspot.com

0 Response to "How To Play An Animation In Arma 3"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel