Jump to content
Sign in to follow this  
brsseb

Custom animations on helicopters - help

Recommended Posts

Hi

I have a custom animaiton on my heli. It works fine when the heli is on the ground, but once it is off the ground (hovering or moving), Im unable to execute the animation from the action menu (it disapears from the menu untill Ive landed again). I have a named selection in primary lod (the structure to be animated) and an axis in Memory LOD. Is it possible to do this?

I assume that I have to change something in my configfile. Here is my current animation setup:

...

// Animations

animated=true;

class Animations

{

class side_door

{

type="rotation";

animPeriod=2;

selection="side_door";

axis="axis_for_side_door";

angle0=0;

angle1=-3.0;

};

};

class UserActions

{

class OpenSideDoor

{

displayName="Open side door";

position="axis_for_side_door";

radius=10;

condition="this animationPhase ""side_door"" < 0.5";

statement="this animate [""side_door"", 1]";

};

class CloseSideDoor

{

displayName="Close side door";

position="axis_for_side_door";

radius=10;

condition="this animationPhase ""side_door"" >= 0.5";

statement="this animate [""side_door"", 0]";

};

};

...

Is this possible to fix? I assume it is since its possible to execute the turn on/off lights action when Inflight. But what do I need to change then?

brsseb

Share this post


Link to post
Share on other sites
Guest BratZ

From what I recall reading, this is a known bug.Only conclusion I recall reading was to script it seperately and use it in an addaction script.

But I'm not sure

Share this post


Link to post
Share on other sites

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (BratZ @ Nov. 09 2002,22:14)</td></tr><tr><td id="QUOTE">From what I recall reading, this is a known bug.Only conclusion I recall reading was to script it seperately and use it in an addaction script.

But I'm not sure<span id='postcolor'>

Yes, but the standard ofp lights on/off works fine, so why not a user made one? (Looked trough the commended configs and could find the section where vehicle lights are turned off or on. Strange)

Also, with the current settup its possible to run the animation from outside the vehicle which looks a bit weird. I want it to only be aviable when one is aboard the chopper.

brsseb

Share this post


Link to post
Share on other sites
Guest

Moving to Addon Config & Scripting smile.gif

Share this post


Link to post
Share on other sites

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (BratZ @ Nov. 09 2002,22:14)</td></tr><tr><td id="QUOTE">From what I recall reading, this is a known bug.<span id='postcolor'>

Yes, it is a known bug. It will be fixed in the upcoming patch.

Share this post


Link to post
Share on other sites

But there is a simple trick, to avoid this bug until a new patch will be released.

Just set the radius in your UserAction-class to 18100.

And then add "and player in this" to the condition part.

Here´s a part of my Airwolf config.cpp.

class UserActions

{

class GearUp

{

displayName="$STR_ACTION_GEAR_UP";

position="osa_Nose";

radius=18100;

condition="this animationPhase ""Maingear"" < 0.5 and player in this";

statement="this animate [""Maingear"", 1]; this animate [""Nosegear"",1]";

};

class GearDown

{

displayName="$STR_ACTION_GEAR_DOWN";

position="osa_Nose";

radius=18100;

condition="this animationPhase ""Maingear"" >= 0.5 and player in this";

statement="this animate [""Maingear"", 0]; this animate [""Nosegear"", 0]";

};

that should do it. biggrin.gif

Share this post


Link to post
Share on other sites

YES! Thank you, my Lord! Yoů`ve done it. Thankz

And while we`re at it, could you just give me the "statement" and "condition" pairs for engine on/off? Want a door to automatically open when the engine is turned off and closing when it starts. Then I`ll be truly satisfied.

brsseb

Share this post


Link to post
Share on other sites

From what I have seen a soldier is not classifed as "in this" (ie in his body) when he enters another vehicle, so any animations attached to the soldier (eg moving goggles) disables when they enter a vehicle if you use the "and player in this" line.

Still very useful until BIS fix it!

SelectThis

Share this post


Link to post
Share on other sites

Great solution... But what about the AI? "Player" works only when player is in the vehicle, but if you want the AI to activate the action, then the player has to be in or the animation doesn't work sad.gif

Share this post


Link to post
Share on other sites

@brsseb

your problem can surely be solved by using an eventhandler, but i don´t know how to use it in a config.cpp.

@Frugo_PL

the AI is not able to use the action because it´s defined as UserAction. The map-designer has to use the commands which are written in the statement entry, to make the animation work.

Share this post


Link to post
Share on other sites

Hi. One more thing, my Lord..

You are executing two animations in each gear up/down class;

statement="this animate [""Maingear"", 0]; this animate [""Nosegear"", 0]";

I understand that this is possible, but then the field position="osa_Nose"; makes no scene. As far as I understand, this is the axis that the selection wil animate around, but it makes no sence when executing more than one animation in the class because I assume that maingear and nosegear each have their own axes and not share the same one "osa_Nose").

brsseb

Share this post


Link to post
Share on other sites

the osa_nose there is just the point from where the actual action in the action menu comes from, the pivot point for the animation is defined in the animation itself

Share this post


Link to post
Share on other sites

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (Kegetys @ Nov. 12 2002,11:45)</td></tr><tr><td id="QUOTE">the osa_nose there is just the point from where the actual action in the action menu comes from, the pivot point for the animation is defined in the animation itself<span id='postcolor'>

Okey...so nothing to worry about then. But I still need something to put in that position field, so what do I put in there (AKA not totally sure what you meant smile.gif ). Got two main gears and a tail wheel, each with their own named selection, axis and one class each to define the animations.

Then I have two classes in UserActions, one that pulls the landinggear down and one to raise it. So, my problem now is that I have nothing to put in that position field. Can I just throw in anything, any named selection from the model just to make the attribute happy? Or what part of my model should I put in that field?

brsseb

Share this post


Link to post
Share on other sites

the position filed is the name of a point in the memory lod around which (the distance is set in the radius filed) the animation can be executed for example make a point in memory lod at the same place as the front gear and name it "pos_nosegear" now in your config in the position param put "pos_nosegear" and set the radius to 10.

Now to make it work in flight u gotta put radius to 18100 and add this in the end of conditions: and player in this just before the ";.

hope it helps

Share this post


Link to post
Share on other sites

You can also write "and player distance this <= 5" if you want to trigger the animation from outside.

This can be used for animated Doors.

@brsseb

osa_nose is the axis to rotate the Nosegear around, but you can use any point from the memory-LOD to put in the position field, i think.

Rangarion

Share this post


Link to post
Share on other sites

Ok, almost there now smile.gif. One small problem left. This below generates an error, saying some attribute in the configfile "is already defined" somehow. Can anyone spot the error? Got now 3 gears, two right/left and one tail. Each is named "left_wheel", "right_wheel" and "tail_wheel". They have axises named "axis_for_right_wheel", etc. (Dont mind the rotation angles and stuff, havent configured that yet..)

// Animations

animated=true;

class Animations

{

class tail_wheel

{

type="rotation";

animPeriod=2;

selection="tail_wheel";

axis="axis_for_tail_wheel";

angle0=0;

angle1=-3.0;

};

class left_wheel

{

type="rotation";

animPeriod=2;

selection="left_wheel";

axis="axis_for_left_wheel";

angle0=0;

angle1=-3.0;

};

class right_wheel

{

type="rotation";

animPeriod=2;

selection="right_wheel";

axis="axis_for_right_wheel";

angle0=0;

angle1=-3.0;

};

};

class UserActions

{

class LowerLandingGear

{

displayName="Lower landing gear";

position="gear_area";

radius=18100; // To overcome bug

condition="this animationPhase ""tail_wheel"" >= 0.5 and player in this";

statement="this animate [""tail_wheel"", 0]";  statement="this animate [""right_wheel"", 0]"; statement="this animate [""left_wheel"", 0]";

};

class RaiseLandingGear

{

displayName="Raise landing gear";

position="gear_area";

radius=18100; // To overcome bug

condition="this animationPhase ""tail_wheel"" < 0.5 and player in this";

statement="this animate [""tail_wheel"", 1]"; statement="this animate [""right_wheel"", 0]"; statement="this animate [""left_wheel"", 0]";

};

};

Share this post


Link to post
Share on other sites

It looks, the 'statement' parameter has been used for several times, instead of using several statements within brackets, separated by semicolons.

Share this post


Link to post
Share on other sites

Try instead of writting

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">statement="this animate [""tail_wheel"", 0]"; statement="this animate [""right_wheel"", 0]"; statement="this animate [""left_wheel"", 0]";<span id='postcolor'>

write this:

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">statement="this animate [""tail_wheel"", 0]; this animate [""right_wheel"", 0]; this animate [""left_wheel"", 0]";<span id='postcolor'>

for every animation

Share this post


Link to post
Share on other sites

Yes, quotation marks like in the example of Soul Assasin I meant of course, not brackets. Was typing to fast..

Share this post


Link to post
Share on other sites

SUCCESS

Everything works now. Thank you guys, looks like my heli is getting animated landinggear afterall.

brsseb (ofp.info/brsseb)

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  

×