Jump to content

Photo
- - - - -

Problem: "Custom Soldiers in Custom Vehicles"


  • Please log in to reply
18 replies to this topic
Thread Starter
Icarus
Icarus

    Staff Sergeant

  • Members
  • 266 posts

#1

Posted 09 April 2012 - 13:15

Dear OFP/ARMA: CWA veterans,

Please share your ideas about this problem.
I created custom Soldiers witch use their own Config.cpp (class CfgMovesMC) and are unable to be used inside custom vehicles
that also have their own class CfgMovesMc.

Examples:
1) My custom Soldiers in FGP Jeep
Posted Image

2) NorFor mod Soldiers in FGP Jeep
Posted Image

As you can see soldiers that use their own class CfgMovesMC fail to get animation files from custom Vehicle folder.
The worst part is that also happens for Resistance vehicles, such as Motorcycle.

I guess this problem appears because Class CfgMovesMC is a "local" class that has "limited visibility" to other classes (such as Custom Soldiers),
I apologize for my primitive understanding. I am no programer.

Please share your ideas about solving this problem. Any suggestions are appreciated :)


Thank you in advance, Icarus :)

krzychuzokecia
krzychuzokecia

    Master Sergeant

  • Members
  • 711 posts
  • LocationWarsaw, Poland

#2

Posted 09 April 2012 - 15:33

I don't know if this will help you, but I think this problem is related to car only, not units - I'm having the same problem with vanilla units & P:UKF Land Rovers WMIK.

DanAK47
DanAK47

    Staff Sergeant

  • Members
  • 398 posts

#3

Posted 09 April 2012 - 16:09

Can you elaborate on what you mean by "use their own cfgmovesmc"?

Do you mean you copy/pasted the entirety of cfgMovesMC and made it a new class, i.e:

class IcarusMovesMC { .... copy of cfgMovesMC ... };

or do you mean you are following the pattern of the BIS women, i.e:

class IcarusMoves: CfgMovesMC { class StatesExt { ... }; } ?

Thread Starter
Icarus
Icarus

    Staff Sergeant

  • Members
  • 266 posts

#4

Posted 10 April 2012 - 07:22

Thank you guys for responding

Can you elaborate on what you mean by "use their own cfgmovesmc"?

Do you mean you copy/pasted the entirety of cfgMovesMC and made it a new class, i.e:

class IcarusMovesMC { .... copy of cfgMovesMC ... };

or do you mean you are following the pattern of the BIS women, i.e:

class IcarusMoves: CfgMovesMC { class StatesExt { ... }; } ?


That is exactly what I did My cutom soldier has its own config.cpp and cutom CfgMovesMC section witch is a modified copy
of ww4mod2.5 CfgMovesMC:
Spoiler

I am Sorry I can not show all the CfgMovesMC_IS because text is too long :(

I can send you my config file if you want to take a look at it.

Thank you for help, Icarus :j:

Edited by Icarus, 16 July 2012 - 16:22.


ProfTournesol
ProfTournesol

    Lieutenant Colonel

  • Members
  • 8438 posts
  • LocationParis, France

#5

Posted 10 April 2012 - 07:50

So, that's very easy. Just post the config.cpp of the custom jeep here and i'll help you.

But the logic is : in the config.cpp of the jeep, you must have a "cfgmoves" section, which defines some "class stand" actions, one for the driver, and the other for the gunner (and maybe some for the cargo or co-driver). Those actions are then used in the "cfgvehicleactions" (which must be in the same jeep config) then used in the "cfgvehicle" of the jeep through driveraction = "manactblablabla" and gunneraction = "manactblablabla".

All you have to do is copy and paste the two actions defined in the cfgmoves section of the jeep config in your own CfgMovesMC_IS, at the end of if (in the "class stand" part).

DanAK47
DanAK47

    Staff Sergeant

  • Members
  • 398 posts

#6

Posted 10 April 2012 - 08:34

The problem with that method is that you have to add all the animations used by custom vehicles into your CfgMovesMC, and if someone releases another vehicle that uses custom animations - your soldiers will be broken again.

It is much better to use the method I explained to you in PMs a while ago:

Add your custom animation states into the EXISTING cfgMovesMC with prefixes - IE IcarusCombat, IcarusCrouch, etc.

Then, create a new CfgMovesMC in the model of the BIS women - using StatesExt. Next, force some default states (Combat, Stand, etc) to connectTo your new states.

As an outline (obviously some necessary code is missing here, but you should be able to fill in the gaps):

Class MySoldier
{
moves=MyMoves
};

Class CfgMovesMC
{
class Actions { MyCombatActions... {}; };
class States { MyCombat {}; };
};

Class MyMoves: CfgMovesMC
{
class StatesExt
{
class Combat: Default
{ .... copy/paste stuff from your "Combat" state here...
ConnectTo[]={MyCombat,1};
};
};
};

The engine looks at your soldier, sees it uses MyMoves, goes to myMoves and plays the "Combat" state, which immediately connects to "MyCombat" back in the original CfgMovesMC. As your states are now "inside" of the original CfgMovesMC, any states added to CfgMovesMC by other addons will already be "reachable".

For a more in depth example (and more complex) look at the config for my guerrilla pack (it is uncompressed already - easy to unpbo and look at).

Thread Starter
Icarus
Icarus

    Staff Sergeant

  • Members
  • 266 posts

#7

Posted 10 April 2012 - 08:38

Thank you for help ProfTournesol,

Unfortunatelly my class CfgMovesMc_IS is over 200000 characters long (max allowed message on forum is 50000 characters)

I will try to send you PM

Icarus

R0adki11
R0adki11

    Major R0adki11

  • Moderator
  • 4907 posts
  • LocationGreat Britain

#8

Posted 10 April 2012 - 10:09

Thank you for help ProfTournesol,

Unfortunatelly my class CfgMovesMc_IS is over 200000 characters long (max allowed message on forum is 50000 characters)

I will try to send you PM

Icarus


Im sure a CfgMovesMc_IS shouldnt be that long?

Thread Starter
Icarus
Icarus

    Staff Sergeant

  • Members
  • 266 posts

#9

Posted 10 April 2012 - 10:17

Maybe I have done something wrong... :(

I guess I need Beta testers :)
If there are volunteers, please send me PM.

Icarus

P.S. @DanAk47: No new moves where created I just replaced some hangun animations with aimed animations to get 3D Ironsight effect.

Edited by Icarus, 10 April 2012 - 10:57.


DanAK47
DanAK47

    Staff Sergeant

  • Members
  • 398 posts

#10

Posted 10 April 2012 - 12:09

In that case, you do not need a new cfgMovesMC at all.. Just place your replacement HandgunStand, HandgunCrouch, etc animations in StatesExt.

ProfTournesol
ProfTournesol

    Lieutenant Colonel

  • Members
  • 8438 posts
  • LocationParis, France

#11

Posted 10 April 2012 - 17:11

In that case, you do not need a new cfgMovesMC at all.. Just place your replacement HandgunStand, HandgunCrouch, etc animations in StatesExt.


@ Icarus : from what i see here, you should contact Dan by PM, i'm not used to class StatesExt animations.

Thread Starter
Icarus
Icarus

    Staff Sergeant

  • Members
  • 266 posts

#12

Posted 11 April 2012 - 10:05

@DanAK47: PM sent.

Icarus

DanAK47
DanAK47

    Staff Sergeant

  • Members
  • 398 posts

#13

Posted 11 April 2012 - 12:33

Look at the 1.85 commented config. Notice under the civilian women's classes (Woman1, etc) they have moves=CfgMovesMCWoman. So, let's look at cfgMovesMCWoman.

class [B]CfgMovesMCWoman: CfgMovesMC[/B]
{
	class States[B]Ext[/B]
	{
		class CivilBase: Default
		{
			aiming="aimingNo";
			actions="CivilActions";
			duty=-1;
			disableWeapons=1;
			interpolateTo[]={"CivilDying",0.100000,"CivilDyingVer2",0.100000};
			interpolationSpeed=3;
		};
		class Civil: CivilBase
		{
			file="\o\anim\zenskastojistat.rtm";
			speed=10000000000.000000;
			looped=1;
			soundEnabled=0;
			variantAfter[]={1,3,6};
			variantsAI[]={"Civil",0.200000,"CivilStillV1",0.800000};
			equivalentTo="Civil";
			interpolateTo[]={"CombatThrowGrenadeStart",1,"CombatRunThrowGrenadeStart",1,"CivilDying",0.100000,"CivilDyingVer2",0.100000};
			interpolateFrom[]={"CombatThrowGrenadeEnd",1};
		};
etc...

This means that instead of playing the CivilBase or Civil states from CfgMovesMC, they use the CivilBase and Civil states defined here in CfgMovesMCWoman. This is very useful when you want to change something minor about an animation state for a certain unit like the animation file it uses, speed, or etc without changing the ENTIRE cfgMovesMC.

One caveat is that you cannot build off of classes that are under states in CfgMoves, only "DEFAULT". This means if I want to modify a state whose parent is not DEFAULT, I have to include its parent states in StatesExt. See example 2 below.

Example 1 - if I wanted to modify the "Combat" state:

Class MyCfgMoves: CfgMovesMC
{
    class StatesExt
    {
       class Combat:Default
       {
          actions="CombatActions";
          preload=1;
[I]          file="\MyAnims\MyNewCombatAnim.rtm";[/I]
          speed=1e+10;
          looped=1;
          soundEnabled=0;
          duty=-1;
          variantsPlayer[]={"CombatStillPlayer", 0.500000, "Combat"};
          variantsAI[]={"CombatStillPlayer", 0.300000, "CombatStillV1", 0.500000, "Combat"};
        };
     }
}

Example 2 - If I wanted to modify the Crouch state - notice that Crouch builds off of COMBAT and not DEFAULT. If you do not include Combat in statesExt, you will get an "undefined base class" error. If you include Combat in StatesExt, but not the full config entry, like Combat: Default {};, your "Combat" state will become identical to the "Default" state.

Class MyCfgMoves: CfgMovesMC
{
    class StatesExt
    {
       class Combat:Default
       {
          actions="CombatActions";
          preload=1;
          file="sstanistat.rtm";
          speed=1e+10;
          looped=1;
          soundEnabled=0;
          duty=-1;
          variantsPlayer[]={"CombatStillPlayer", 0.500000, "Combat"};
          variantsAI[]={"CombatStillPlayer", 0.300000, "CombatStillV1", 0.500000, "Combat"};
        };
        class Crouch:[B]Combat[/B]
        {
           preload=1;
           actions="CrouchActions";
           [I]file="\MyAnims\MyCrouch.rtm";[/I]
           speed=1e+10;
           variantsPlayer[]={};
           variantsAI[]={};
           visibleSize=0.6;
           aimPrecision=0.5;
          recoilSuffix="halffixed";
        };
     }
}

Another thing to note is that you cannot add "new" classes to StatesExt because the game will never use them. Truly new animation states should be placed in CfgMovesMC. StatesExt only modifies states that already exist in CfgMovesMC.

Edited by DanAK47, 11 April 2012 - 12:34.
accidentally a word


Thread Starter
Icarus
Icarus

    Staff Sergeant

  • Members
  • 266 posts

#14

Posted 11 April 2012 - 22:16

Thank you for reply Dan,

I am really sorry but I failed to find class Woman or class CfgMovesMCWoman: CfgMovesMC in this commented config. Am I completely dumb or is that not config v1.85?
Can you please send me link of commented config v1.85 if that config I mentioned is wrong...

Thank for all the help, Icarus :j:

Edited by Icarus, 15 April 2012 - 07:26.


DanAK47
DanAK47

    Staff Sergeant

  • Members
  • 398 posts

#15

Posted 12 April 2012 - 04:58

Sorry, it's actually from the O.pbo config. You can download a debinarized copy from here: http://web.quick.cz/fholesinsky/OF/

Thread Starter
Icarus
Icarus

    Staff Sergeant

  • Members
  • 266 posts

#16

Posted 13 April 2012 - 19:10

Thank you, Dan!!!!

I will study your examples and that class CfgMovesMCWoman to change my custom soldiers config.

Icarus :bounce3:

Edited by Icarus, 14 April 2012 - 21:54.


Thread Starter
Icarus
Icarus

    Staff Sergeant

  • Members
  • 266 posts

#17

Posted 15 April 2012 - 14:58

Config is fixed, now custom vehicle animations work. :bounce3:
Posted Image

Thanks for help again!

Icarus :)

nikiller
nikiller

    Gunnery Sergeant

  • Members
  • 420 posts

#18

Posted 16 April 2012 - 16:39

hi,

Looks good. I like the way you placed MP5 and hands on the steering wheel. Nice job keep it up.

cya.

Nikiller.
[LOL] ofp/ArmA clan since 2004.
No Respawns, No Crosshairs, No Muppets.
Want a good ofp/ArmA2 coop? Visit the [LOL] clan homepage | ofp [LOL] addons pack | ArmA2 [LOL] addons pack

WW4mod25 sound replacement mod v1.1 | Nikiller's scripts pack

Thread Starter
Icarus
Icarus

    Staff Sergeant

  • Members
  • 266 posts

#19

Posted 16 April 2012 - 16:51

I am sorry if I misguided you Nikiller, that jeep (and animations) is not my creation.
I have downloaded it from OFP Anim Center: http://ofp.gamepark....er/en/index.php
This is Flashpointgamers jeep provided in tutorial:http://ofp.gamepark....n/tutorial4.php

Sorry for not highlighting, :(
Icarus :j:

P.S. I only used that jeep as an example of custom vehicle
Spoiler
interaction with my custom soldiers.

Edited by Icarus, 24 April 2012 - 19:50.