Jump to content
Sign in to follow this  
Icarus

Problem: "Custom Soldiers in Custom Vehicles"

Recommended Posts

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

test3en.jpg

2) NorFor mod Soldiers in FGP Jeep

test4z.jpg

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 :)

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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 { ... }; } ?

Share this post


Link to post
Share on other sites

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:

class CfgMovesMC_IS //here "_IS" stands for Iron Sight
{
access=1;
vehicleActions="CfgVehicleActions";
transitionsInterpolated[]={};
transitionsSimple[]={"Lying","LyingDying",1,"LyingDying","LyingDead",1,"CivilLying","CivilLyingDying",1,"CivilLyingDying","CivilLyingDead",1,"Stand","StandDying",1,"StandDying","StandDead",1,"Stand","StandDyingVer2",1,"StandDyingVer2","StandDeadVer2",1,"Weapon","WeaponDying",1,"WeaponDying","WeaponDead",1,"Weapon","WeaponDyingVer2",1,"WeaponDyingVer2","WeaponDeadVer2",1,"Cargo","CargoDying",1,"CargoDying","CargoDead",1,"Combat","CombatToWeapon",2,"CombatToWeapon","Weapon",2,"Lying","LyingToWeapon",2,"LyingToWeapon","Weapon",2,"Weapon","WeaponToLying",2,"WeaponToLying","Lying",2,"Combat","CombatReloadMagazine",2,"CombatReloadMagazine","Combat",2,"Combat","CombatReloadMGun",2,"CombatReloadMGun","Combat",2,"Combat","CombatReloadMortarStart",2,"CombatReloadMortarStart","CombatReloadMortarEnd",2,"CombatReloadMortarEnd","Combat",2,"Combat","CombatThrowGrenadeStart",2,"CombatThrowGrenadeStart","CombatThrowGrenadeEnd",2,"CombatThrowGrenadeEnd","Combat",2,"Stand","StandThrowGrenadeStart",2,"StandThrowGrenadeStart","StandThrowGrenadeEnd",2,"StandThrowGrenadeEnd","Stand",2,"Civil","CivilThrowGrenadeStart",2,"CivilThrowGrenadeStart","CivilThrowGrenadeEnd",2,"CivilThrowGrenadeEnd","Civil",2,"Lying","LyingThrowGrenadeStart",2,"LyingThrowGrenadeStart","LyingThrowGrenadeEnd",2,"LyingThrowGrenadeEnd","Lying",2,"CombatRunF","CombatRunThrowGrenadeStart",2,"CombatRunThrowGrenadeStart","CombatRunThrowGrenadeEnd",2,"CombatRunThrowGrenadeEnd","Combat",2,"CivilRunF","CivilRunThrowGrenadeStart",2,"CivilRunThrowGrenadeStart","CivilRunThrowGrenadeEnd",2,"CivilRunThrowGrenadeEnd","Civil",2,"Lying","LyingReloadMagazine",2,"LyingReloadMagazine","Lying",2,"Combat","CombatToBinoc",2,"CombatToBinoc","Binoc",2,"Binoc","BinocToCombat",2,"BinocToCombat","Combat",2,"Lying","LyingToBinocLying",2,"LyingToBinocLying","BinocLying",2,"BinocLying","BinocLyingToLying",2,"BinocLyingToLying","Lying",2,"Weapon","WeaponReloadAT",2,"WeaponReloadAT","Weapon",2,"Stand","StandToCombat",1,"StandToCombat","Combat",1,"Combat","CombatToStand",1,"CombatToStand","Stand",1,"Lying","LyingToCombat",1.2,"LyingToCombat","Combat",1.2,"Combat","CombatToLying",1,"CombatToLying","Lying",1,"CombatRunF","CombatRunFToLying",1,"CombatRunFToLying","Lying",1,"Lying","LyingToCombatRun",1,"LyingToCombatRun","CombatRunF",1,"Civil","CivilToCivilLying",1.2,"CivilToCivilLying","CivilLying",1.2,"CivilLying","CivilLyingToCivil",1.2,"CivilLyingToCivil","Civil",1.2,"Combat","CombatGetInCar",1,"CombatGetInCar","Combat",1,"Combat","CombatGetInTank",1,"CombatGetInTank","Combat",1,"CombatGetOutTank","Combat",1,"Civil","CivilGetInCar",1,"CivilGetInCar","Civil",1,"Civil","CivilGetInTank",1,"CivilGetInTank","Civil",1,"CivilGetOutTank","Civil",1,"Stand","StandGetInCar",1,"StandGetInCar","Stand",1,"Stand","StandGetInTank",1,"StandGetInTank","Stand",1,"StandGetOutTank","Stand",1,"Stand","StandToSitDown",1,"StandToSitDown","EffectStandSitDown",1,"EffectStandSitDown","SitDownToStand",1,"SitDownToStand","Stand",1,"EffectStandSitDown","SitDownDying",1,"SitDownDying","SitDownDead",1,"CombatDead","DeadState",10,"CombatDeadVer2","DeadState",10,"StandDead","DeadState",10,"StandDeadVer2","DeadState",10,"LyingDead","DeadState",10,"CivilLyingDead","DeadState",10,"WeaponDead","DeadState",10,"WeaponDeadVer2","DeadState",10,"SitDownDead","DeadState",10,"Crouch","CrouchThrowGrenadeStart",2,"CrouchThrowGrenadeStart","CrouchThrowGrenadeEnd",2,"CrouchThrowGrenadeEnd","Crouch",2,"Weapon","WeaponToATBinoc",2,"WeaponToATBinoc","ATBinoc",2,"ATBinoc","ATBinocToWeapon",2,"ATBinocToWeapon","Weapon",2,"Weapon","WeaponToWeaponLying",2,"WeaponToWeaponLying","WeaponLying",2,"WeaponLying","WeaponLyingToWeapon","WeaponLyingToWeapon","Weapon",2,"Weapon","WeaponToWeaponCrouching",2,"WeaponToWeaponCrouching","WeaponCrouching",2,"WeaponCrouching","WeaponCrouchingToWeapon","WeaponCrouchingToWeapon","Weapon",2,"Combat","MoveOver",1,"MoveOver","Combat",1,"Civil","MoveOverC1",1,"MoveOverC1","Civil",1,"Stand","MoveOver2",1,"MoveOver2","Stand",1,"CombatSprintF","CombatSprintFToLying",1,"CombatSprintFToLying","Lying",1,"CrouchWalkF","CrouchWalkFToLying",1,"CrouchWalkFToLying","Lying",1,"CrouchSprintF","CrouchtSprintFToLying",1,"CrouchSprintFToLying","Lying",1,"Stand","MoveOverRifle",1,"MoveOverRifle","Stand",1,"HandGunCivil","StandToSitDown",1,"StandToSitDown","EffectStandSitDown",1,"EffectStandSitDown","SitDownToStand",1,"SitDownToStand","HandGunCivil",1};


transitionsDisabled[]={};

class Actions
	{

	class NoActionsAll:CfgManActions
		{
		access=3;
		};

	class NoActions:NoActionsAll
		{
		ladderOnDown="LadderDownStart";
		ladderOnUp="LadderUpStart";
		turnSpeed=1;
		upDegree=-1;
		limitFast=5;
		};

	class DeadActions:NoActions
		{
		upDegree=manposdead;
		};

	class CargoActions:NoActions
		{
		die="DeadState";
		};

	class M2CargoActions:CargoActions
		{
		die="M2GunnerDead";
		};

//handgunstart
	class HandGunCrouchActions:NoActions
		{....

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

Share this post


Link to post
Share on other sites

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).

Share this post


Link to post
Share on other sites

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).

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

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
accidentally a word

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

Thank you, Dan!!!!

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

Icarus :bounce3:

Edited by Icarus

Share this post


Link to post
Share on other sites

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

testdl.jpg

Thanks for help again!

Icarus :)

Share this post


Link to post
Share on other sites

hi,

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

cya.

Nikiller.

Share this post


Link to post
Share on other sites

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.cz/_hosted/animcenter/en/index.php

This is Flashpointgamers jeep provided in tutorial:http://ofp.gamepark.cz/_hosted/animcenter/en/tutorial4.php

Sorry for not highlighting, :(

Icarus :j:

P.S. I only used that jeep as an example of custom vehicle

that loads its custom (driver, gunner, cargo) animations.

interaction with my custom soldiers.

Edited by Icarus

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  

×