Jump to content
Sign in to follow this  
madrussian

Understanding PreloadAddons vs requiredAddons (which does what?)

Recommended Posts

Searches are not turning up anything specific (enough), so I figure might as well ask.  Question first, then some background for those interested in a saga.

 

In the "config.cpp", what is the difference between including an addon inside the requiredAddons[] list, versus including it inside the PreloadAddons list?

 

OK, some background on my current struggle.  Here's the long story condensed:

Recent BIS patch created an animation transition glitch for me in vanilla game while running AIA Terrain Pack.   Steps to repeat:

  1. Create test mission with single rifleman as the player, and start the mission.
  2. Enter 3rd person
  3. Kneel.  Observe you are kneeling , stopped, with rifle raised.  (Helps to view yourself from the side, via the "Freelook" key)
  4. Press and hold the "Sprint" key.  (For me it's left shift.)
  5. Press the "Move forward" key
  6. Observe animation glitch!  (Imo, it's a real eye sore.  If you view yourself from the side, it's even worse.)
  7. (7-10 optional) Stop, stay kneeling, and lower your rifle.
  8. Press and hold the "Sprint" key.
  9. Press the "Move forward" key
  10. Observe, smooth regular transition to sprinting!

EDIT:

Further testing has revealed this animation glitch is actually not present in vanilla after all.  Rather it is a problem with (my version of) AIA Terrain Pack [with or without other mods present, it's always there].  If you are having this animation issue, please see my working fix in the next post down!

 

I made an addon to fix the glitch, and it works perfectly.  Here's my "config.cpp":  

 

EDIT: Don't use this fix (it has issues)... use the one in the next post down!

class CfgPatches {
               class MRU_AnimTransFix {
                              units[] = {};
                              weapons[] = {};
                              requiredVersion = 0.1;
                              requiredAddons[] = {"A3_anims_f"};
               };
};

class CfgMovesBasic {
               class StandBase; // External
};

class CfgMovesMaleSdr : CfgMovesBasic {
               class AmovPercMstpSlowWrflDnon : StandBase {};
               class AmovPknlMstpSlowWrflDnon : AmovPercMstpSlowWrflDnon {};
                              class AmovPknlMstpSrasWrflDnon : AmovPknlMstpSlowWrflDnon {
                              //ConnectTo[] = {"AidlPknlMstpSlowWrflDnon_AI",0.1,"AmovPknlMstpSrasWrflDnon",0.03,"AmovPknlMstpSrasWrflDnon_turnL",0.02,"AmovPknlMstpSrasWrflDnon_turnR",0.02,"WeaponMagazineReloadKneel",0.1,"AmovPknlMstpSrasWrflDnon_AmovPknlMstpSlowWrflDnon",0.01,"AmovPknlMstpSrasWrflDnon_AmovPercMstpSrasWrflDnon",0.01,"AmovPknlMstpSrasWrflDnon_AmovPpneMstpSrasWrflDnon",0.01,"AmovPknlMstpSrasWrflDnon_AmovPknlMstpSrasWpstDnon",0.02,"AmovPknlMstpSrasWrflDnon_AmovPknlMstpSrasWlnrDnon",0.02,"AmovPknlMstpSrasWrflDnon_AwopPknlMstpSoptWbinDnon",0.02,"AmovPknlMstpSrasWrflDnon_AinvPknlMstpSrasWrflDnon",0.02,"AmovPknlMstpSrasWrflDnon_AinvPknlMstpSrasWrflDnon_Putdown",0.02,"AmovPknlMstpSrasWrflDnon_AmovPknlMstpSnonWnonDnon",0.025,"AwopPknlMstpSgthWrflDnon_Start",0.1,"AwopPknlMstpSgthWrflDnon_End",0.1,"AmovPknlMstpSrasWrflDnon_AadjPknlMstpSrasWrflDup",0.02,"AmovPknlMstpSrasWrflDnon_AadjPknlMstpSrasWrflDdown",0.02,"AmovPknlMstpSrasWrflDnon_AadjPknlMstpSrasWrflDleft",0.02,"AmovPknlMstpSrasWrflDnon_AadjPknlMstpSrasWrflDright",0.02,"AmovPknlMstpSrasWrflDnon_AmovPknlMstpSrasWrflDnon_gear",0.02,"AmovPknlMstpSrasWrflDnon_AmovPknlMrunSlowWrflDf",0.01};
                              ConnectTo[] = {"AidlPknlMstpSlowWrflDnon_AI",0.1,"AmovPknlMstpSrasWrflDnon",0.03,"AmovPknlMstpSrasWrflDnon_turnL",0.02,"AmovPknlMstpSrasWrflDnon_turnR",0.02,"WeaponMagazineReloadKneel",0.1,"AmovPknlMstpSrasWrflDnon_AmovPknlMstpSlowWrflDnon",0.01,"AmovPknlMstpSrasWrflDnon_AmovPercMstpSrasWrflDnon",0.01,"AmovPknlMstpSrasWrflDnon_AmovPpneMstpSrasWrflDnon",0.01,"AmovPknlMstpSrasWrflDnon_AmovPknlMstpSrasWpstDnon",0.02,"AmovPknlMstpSrasWrflDnon_AmovPknlMstpSrasWlnrDnon",0.02,"AmovPknlMstpSrasWrflDnon_AwopPknlMstpSoptWbinDnon",0.02,"AmovPknlMstpSrasWrflDnon_AinvPknlMstpSrasWrflDnon",0.02,"AmovPknlMstpSrasWrflDnon_AinvPknlMstpSrasWrflDnon_Putdown",0.02,"AmovPknlMstpSrasWrflDnon_AmovPknlMstpSnonWnonDnon",0.025,"AwopPknlMstpSgthWrflDnon_Start",0.1,"AwopPknlMstpSgthWrflDnon_End",0.1,"AmovPknlMstpSrasWrflDnon_AadjPknlMstpSrasWrflDup",0.02,"AmovPknlMstpSrasWrflDnon_AadjPknlMstpSrasWrflDdown",0.02,"AmovPknlMstpSrasWrflDnon_AadjPknlMstpSrasWrflDleft",0.02,"AmovPknlMstpSrasWrflDnon_AadjPknlMstpSrasWrflDright",0.02,"AmovPknlMstpSrasWrflDnon_AmovPknlMstpSrasWrflDnon_gear",0.02};
               };
};

Apparently, "AmovPknlMstpSrasWrflDnon_AmovPknlMrunSlowWrflDf" in the ConnectTo[] list is causing the glitch, thus once it's removed everything works great!

 

However...

 

For some reason when using 3rd party mods, one of the addons was overriding my animation fix and reintroducing the animation glitch.  It was like trying to find a needle in a haystack, but I managed to pin down the offending addon.  It's in the All In Arma Terrain Pack (which has 152 PBOs), and one of those PBOs is specifically causing the override, and thus my headache:  "misc_acr_c.pbo".

 

Side note- I thought the ArmA3 shortcut mod order would sort this out, but alas my animation fix is being overridden even though I placed my fix after AIA Terrain Pack, like this:  "-mod=@AllInArmaTerrainPack;@MRU_AnimFix;"

 

Obviously, I need to rewrite my addon to account for and override whatever it is AIA Terrain Pack's "misc_acr_c.pbo" is doing to thwart my animation fix.  This seems to me to boil down to PreloadAddons and requiredAddons, and here's where I could use some insight.

 

After dePBOing "misc_acr_c.pbo", I can find these 13 addons:

  • AiA_Misc_acr_Config
  • CAMisc_ACR
  • CAMisc_ACR_3DMarkers
  • CAMisc_ACR_Container
  • CAMisc_ACR_Dog
  • CAMisc_ACR_Helpers
  • CAMisc_ACR_PBX
  • CAMisc_ACR_ScaffoldingSmall
  • CAMisc_ACR_Shooting_range
  • CAMisc_ACR_Sign_Mines
  • CAMisc_ACR_Targets
  • CAMisc_ACR_Targets_InvisibleTarget
  • CAMisc_ACR_TestSphere

 

CAMisc_ACR_PBX appears to be the only one that modifies CfgMovesMaleSdr (the same class my fix is modifying), so I suspect I may have found the culprit.

 

I can add PreloadAddons to my addon in the "config.cpp", like this:

class CfgAddons {
               class PreloadAddons {
                              class MRU_AnimTransFix {
                                             list[] = {};
                              };
               };
};

Overall just trying to figure out exactly what requiredAddons[] and PreloadAddons do, so I can determine which addons should go in which list (and in what order within each).  So that my animation glitch fix will magically gain the upper hand and override whatever the sinister AIA Terrain Pack is currently doing to subjugate and nullify my fix.

 

Thanks for reading.  Any insight is much appreciated!

Share this post


Link to post
Share on other sites

Quick update, I got it working!  Couple points:

  1. Turns out the animation transition glitch (described above) does not appear to be present in vanilla after all.  However, I am seeing the glitch every time I run AIA Terrain Pack (with or without other mods, it's always there).
  2. If anyone else is experiencing this animation issue while using AIA Terrain Pack, good news!  I now have a working patch that fixes it.  [somehow in my previous attempt above, I had left out the States class in CfgMovesMaleSdr, and that was causing all sorts of strange behavior.]  Anyhow, here's the updated and working "config.cpp":
class CfgPatches {
      class MRU_AIA_AnimFix {
            units[] = {};
            weapons[] = {};
            requiredVersion = 0.1;
            requiredAddons[] = {"A3_anims_f"};
      };
};

class CfgMovesBasic {
      class StandBase; // External
};

class CfgMovesMaleSdr : CfgMovesBasic {
      class States {
            class AmovPercMstpSlowWrflDnon : StandBase {};
            class AmovPknlMstpSlowWrflDnon : AmovPercMstpSlowWrflDnon {};
            class AmovPknlMstpSrasWrflDnon : AmovPknlMstpSlowWrflDnon {
                  //ConnectTo[] = {"AidlPknlMstpSlowWrflDnon_AI",0.1,"AmovPknlMstpSrasWrflDnon",0.03,"AmovPknlMstpSrasWrflDnon_turnL",0.02,"AmovPknlMstpSrasWrflDnon_turnR",0.02,"WeaponMagazineReloadKneel",0.1,"AmovPknlMstpSrasWrflDnon_AmovPknlMstpSlowWrflDnon",0.01,"AmovPknlMstpSrasWrflDnon_AmovPercMstpSrasWrflDnon",0.01,"AmovPknlMstpSrasWrflDnon_AmovPpneMstpSrasWrflDnon",0.01,"AmovPknlMstpSrasWrflDnon_AmovPknlMstpSrasWpstDnon",0.02,"AmovPknlMstpSrasWrflDnon_AmovPknlMstpSrasWlnrDnon",0.02,"AmovPknlMstpSrasWrflDnon_AwopPknlMstpSoptWbinDnon",0.02,"AmovPknlMstpSrasWrflDnon_AinvPknlMstpSrasWrflDnon",0.02,"AmovPknlMstpSrasWrflDnon_AinvPknlMstpSrasWrflDnon_Putdown",0.02,"AmovPknlMstpSrasWrflDnon_AmovPknlMstpSnonWnonDnon",0.025,"AwopPknlMstpSgthWrflDnon_Start",0.1,"AwopPknlMstpSgthWrflDnon_End",0.1,"AmovPknlMstpSrasWrflDnon_AadjPknlMstpSrasWrflDup",0.02,"AmovPknlMstpSrasWrflDnon_AadjPknlMstpSrasWrflDdown",0.02,"AmovPknlMstpSrasWrflDnon_AadjPknlMstpSrasWrflDleft",0.02,"AmovPknlMstpSrasWrflDnon_AadjPknlMstpSrasWrflDright",0.02,"AmovPknlMstpSrasWrflDnon_AmovPknlMstpSrasWrflDnon_gear",0.02,"AmovPknlMstpSrasWrflDnon_AmovPknlMrunSlowWrflDf",0.01};
                  ConnectTo[] = {"AidlPknlMstpSlowWrflDnon_AI",0.1,"AmovPknlMstpSrasWrflDnon",0.03,"AmovPknlMstpSrasWrflDnon_turnL",0.02,"AmovPknlMstpSrasWrflDnon_turnR",0.02,"WeaponMagazineReloadKneel",0.1,"AmovPknlMstpSrasWrflDnon_AmovPknlMstpSlowWrflDnon",0.01,"AmovPknlMstpSrasWrflDnon_AmovPercMstpSrasWrflDnon",0.01,"AmovPknlMstpSrasWrflDnon_AmovPpneMstpSrasWrflDnon",0.01,"AmovPknlMstpSrasWrflDnon_AmovPknlMstpSrasWpstDnon",0.02,"AmovPknlMstpSrasWrflDnon_AmovPknlMstpSrasWlnrDnon",0.02,"AmovPknlMstpSrasWrflDnon_AwopPknlMstpSoptWbinDnon",0.02,"AmovPknlMstpSrasWrflDnon_AinvPknlMstpSrasWrflDnon",0.02,"AmovPknlMstpSrasWrflDnon_AinvPknlMstpSrasWrflDnon_Putdown",0.02,"AmovPknlMstpSrasWrflDnon_AmovPknlMstpSnonWnonDnon",0.025,"AwopPknlMstpSgthWrflDnon_Start",0.1,"AwopPknlMstpSgthWrflDnon_End",0.1,"AmovPknlMstpSrasWrflDnon_AadjPknlMstpSrasWrflDup",0.02,"AmovPknlMstpSrasWrflDnon_AadjPknlMstpSrasWrflDdown",0.02,"AmovPknlMstpSrasWrflDnon_AadjPknlMstpSrasWrflDleft",0.02,"AmovPknlMstpSrasWrflDnon_AadjPknlMstpSrasWrflDright",0.02,"AmovPknlMstpSrasWrflDnon_AmovPknlMstpSrasWrflDnon_gear",0.02};
            };
      };
};

Works whether you load AIA Terrain Pack first then the fix, or the fix first then AIA Terrain Pack.

 

So my issue is largely sorted out.  Still curious what including addons inside the PreloadAddons list does, if anyone has a good explanation???

 

[Also, obviously AIA Terrain Pack is awesome beyond belief!  Many thanks to kju and all involved with putting it together.]

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  

×