Jump to content
Sign in to follow this  
chemicalcosh

Adding Custom New Magazine to Base Weapons

Recommended Posts

Hi there, was wondering if someone could help. I am trying to make a simple addon that will add a new type of magazine that is usable in all of the base rifles. My plan was to do something like the following for each rifle:

 
  class SDAR_Base_F;
 
  class arifle_SDAR_F: SDAR_Base_F {
    magazines[] =  {"20Rnd_556x45_UW_mag","30Rnd_556x45_Stanag","30Rnd_556x45_Stanag_Tracer_Red","30Rnd_556x45_Stanag_Tracer_Green","30Rnd_556x45_Stanag_Tracer_Yellow","30Rnd_556x45_Stanag_green","30Rnd_556x45_Stanag_red","20Rnd_556x45_UW_mag_Training"};
   };
 

So basically I thought I would just override the magazines[] property of the arifle_SDAR_F (my custom magazine class is the one at the end 20Rnd_556x45_UW_mag_Training).

 

However I've tested it and it doesn't seem to work on the base weapons. I'm guess this is because each class on cfgWeapons is access = 3 - does this mean I'm screwed on my original plan and I need to also make a custom weapon to hold my custom magazine?

Share this post


Link to post
Share on other sites

after a bit more reading I understand the access levels better, if anyone else is struggling with a similar problem you can't modify anything with access level = 3 and you must create a new class. The easiest way of doing this is to extend the existing class.

 

also the #define macros are extremely powerful and have saved me from a shitload of similar class declarations. anyone else that is new like me I would defo recommend reading up on them! https://community.bistudio.com/wiki/Arma_3_Characters_And_Gear_Encoding_Guide#Using_macros

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  

×