Jump to content
Brother Makabeus The Bullet

AnimationPhase and sequence of the animation

Recommended Posts

7hqQVmk.jpg


Howdy! Guys i've stucked with animations sequence(

 

The main thing is that it doesn't work correctly. 

Model.cfg:

Quote

////model.cfg

class cfgSkeletons
{
    class Default
    {
    isDiscrete = 1;
    skeletonInherit = "";
    skeletonBones[] = {};
    };

    class ml_shabut_bunker_door : default
        {
        SkeletonBones[]=
            {
            "bunker_door","",
            "rod1", "bunker_door",
            "rod2", "bunker_door"
            };
        };
    };

class CfgModels
{
    class Default
    {
        sections[] = {};
        sectionsInherit="";
        skeletonName = "";
    };
    
    class bunker_door:Default
    {
        skeletonName="ml_shabut_bunker_door";
        sections[]=
        {
        };

        class Animations
        {            
            class bunker_door
            {
                type= rotation;
                source= user;
                memory = 1;
                selection= bunker_door;
                axis = bunker_door_axis;
                animPeriod = 1;
                minPhase=0;
                maxPhase=1;
                minValue=0;
                maxValue=1;
                angle0=0;
                angle1=-(rad 110);
               };
            class rod1
            {
                type= rotationz;
                source= user;
                memory = 1;
                selection        = rod1;
                axis            = rod1_axis;
                animPeriod = 1;
                minPhase=0;
                maxPhase=1;
                minValue= 0;
                maxValue=1;
                angle0=0;
                angle1=-(rad 120);
               };
               class rod2
            {
                type= rotationz;
                source= user;
                memory = 1;
                selection        = rod2;
                axis            = rod2_axis;
                animPeriod = 1;
                minPhase=0;
                maxPhase=1;
                minValue=0;
                maxValue=1;
                angle0=0;
                angle1=(rad 120);
               };

        };
    };
};

 

config.cpp:

Quote

class CfgPatches
{
    class bunker_door
    {
        units[] = {};
        weapons[] = {};
        requiredVersion = 0.1;
        requiredAddons[] = {"A3_Structures_F"};
    };
};


 
class CfgVehicles
{
    class House;
    class House_F: House
    {
        class DestructionEffects;
    };
    class Ruins_F;

    class Land_bunker_door: House_F
    {
        displayName = "bunker_door";
        model = \apalon\metro_a3\bunker_door\bunker_door.p3d; 
        author = "Serega Kradun";
        

        scope = 2; 
        mapSize = 20.27; 
        
        armor = 100000;
        animated = "true";

    class AnimationSources
        {
            class bunker_door {
                source = "user";
                animPeriod = 1;
                initPhase = 0;
                sound = "";
            };
            class rod1 {
                source = "user";
                animPeriod = 1;
                initPhase = 0;
                sound = "";
            };
                class rod2 {
                source = "user";
                animPeriod = 1;
                initPhase = 0;
                sound = "";
            };
        };
    };
};

 

Important thing to mention is that i decided not using the "statements and conditions" because i'm planning to use this not only with doors.

So what i did:

 

I've created a mission, placed this door , and called it "dwer". 

in the ini field i wrote [this] execvm "bronedwer.sqf"

 

bronedwer.sqf:


[dwer, ["turn Rod1", {dwer animate  ["rod1", 1];} ]] remoteExec ["addAction", 0, true];
[dwer, ["turn Rod2", {dwer animate  ["rod2", 1];} ]] remoteExec ["addAction", 0, true];



if (((dwer animationPhase "rod1")<0.5) and ((dwer animationPhase "rod2")<0.5)) then
	{
 dwer setVariable ["rdy_2open", true, true];
 waitUntil { dwer getVariable ["rdy_2open", true] };
}else{
hint "it is closed";
};


if ((isNil {dwer getVariable ["rdy_2open", true]}))  then
	{
 [dwer, ["open!", {dwer animate  ["bunker_door", 1];} ]] remoteExec ["addAction", 0, true];
};

 

As the result it didn't set needed variable. If i'm typing "dwer setVariable ["rdy_2open", true, true];"  into debug console - action appears. =(

I'm not an experienced one with Arma, especially in coding =( 

Thanks for any kind of info!

Share this post


Link to post
Share on other sites

you would want to set all moving parts to use same animation source that is timed differently for different parts

lets say the rods move from 0.0-0.5 and the rest of the door from 0.51-1.0 then when you use animateSource command on the door to play animation from 0 to 1 it will play the whole sequence on 1 command

 

you can set the animations length in the config.cpp animationSources class for you AS for the door with the animperiod = X; parameter.

 

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×