Jump to content
Sign in to follow this  
edejl

Animation Config

Recommended Posts

OK so I've had done brsseb's tuorial on animations and it's fine up to the point with the config...in his config there are 3, no 4 animations going on and I only want 1, a ramp!

The vehicle side of the config is fine and so is the model but just the part of the config which is to do with the animation is all crazy! Anyone know what it should be?. The ramp is called ramp, the axis is called ramp_axis

Also, I have put a pos switch thing in because it is in the tutorial but is that needed if I don't want an actual switch or is that switch a command switch? If ya see what I mean lol. Thanks!

Share this post


Link to post
Share on other sites

Its actually very easy,all that is needed is:

Named selection in any view lods that you want the animation to be seen (including pilot/cargo/gunner view if necessary and they can see the selection)

2 vertexs in memory LOD

The animation part in .cpp ,must be with cfgvehicles

Name the selection and vertexs whatever you want just match the names in the .cpp

ramp sounds fine ,ramp_axis sounds fine

Share this post


Link to post
Share on other sites

Oh no, the model bit is fine, it's the config that I don't know how to do!!

Share this post


Link to post
Share on other sites

In the CfgVehicles section:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">class TAGMyAddon : class [...]

{

[...]

animated =1;

class Animations

{

      class RampAnim

      {

            type ="rotation";

            animPeriod =5;

            selection ="ramp_selection";

            axis ="ramp_axis";

            // Angles in _radians_

            angle0 =0;

            angle1 =1.53;

      };

[More anims here]

};

class UserActions

{

  class RampUp

  {

       displayName ="Ramp Up";

       position = "doors";

       radius =6;

       condition = "this animationphase ""RampAnim"" < 0.1 ";

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

  };

  class RampDown

  {

       displayName ="Ramp Down";

       position = "doors";

       radius =6;

       condition = "this animationphase ""RampAnim"" > 0.9 ";

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

   };

[More User Actions]

};

[...]

// End of TAGMyAddon class

};

This is all from memory, so there may be a bug or two.

Share this post


Link to post
Share on other sites

Thanks!!!

[Edit] When tested it says no entry in CfgVehciles-Animations.Scope or something, vehicle works fine but animation won't.

Share this post


Link to post
Share on other sites

If you could post the config.cpp.I am sure somebody can check it out for you.

Share this post


Link to post
Share on other sites

Here it is...also does anyone know why my driver is sitting down when I have set the proxy for him as a standing PBR driver?

Thanks

Quote[/b] ]#define TEast 0

#define TWest 1

#define TGuerrila 2

#define TCivilian 3

#define TSideUnknown 4

#define TEnemy 5

#define TFriendly 6

#define TLogic 7

#define true 1

#define false 0

#define private 0

#define protected 1

#define public 2

class CfgPatches

{

class EJLLCVP

{

units[] = {EJLLCVP};

weapons[] = {};

requiredVersion = 1.75;

};

};

class CfgModels

{

class Default{};

class Ship : Default{};

class EJLLCVP: Ship{};

};

class CfgVehicles

{

class All{};

class AllVehicles:All{};

class Land : AllVehicles {};

class Ship: AllVehicles{};

class BigShip: Ship{};

class aalc: BigShip

{

displayName="EJL LCVP";

accuracy=0.80;

fuelCapacity=500;

model="\EJLLCVP\EJLLCVP.p3d";

vehicleClass="Armored";

scope=public;

hasDriver=true;

hasGunner=false;

hasCommander=false;

driverIsCommander=true;

getInRadius=40;

driverAction="ManActJeepDriver";

driverInAction="ManActJeepDriver";

cargoAction[]={"ManActShipCargo"};

irScanRange=4000;

irScanGround=1;

side=TWest;

type=VArmor;

crew="SoldierWCrew";

maxSpeed=70;

steerAheadSimul=2;

steerAheadPlan=2;

predictTurnSimul=3;

predictTurnPlan=3;

transportSoldier=4;

transportAmmo=10000;

class TransportWeapons

{

class M16_WP1

{

weapon="M16";

count=10;

};

class LAWLauncher_WP2

{

weapon="LAWLauncher";

count=10;

};

};

class TransportMagazines

{

class M16_AM1

{

magazine="M16";

count=30;

};

class LAWLauncher_AM2

{

magazine="LAWLauncher";

count=20;

};

};

class Reflectors

{

class Left

{

color[] = {0.9, 0.8, 0.8, 1.0};

ambient[] = {0.1, 0.1, 0.1, 1.0};

position = "L svetlo";

direction = "konec L svetla";

hitpoint = "L svetlo";

selection = "L svetlo";

size = 1.0;

brightness = 1.5;

};

};

cost=2000000;

armor=450;

armorStructural=2.000000;

};

animated =1;

class Animations

{

class RampAnim

{

type ="rotation";

animPeriod =5;

selection ="ramp_selection";

axis ="ramp_axis";

// Angles in _radians_

angle0 =0;

angle1 =1.53;

};

};

class UserActions

{

class RampUp

{

displayName ="Ramp Up";

position = "doors";

radius =6;

condition = "this animationphase ""RampAnim"" < 0.1 ";

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

};

class RampDown

{

displayName ="Ramp Down";

position = "doors";

radius =6;

condition = "this animationphase ""RampAnim"" > 0.9 ";

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

};

};

// End of EJLLCVP class

};

Share this post


Link to post
Share on other sites

You want to move the "};" (without the quotes) just above

"animated=1" to the end of the file. The error message

indicates that the 'scope' is wrong: a 'scope' in this context

is a line of declarations surrounded by opening "{" and closing

"}" brackets. Because the class aalc ends too early (before

animated=1), the scope is in CfgVehicles, where it shouldn't

be.

Are you sure you want

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">vehicleClass="Armored"

instead of

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">vehicleClass="Ship"

Also, change the driver action:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">driverAction=ManActPBRDriver;

and you driver will stand up. The proxy doesn't matter - it's

over-ridden by the config.

(I don't think you need driverinaction, as you can't turn in

on a boat, IIRC).

Share this post


Link to post
Share on other sites

Thanks! However...lol...Now it crashes to desktop lol...

Here is the slightly modified config. Is it because I've changed all the class and everything to 'EJLLCVP'?

I'm rubbish with configs and so don't know what the classes etc are and how they need to be named so I named them all the same..I want it called EJL LCVP but just need to classes named something suitable. Or is it something else, only made the changes you suggested.

P.S. I'm going to change the vehicle class back to armored cos it is an armoured ship and when people put new add ons in new sub headings it annoys me cos the list gets confused lol.

P.P.S Is there anything I can delete from my config? I made it from parts of tutorial configs so there are things like

Quote[/b] ] // End of EJLLCVP class
that I assume I can delete. Is this true?
Quote[/b] ]#define TEast 0

#define TWest 1

#define TGuerrila 2

#define TCivilian 3

#define TSideUnknown 4

#define TEnemy 5

#define TFriendly 6

#define TLogic 7

#define true 1

#define false 0

#define private 0

#define protected 1

#define public 2

class CfgPatches

{

class EJLLCVP

{

units[] = {EJLLCVP};

weapons[] = {};

requiredVersion = 1.75;

};

};

class CfgModels

{

class Default{};

class Ship : Default{};

class EJLLCVP: Ship{};

};

class CfgVehicles

{

class All{};

class AllVehicles:All{};

class Land : AllVehicles {};

class Ship: AllVehicles{};

class BigShip: Ship{};

class EJLLCVP: BigShip

{

displayName="EJL LCVP";

accuracy=0.80;

fuelCapacity=500;

model="\EJLLCVP\EJLLCVP.p3d";

vehicleClass="Ship";

scope=public;

hasDriver=true;

hasGunner=false;

hasCommander=false;

driverIsCommander=true;

getInRadius=40;

driverAction="ManActPBRDriver";

cargoAction[]={"ManActShipCargo"};

irScanRange=4000;

irScanGround=1;

side=TWest;

type=VArmor;

crew="SoldierWCrew";

maxSpeed=70;

steerAheadSimul=2;

steerAheadPlan=2;

predictTurnSimul=3;

predictTurnPlan=3;

transportSoldier=4;

transportAmmo=10000;

class TransportWeapons

{

class M16_WP1

{

weapon="M16";

count=10;

};

class LAWLauncher_WP2

{

weapon="LAWLauncher";

count=10;

};

};

class TransportMagazines

{

class M16_AM1

{

magazine="M16";

count=30;

};

class LAWLauncher_AM2

{

magazine="LAWLauncher";

count=20;

};

};

class Reflectors

{

class Left

{

color[] = {0.9, 0.8, 0.8, 1.0};

ambient[] = {0.1, 0.1, 0.1, 1.0};

position = "L svetlo";

direction = "konec L svetla";

hitpoint = "L svetlo";

selection = "L svetlo";

size = 1.0;

brightness = 1.5;

};

};

cost=2000000;

armor=450;

armorStructural=2.000000;

animated =1;

class Animations

{

class RampAnim

{

type ="rotation";

animPeriod =5;

selection ="ramp_selection";

axis ="ramp_axis";

// Angles in _radians_

angle0 =0;

angle1 =1.53;

};

};

class UserActions

{

class RampUp

{

displayName ="Ramp Up";

position = "doors";

radius =6;

condition = "this animationphase ""RampAnim"" < 0.1 ";

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

};

class RampDown

{

displayName ="Ramp Down";

position = "doors";

radius =6;

condition = "this animationphase ""RampAnim"" > 0.9 ";

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

};

};

// End of EJLLCVP class

};

};

Thanks again!

Share this post


Link to post
Share on other sites

Looking at it quickly ,it looks ok to me,nice work.Only thing I can see offhand is these extra ; in your useractions

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

class UserActions

{

class RampUp

{

displayName ="Ramp Up";

position = "doors";

radius =6;

condition = "this animationphase ""RampAnim"" < 0.1 ";

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

};

class RampDown

{

displayName ="Ramp Down";

position = "doors";

radius =6;

condition = "this animationphase ""RampAnim"" > 0.9 ";

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

};

};

Change To

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

class UserActions

{

class RampUp

{

displayName ="Ramp Up";

position = "doors";

radius =6;

condition = "this animationphase ""RampAnim"" < 0.1 ";

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

};

class RampDown

{

displayName ="Ramp Down";

position = "doors";

radius =6;

condition = "this animationphase ""RampAnim"" > 0.9 ";

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

};

};

Share this post


Link to post
Share on other sites

[Edit] OK so I made it not crash to desktop, it was looking in wrong place for the model!

But it says Ramp Up when the ramp is up and wont let me get the ramp down

Share this post


Link to post
Share on other sites

In the class UserActions

switch the 2 lines

condition= "

statement ="

class Animations

{

    class RampAnim

    {

          type ="rotation";

          animPeriod =5;

          selection ="ramp_selection";

          axis ="ramp_axis";

          // Angles in _radians_

          angle0 =0;  This is the start point

          angle1 =1.53;  This is the finish point

    };

};

If you have drawn the ramp on your model in the up position then that is angle0 =0;

So the animationphase ""RampAnim"" =0

The "Ramp Down" won't work the way you have it coz it needs the  animationphase ""RampAnim"" > 0.9 "; when it should be <.1

P.S: if this is wrong then I am sorry but its hard to think at the mo coz my parrot is screeching in my ear. It has about 10 seconds to live.

Share this post


Link to post
Share on other sites

OK so maybe I'm jsut being stupid but it still isn't working...I think I understood what you said, this is what it looks like now.

Quote[/b] ]animated =1;

class Animations

{

class RampAnim

{

type ="rotation";

animPeriod =5;

selection ="ramp_selection";

axis ="ramp_axis";

// Angles in _radians_

angle0 =0;

angle1 =1.53;

};

};

class UserActions

{

class RampUp

{

displayName ="Ramp Up";

position = "doors";

radius =6;

condition = "this animationphase ""RampAnim"" > 0.9 ";

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

};

class RampDown

{

displayName ="Ramp Down";

position = "doors";

radius =6;

condition = "this animationphase ""RampAnim"" < 0.1 ";

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

};

};

Share this post


Link to post
Share on other sites

Edejl - What is the actual problem?

In the 3d model in O2, is the ramp in the 'up' or 'down'

position?

Do the "Ramp Up" and/or "Ramp Down" actions appear in the

menu when you approach the unit?

Does selecting one of them cause something to happen, or

does nothing happen?

(You can delete any line that starts with \\, as that is just

a comment).

Share this post


Link to post
Share on other sites

The model of the ramp is up.

Ramp Down is displayed in the action menu in game (because the ramp is already up by default)

Nothiung happens when Ramp Down is clicked.

// Thats what I thought, thanks.

Share this post


Link to post
Share on other sites

Check the selection and axis settings in the anim. The

selection value should be the _exact_ name of the selection

defined in the resolution LODS of the model. The axis value should refer to 2 points in the Memory LOD.

Share this post


Link to post
Share on other sites

Wooh! It's working!! Thanks it has rampslection and i supposed to put the ramp's selection name in there lol!

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  

×