Results 1 to 7 of 7

  Click here to go to the first Developer post in this thread.  

Thread: Object animations

  1. #1
    I have a tracer that I want to animate, the config looks like this
    <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">class cfgSkeletons
    {
    class Default;
    class brh_tracerTrail_skeleton &#58; Default
    {
    isDiscrete=1;

    skeletonInherit=&#34;&#34;;
    skeletonBones&#91;&#93;={&#34;trail&#34;,&#34;&#34 ;};
    };
    };

    class cfgModels
    {
    class Default
    {
    sections&#91;&#93; = {};
    sectionsInherit = &#34;&#34;;
    };
    class brh_redTracerTrail &#58; Default
    {
    sectionsInherit=&#34;&#34;;
    sections&#91;&#93;={&#34;trail&#34;};

    skeletonName=&#34;brh_tracerTrail_skeleton&#34;;

    class Animations
    {
    class trail
    {
    type=&#34;translation&#34;;
    source=&#34;user&#34;;
    selection=&#34;trail&#34;;
    axis=&#34;trail_axis&#34;;
    begin=&#34;trail_begin&#34;;
    end=&#34;trail_end&#34;;
    animPeriod=0.0125;
    memory=1;
    minValue=0;
    maxValue=1;
    offset0=0;
    offset1=1;
    };
    };
    };
    };

    class CfgVehicles
    {
    class brh_redTracer &#58; Thing
    {
    model = &#34;&#92;brh_tracers&#92;brh_redTracer.p3d&#34 ;;
    icon = &#34;&#92;ca&#92;data&#92;data&#92;Unknown_object. paa&#34;;
    displayName = &#34;&#34;;
    scope = 1;
    simulation = &#34;thing&#34;;
    nameSound = &#34;&#34;;
    transportFuel = 0;
    mapSize = 0.2;
    accuracy = 0;
    cost = 0;
    armor = 50000;

    class DestructionEffects {};
    class AnimationSources
    {
    class trail
    {
    type=&#34;translation&#34;;
    source=&#34;user&#34;;
    selection=&#34;trail&#34;;
    axis=&#34;trail_axis&#34;;
    begin=&#34;trail_begin&#34;;
    end=&#34;trail_end&#34;;
    animPeriod=0.0125;
    memory=1;
    minValue=0;
    maxValue=1;
    offset0=0;
    offset1=1;
    };
    };
    };
    };[/QUOTE]

    I keep trying all evening now and simply cant make it working.
    The model seems to be fine, Im using
    <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">tracer animate &#91;&#34;trail&#34;,1&#93;[/QUOTE]
    but nothing happens. Is the config alright?



    = Bobor SK

  2. #2
    The class name for your tracer object in the cfgModels section has to correspond to the model name. So, either call your class "brh_redTracer" or rename your model file.
    Source: http://community.bistudio.com/wiki/M...nfig#cfgModels

    The settings in the AnimationSources class (cfgVehicles section) are different from the ones of the Animations class (cfgModels section).
    http://community.bistudio.com/wiki/M...mation_sources
    Examples are at the bottom of that page.

    Should be like this for your tracer:
    <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">class AnimationSources
    {
    *** class trail
    *** {
    *** *** ***source = &#34;user&#34;; //The controller is defined as a user animation.
    *** *** ***animPeriod = 0.0125; ***//The animation period used for this controller.
    *** *** ***initPhase=0; *** *** //Initial phase when object is created.
    *** };
    };[/QUOTE]
    ECS Team - Poweruser

  3.   This is the last Developer post in this thread.   #3
    BI Developer
    Join Date
    Jun 11 2007
    Location
    Brno, Czech Republic
    Posts
    648
    As described above, make sure you have defined the custom animation source in the config.cpp file section cfgVehicles for the object you are animating.

    You also need to call the animation itself.

    Here&#39;s a very rough example of the code in use:
    <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">
    *** class bunker &#58; MainBunker {
    *** *** ***access = ReadOnly;
    *** *** ***displayName = &#34;bunker&#34;;
    *** *** ***animated = true;
    *** *** ***model = &#34;&#92;usec&#92;bunker.p3d&#34;;
    *** *** ***vehicleClass = &#34;NUNIVAK_OBJECTS&#34;;

    *** *** ***class AnimationSources {
    *** *** *** *** class BunkerDoor {
    *** *** *** *** *** ***source = &#34;user&#34;;
    *** *** *** *** *** ***animPeriod = 5;
    *** *** *** *** *** ***initPhase = 0;
    *** *** *** *** }; ***
    *** *** ***};
    *** *** ***
    *** *** ***class UserActions
    *** *** ***{
    *** *** *** *** class OpenDoors
    *** *** *** *** {
    *** *** *** *** *** ***displayName=&#34;Open Doors&#34;;
    *** *** *** *** *** ***position=&#34;pos driver&#34;;
    *** *** *** *** *** ***radius=5;
    *** *** *** *** *** ***condition=&#34;this animationPhase &#34;&#34;door_L&#34;&#34; &#60; 0.10;&#34;;
    *** *** *** *** *** ***statement=&#34;this animate &#91;&#34;&#34;door_L&#34;&#34;,1&#93;;this animate &#91;&#34;&#34;door_R&#34;&#34;,1&#93;;&#34;;
    *** *** *** *** *** ***onlyforplayer = true;
    *** *** *** *** };
    *** *** *** *** class CloseDoors
    *** *** *** *** {
    *** *** *** *** *** ***displayName=&#34;Close Doors&#34;;
    *** *** *** *** *** ***position=&#34;pos driver&#34;;
    *** *** *** *** *** ***radius=5;
    *** *** *** *** *** ***condition=&#34;this animationPhase &#34;&#34;door_L&#34;&#34; &#62; 0.90;&#34;;
    *** *** *** *** *** ***statement=&#34;this animate &#91;&#34;&#34;door_L&#34;&#34;,0&#93;;this animate &#91;&#34;&#34;door_R&#34;&#34;,0&#93;;&#34;;
    *** *** *** *** *** ***onlyforplayer = true;
    *** *** *** *** };
    *** *** ***};
    *** };
    [/QUOTE]
    "He will come to death. An image of the splendor of the kings of men in glory, undimmed before the breaking of the world."

  4. #4
    Staff Sergeant
    Join Date
    Jan 4 2004
    Location
    Slovakia
    Posts
    210
    Author of the Thread
    The model name is identical with both, the model class name and the vehicle class name. Also the difference of those two definitions in CfgModels >> Animations and CfgVehicles >> AnimationSources is just a small mistake, I noticed it later, fixed it and tried it out, didnt work anyway. I thought there might be problem with the offset1 value or maxValue ... isnt there?
    I also noticed that the object config you shown me has an animated parameter which I dont have in my definition. There might be a problem. Ill try it out and let you know.

  5. #5
    Example which shows what I mean with:
    The class name for your tracer object in the cfgModels section has to correspond to the model name.

    Quote Originally Posted by [b
    Quote[/b] ]
    class cfgModels
    {
    *** ******class Default
    *** ******{
    *** *** *** *** *** // config code
    *** ******};
    *** ******class <span style='color:red'>myModelName</span> : Default
    *** ******{
    *** *** *** *** *** // config code
    *** ******};
    };

    class CfgVehicles
    {
    *** ******class someClassName : Thing
    *** ******{
    *** *** *** *** *** model = "&#92;folder&#92;<span style='color:red'>myModelName</span>.p3d";
    *** *** *** *** *** // config code
    *** ******};
    };
    The two names marked in <span style='color:red'>red</span> have to be the same. Otherwise ArmA doesn&#39;t know to which model the defined animations belong to. In your config they are different.
    Your cfgModels class is called: *** brh_redTracerTrail
    And your model filename is: *** ****** brh_redTracer

  6. #6
    Staff Sergeant
    Join Date
    Jan 4 2004
    Location
    Slovakia
    Posts
    210
    Author of the Thread
    Ops, another mistake. The model name is identical with the class name in my config but not in here because when I was copying it, I tried to make it shorter. The brh_redTracerTrail evolves from brh_redTracer and I accidentally forgot to change the model definition. So this is not the problem, otherwise it would show an error message but this doesnt show anything. It simply doesnt work and the damn ArmA cant tell me why. The animated=1 didnt help.

  7. #7
    Staff Sergeant
    Join Date
    Jan 4 2004
    Location
    Slovakia
    Posts
    210
    Author of the Thread
    Now this is fkin&#39; weird&#33; I take Solus&#39; SLX UH60MG, rename the "Door_3" to "trail", "axis_door_3" to "trail_axis", rename the model to brh_redTracerTrail and it works. Then I delete all LODs except the 1st one and Memory, works fine. I delete all unnecessary Memory points (leaving trail_axis only), works fine. Then I delete all unnecessary in the 1st LOD (and add a box to have something to compare it to), it stops working. I go one step back... now I delete all proxys, it stops working. I go back again, delete other part of the model (not a proxy one), works fine. Then I delete everything except the trail selection and one proxy. Works fine.
    What the hell??

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •