Jump to content
Charles Rabbit

External Inheritance Question Turret:Turret

Recommended Posts

ORIGINAL.PBO

class cfgVehicles
{
	class AH64D_base: Helicopter
	{
		class Turrets;
	};

	class AH64D: AH64D_base
	{
	    class Turrets : Turrets
		{
		Text123=12;
		};	
	};
};
MYCODE1.PBO

class cfgVehicles
{
	class AH64D;
 	class AH64D_2 : AH64D
	{
	class Turrets;
	};
};

How do I properly inherent an external child class where the original code inherits into the same class name? For example-  class Turrets: Turrets

When I try to inherent this external class, it will not pull the code written into class Turrets: Turrets.
So Text123=12; won't be inherited. How do I fix this?


 

 

Share this post


Link to post
Share on other sites
On 12/7/2020 at 8:33 PM, Charles Rabbit said:

class Turrets: Turrets

 

that should work

Share this post


Link to post
Share on other sites
class cfgVehicles
{
	class AH64D_Base
	class AH64D: AH64D_Base
  	{
		class Turrets;
	};
 	class AH64D_2 : AH64D
  	{
		class Turrets: Turrets
		{
			#custom turret classes#
		};
	};
};

Usually, you need to start calling external classes from one stage further back, for every time you indent to call a subclass.

 

You also need to make sure you have proper requiredAddons[] in the cfgPatches to ensure that the parent classes are loaded before your addon.

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

×