Jump to content
Sign in to follow this  
alanford

Changing loadout of default units

Recommended Posts

Okay so I need to change the loadout of some default unit classes, such as "O_medic_F". And I can not use the standard way of doing it via initexec and adding the "RemoveAllItems this ;" and then adding items.

I have to edit the actual default config inside the pbo files, because I want to change the units in a mission that randomly spawns units.

I am assuming there's a CfgVehicles config file somewhere? Where can I find it? I've looked through all the characters_f pbos...

Share this post


Link to post
Share on other sites

Your best bet is to make a replacement config, rather than editing core game files. You'll likely break your game by messing around with them.

Share this post


Link to post
Share on other sites
Your best bet is to make a replacement config, rather than editing core game files. You'll likely break your game by messing around with them.

Okay, thanks for your feedback. So I have googled and read about replacement configs a bit.

this guide seems nice: https://community.bistudio.com/wiki/ArmA_3_Replacement_Config_Tutorial

however some parts seems redundant to me:

Extract the classes of the desired vehicle/infantry/weapon item/set/type/faction to replace

Extract the classes of the replacements

Clean both their content for all but the relevant parameters (see below for more information); this regex will remove all but the mentioned parameters:

I know exactly which units I'll be changing, and their unit class. Do I still need to do this step?

But there is also no detailed documentation on how to correctly write the config for replacing stuff. So for example, if I wanted to change the gun of every "O_Soldier_F" would this be correct?

class CfgPatches
{
	class replaceGuns
	{
		units[] = {};
		weapons[] = {};
		requiredVersion = 0.1;
		requiredAddons[] = {"replaceGuns","HLC_Core"};
	};
};
class CfgVehicles
{
	class [b]A3_Characters_F_OPFOR[/b];

	class O_Soldier_F: [b]A3_Characters_F_OPFOR[/b]
	{

		linkedItems[] = {HLC_AK74","HLC_Ak74_Ammo","ItemMap","ItemCompass","ItemWatch","ItemRadio"};

	};

Share this post


Link to post
Share on other sites
Okay, thanks for your feedback. So I have googled and read about replacement configs a bit.

this guide seems nice: https://community.bistudio.com/wiki/ArmA_3_Replacement_Config_Tutorial

however some parts seems redundant to me:

I know exactly which units I'll be changing, and their unit class. Do I still need to do this step?

But there is also no detailed documentation on how to correctly write the config for replacing stuff. So for example, if I wanted to change the gun of every "O_Soldier_F" would this be correct?

class CfgPatches
{
	class replaceGuns
	{
		units[] = {};
		weapons[] = {};
		requiredVersion = 0.1;
		requiredAddons[] = {"replaceGuns","HLC_Core"};
	};
};
class CfgVehicles
{
	class [b]A3_Characters_F_OPFOR[/b];

	class O_Soldier_F: [b]A3_Characters_F_OPFOR[/b]
	{

		linkedItems[] = {HLC_AK74","HLC_Ak74_Ammo","ItemMap","ItemCompass","ItemWatch","ItemRadio"};

	};

I don't know about the linked items and their classnames, but I know that your inheritance structure is miles off

class CfgPatches
{
	class replaceGuns
	{
		units[] = {};
		weapons[] = {};
		requiredVersion = 0.1;
		requiredAddons[] = {"A3_Characters_F","HLC_Core"};
	};
};

class CfgVehicles
{
	class O_Soldier_base_F;

	class O_Soldier_F: O_Soldier_base_F
	{	
		WHATEVER GOES HERE	
	};
};

And I fixed your cfgPatches as well, you don't want your addon requiring YOUR addon, it'll loop out and cause errors gallor (and either CTD and/or prevent the addon from working).

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  

×