Jump to content
Sign in to follow this  
jamesf1

Strange Addon Error

Recommended Posts

Would appreciate some help with this, as I'm out of ideas. This is what I posted over at OFPEC:

I'm having a small problem that I can't seem to get rid of. I'm making an add-on, and I've got some resources in different PBOs. I've got some ammo boxes defined in a particular PBO, which works fine, etc, and I've got some frequently-used mission-related scripts in another PBO.

One of the PBOs is a supply-drop script, of sorts... it attaches a parachute to one of the custom ammo boxes, and drops it (to be simplistic about it's purpose). When the ammo box is created with createVehicle, I get the following error:

Addon hmm_units (entry HMM_DropBox) not found in the list of active addons.

Warning Message: You cannot play/edit this mission; it is dependent on downloadable content that has been deleted.

hmm_units

Nothing strange about that... however, here's the weird part... the PBO mod-folder is loaded and the correct ammo box (class name "HMM_DropBox") still is created, attached to the 'chute, and still falls to the ground (with all the correct ammo, etc.). Maybe I'm overlooking something, but why does the error still occur if the box is clearly loaded correctly?

Any help would be greatly appreciated. I'm stumped with this one.

Share this post


Link to post
Share on other sites

I think HMM_DropBox needs addon hmm_units.Could you show config for Dropbox?

Share this post


Link to post
Share on other sites

HMM_DropBox is defined in HMM_Units:

class CfgPatches
{
   class HMM_Units
   {
       units[] = {
           "HMM_WeaponsBox",
           "HMM_MagazinesBox",
           "HMM_OrdnanceBox",
           "HMM_DropBox",
           "HMM_MH6"
       };
       weapons[] = {
           "HMM_M4A1_AIM_SD",
           "HMM_Mk48"
       };
       requiredVersion = 0.1;
       requiredAddons[] = {"CAWeapons","CAWeapons2"};
   };
};

And a shortened config for HMM_DropBox (which, as I said, works fine itself... I just get the error anyway):

class HMM_DropBox: ReammoBox
{
   scope = 1;
   accuracy = 1000;
   displayName = "Supply Drop Box";
   model = "\ca\weapons\AmmoBoxes\USBasicAmmo.p3d";
   class TransportMagazines
   {
       <bunch of magazine classes>
    };  
};

As mentioned, the box itself works fine, and drops down on the end of the chute... its just the error message comes up when the ammo box is spawned.

Defining "HMM_Units" as a required add-on for my scripts PBO is making no difference.

The addon is also defined in my mission.sqm I'm testing with, thus:

addOns[]=
{
<various addons>
"HMM_Units",
<etc>
};
addOnsAuto[]=
{
<various addons>,
"HMM_Units",
<etc>
};

And using activateAddons solves the problem... but I need a 'proper' solution.

Share this post


Link to post
Share on other sites

Hmm, I was going to say that you're missing the addon in the requiredAddons-arrays of the mission, but that seems fine.

Have you tried placing a box in the editor a long distance away from where the mission is taking place? So it is there right from the mission start. Perhaps that'll help solving that error message.

Share this post


Link to post
Share on other sites

Well, the thing is, the other 3 ammo boxes are all placed in the particular mission I'm testing on... the error only occurs when doing createVehicle on the HMM_DropBox class, in one of the scripts in another PBO. I've tried adding HMM_Units as a requiredAddon for the other PBO, but to no avail.

I could try adding the other box and seeing if that fixes it (will do it when I get home) - but I'd rather like to work out a 'proper' solution. For the moment, I'm calling activateAddons just before the createVehicle to solve the problem... but I still don't understand why the problem exists in the first place!

Thanks for the suggestion, though... as I said, will try it out when I get home. :)

Edited by JamesF1

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  

×