Jump to content
Sign in to follow this  
RKDmitriyev

Trouble Writing Cfg to Modify Existing Class

Recommended Posts

EDIT: I partially solved my earlier problem. I've been able to replace the display name and crew of the Su39, but not the weapons. Weird.

My addon config:

#define _ARMA_

//Class config.bin{
class CfgPatches
{
class newsureplacement
{
	units[] = {};
	weapons[] = {};
	requiredVersion = 1.02;
	requiredAddons[] = {"CACharacters2","CAData", "CAWeapons","CAAir","CAAir2", "CAAir3", "CAWeapons_E"};
};
};

class CfgVehicles
{

class Su25_base;	
class Su39 : Su25_base {
	displayName = "Bad plane who lost his weapons";
	weapons[] = {};
	magazines[] = {};
	crew = "RU_Soldier_Marksman";
	typicalCargo[] = {"RU_Soldier_Marksman"};
};
};

Does anyone know why I can't change the Su39 weapons by editing "weapons[]"?

I noticed from a different thread that weapons on turrets need to be changed from inside the turret class. But the Su39 doesn't appear to have a turret. :confused:

*****Original Post:

Something is wrong with my attempts at using addons to replace weapons loadouts. Can someone point out my mistake?

I'm new at addon editing and already succeeded in making small working addons that add new units. Now I'd like to try making an addon that modifies the characteristics of an existing unit. None of my attempts have worked.

Following this post, I've tried to modify class Su39 (called the Su-25 in the editor) so that it doesn't have any magazines except for the cannon. When I load up the game, the Russian Su-25 still has all of its missiles.

Here's my addon config (deRapified directly from my own PBO):

////////////////////////////////////////////////////////////////////
//DeRap: Produced from mikero's Dos Tools Dll version 3.75
//http://dev-heaven.net/projects/list_files/mikero-pbodll
////////////////////////////////////////////////////////////////////

#define _ARMA_

//Class E:/Program Files/Bohemia Interactive/ArmA 2/@replacetest2/AddOns/replacesu/replacesu/config.bin{
class CfgPatches
{
class replacesu
{
 units[] = {"Su39"};
 weapons[] = {};
 requiredVersion = 1.51;
 requiredAddons[] = {"CAData","CAWeapons","CAAir2","CAAir3","CAWeapons_E","CA_AIR2_Su25"};
};
};
class CfgVehicles
{
class Su25_base;
class Su39: Su25_base
{
 weapons[] = {"GSh301","GLT_Ch29Launcher_IR","R73Launcher_2","S8Launcher"};
 magazines[] = {"180Rnd_30mm_GSh301"};
};
};
//};

And here's a link to download a zip containing my PBO already in a modfolder:

http://www.mediafire.com/?tu62nn8nj82l5j4

Thanks!

Edited by RKDmitriyev

Share this post


Link to post
Share on other sites

You probably miss "CAAir_E" in the requiredAddons. So your replacement get's loaded but overwritten by said config.

Share this post


Link to post
Share on other sites

Two fluffy hugging bears? Already killed for less. :mad:

j/k, :D:p glad you got it sorted. Always make sure that every addon (BIS or 3rd party) that might re-overwrite your settings get loaded before your addon, which is done by listing it in requiredAddons.

Share this post


Link to post
Share on other sites

Thanks. So is there a convenient way to determine what's needed under requiredAddons other than trial and error? I can't quite see the pattern for what cfgPatches names are needed.

For example, the following config works even though there's no reference to TK_Soldier_base_EP1 in the config.bin found inside characters2.pbo.

#define _ARMA_

//Class config.bin{
class CfgPatches
{
class losthisgun
{
	units[] = {};
	weapons[] = {};
	requiredVersion = 1.02;
	requiredAddons[] = {"CACharacters2"};
};
};

class CfgVehicles
{
class TK_Soldier_base_EP1;

class TK_Soldier_GL_EP1: TK_Soldier_base_EP1
{
	displayName = "Bad Soldier GL who lost his gun";
	weapons[] = {};
};
};

Class TK_Soldier_base_EP1 is defined in the config.bin inside characters_e.pbo. But this code does not work:

requiredAddons[] = {"CACharacters_E"};

WHY???

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  

×