Jump to content
Sign in to follow this  
jasono

New to Animations. Help?

Recommended Posts

Hey everyone,

I thought I'd see if I can get animations to work. Guess what, I can't!

I decided to follow one of the animation tutorials I remember I got to work ages ago in OFP by Brsseb (learnt a lot from that guy). He made a satilite dish spin continously on its own a full 360 degrees.

Now, that config is very out of date from what I have seen around the internet but neither of them are (to me) very clear about what needs to be defined where and what etc.

What I have is a basic (very very basic) model consisting of two boxes. A wide base which is labeled as base in 0 Res LOD and Geo LOD and a tall thin one sitting on top which is also in 0 Res LOD and Geo LOD in a selection named spinner. I have in Memory LOD two vertices which are dead center going through the box vertically, within a selection named spin_axis.

The problem is the config. I know that model.cfg needs to be used (where in OFP it did not) and of course a lot has changed. Can anyone point me in the right direction, a basic direction to just get my small thin box to spin continously 360 degrees on its own on top of the base?

Really appreciated, once I get started off I'm usually able to experiment better.

Thank you!

Regards,

Jason

Share this post


Link to post
Share on other sites

Hi mate;

Maybe something like this

class CfgSkeletons

{

class Ship;

class MyAddonBones: Ship

{

isDiscrete=1;

skeletonInherit = "";

skeletonBones[]=

{

"RadarDish",""

};

};

};

class CfgModels

{

class Ship;

class NAMEOFYOURP3DFILE : Ship

{

skeletonName = "MyAddonBones";

sectionsInherit="";

sections[] = {"RadarDish"};

class Animations

{

class radarX

{

type="rotation";

source = "time";

sourceAddress = "loop";

selection="RadarDish";

axis="axisradardish";

minValue = 0;

maxValue = 1;

angle0=0;

angle1="rad +360";

};

};

};

};

In O2 name the moving "dish" as "RadarDish" in any Resolution and Geo LODs

In O2 place 2 single points in the Memory LOD to define the axis of rotation. Name both these points "axisradardish"

Should work.

In fact;

- Save the model.cfg file (in the same directory where you have the P3D file)

- Re-open the P3D file

Bingo, you should see it rotate in the O2 Buldozer pre-view! Neat eh.

Share this post


Link to post
Share on other sites

Hey Gnat,

Thank you for your reply. Much appreciated. However, the radar dish does not spin; at least not in Bulldozer.

This is what I done:

Go into 0.00 LOD and select the box that should spin, making it in a selection called RadarDish; also making sure its redefined. I then done the same to the same part of the model in Geo LOD.

I then went into Memory LOD and made two points verticle from each other, both defined within a selection named axisradardish.

Finally I copied the model.cfg you posted above overwriting my old one and replaced the P3D filename to what it is.

Opened bulldozer and... nothing.

Do I need to define anything in the config.cpp as well?

Edit: - PBO'd it and put in game and it worked, just doesn't work in Bulldozer. No worries though. Thanks for your help Gnat, again much appreciated! :)

Would it be possible for me to stop it using 'animate' at all? I did lie in saying I wanted it to run continously, but forgot to say when it is 'switched on' so to speak.

Edited by JasonO

Share this post


Link to post
Share on other sites

Is there any documentation of Animations in ArmA/ARMA2? I can only find one in the BIKI for OFP. At least the methods used are very out-dated and too simple to work with ARMA2.

I need to be able to turn the spin on and off using the 'animate' command. At the moment it is not possible and I am not sure what to change.

Again, I am clueless and without any documentation it is hard not to advance further without nagging you guys for help.

Thank you.

Share this post


Link to post
Share on other sites

Stop that animation? Unfortunately no. (How can you stop "time" in this case ;) )

The only other way from memory is to use a script(s) to "manually" rotate a User source defined animation. Clunky.

Would be nice if we could mix animations, but thats a Wish-list item :(

List of all (well, I think most) animations sources here;

http://community.bistudio.com/wiki/Model_Config

More info here

http://community.bistudio.com/wiki/ArmA:_How_to_animate_a_model

EDIT

One way, but its just a animation "trick"

- Make 2 Dishes, one rotates, other never does

- Use the "hide" animate on each to swap between which one is visible and which one isn't.

Edited by [APS]Gnat

Share this post


Link to post
Share on other sites

I was thinking the hide method. Having 2 rotating objects, with one being rotate animated and the other hide animated. Might work. Or I could try the script method. A script will be running during its time spinning as well so I could use that. I'll have to see what results I get.

I guess I need to use 'user' instead of 'time'. From there I just need to use the animate command? I will give it a go tomorrow as im on my laptop at the moment.

Share this post


Link to post
Share on other sites

Just to make sure one "almost stupid ulness you don't know it" thing: in Buldozer preview animations do not show "automatically", you have to do the anims manually with the mousewheel.

For those who know it is too obvious as it has to be mentoined but for beginners, where should they know from? :D

Share this post


Link to post
Share on other sites

Just a footnote to Mykes post, "time" animations do show automaticily.

Its other animations that you can use the mousewheel click to select an particular animation, and a mousewheel roll to see the animation in action.

Share this post


Link to post
Share on other sites

Yeah I found that out somewhere else. Funny, it doesn't work in Bulldozer but works fine in-game. I'm not sure about clicking the animation; I saw nothing in the little Animations box.

I'm going to take a shower then see what I can achieve from what has been said above. Thanks for your help guys :)

Edited by JasonO

Share this post


Link to post
Share on other sites
Gnat;1530662']Just a footnote to Mykes post' date=' "time" animations do show automaticily.

Its other animations that you can use the mousewheel click to select an particular animation, and a mousewheel roll to see the animation in action.[/quote']

...and again learned something new. Didn't knew that "time" sourced anims do work in Buldozer, never used them. Just guessed they were treated like any other anim.

Share this post


Link to post
Share on other sites

Changing 'time' to 'user' I get this:

Animation source radarX not found in bin\config.bin/CfgVehicles/tnl_rotate1/

So, I can only assume it is this part causing the issue now.

sourceAddress = "loop";

Will keep experimenting....

Share this post


Link to post
Share on other sites

User animations are different

An example in the MODEL.CFG is;

class HFence2

{

type="rotation";

initPhase=0;

source = "MoveX3";

animPeriod=4;

sourceAddress = "clamp";

selection="fence2";

axis="axisF2";

memory = true;

minValue = 0;

maxValue = 1;

angle0=0;

angle1="rad -70";

};

Then in the CONFIG.CPP you have to have something like this;

class AnimationSources : AnimationSources

{

class MoveX3

{

source = "user";

animPeriod = 0.01;

initPhase=0;

};

};

Then you need script commands ( animate ) to actually move it. (But you can still preview in Buldozer)

An example to animate the above would be;

_ship animate ["HFence2",1];

For you Buldozer previews, maybe theres a problem with where each of the files are located. Whats the directory structure for the project, p3d and model.cfg etc ?

Share this post


Link to post
Share on other sites

I give that a go now. Thanks.

Does this part:

class AnimationSources : AnimationSources
{
class MoveX3
{
source = "user";
animPeriod = 0.01;
initPhase=0;
};

}; 

.. go within the class of the object or a new class entirely?

Gnat;1530718']User animations are different

For you Buldozer previews' date=' maybe theres a problem with where each of the files are located. Whats the directory structure for the project, p3d and model.cfg etc ?[/quote']

I have Bulldozer using the P:/ system, where the addon folder (what eventually becomes a PBO) is in the root of that drive.

Edited by JasonO

Share this post


Link to post
Share on other sites

btw that animationSources class in config.cpphas to be INSIDE the actual vehicle defenition in cfgVehicles

Share this post


Link to post
Share on other sites

Yeh, sorry. As SA said, that definition is inside CFGVehicles, straight inside the actual object/vehicle definition.

hmmm ... your addon layout shouldn't stop it ...... I thinking further, but its getting late and the brain is fuzzy with pre-New Year drinks ;)

Share this post


Link to post
Share on other sites

Hey,

Just an update of what I've done. I've got 2 animations. The constant spinning one and another to hide it. Works a treat.

Thanks for your help guys. I've learnt a lot from this :)

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
Sign in to follow this  

×