Forum Jump :

Author Message

Tyrfi  



Posts: 27
Rank:


Level: Member

Country: se
Location:
Occupation:
Age:
In-game name:

 
#1 Posted at 2017-01-13 04:18        
     
I am trying to make a "new" unit, which is basically only going to be a copy.

I want to take the current Soldier and make an identical one. BUT with this code added to it

class CfgInventoryGlobalVariable
{
	maxSoldierLoad = 1500;
};

and
class CfgMovesFatigue {
	staminaDuration = 120;
	staminaCooldown = 10;
	staminaRestoration = 30;	
	aimPrecisionSpeedCoef = 5;
	terrainDrainSprint = -1;
	terrainDrainRun = -1;
	terrainSpeedCoef = 0.9;
};

I figured the only way to do this was to make the unit an "addon" based one, however i am a really bad coder and only managed to come up with this.



class CfgPatches
{
	class THT_Units
	{
		units[] = {};
		weapons[] = {};
		requiredVersion = 1;
		requiredAddons[] = {"A3_Weapons_F","A3_Characters_F_BLUFOR"};
	};
};
class UniformSlotInfo
{
	slotType = 0;
	linkProxy = "-";
};
class cfgFactionClasses
{
	class Tyrfi_THT_Units
	{
		displayName = "(THT) Tyrfi Units";
		priority = 3;
		side = 1;
		icon = "";
	};
};

	class THT_Tyrfi_Soldier_Base: B_Soldier_F
	{
		scope = 2;
		scopeCurator = 2;
		scopeArsenal = 2;
		_generalMacro = "THT_Tyrfi_Soldier_Base";
		faction = "Tyrfi_THT_Units";
		vehicleClass = "Men_derp";
		uniformClass = "U_B_CombatUniform_mcam";
		hiddenSelections[] = {"Camo","insignia"};
		hiddenSelectionsTextures[] = {"\a3\characters_f\blufor\data\clothing1_co.paa"};
		linkedItems[] = {"V_PlateCarrierGL_rgr","H_HelmetSpecB","ItemMap","ItemCompass","ItemWatch","ItemRadio","NVGoggles"};
		respawnLinkedItems[] = {"V_PlateCarrierGL_rgr","H_HelmetSpecB","ItemMap","ItemCompass","ItemWatch","ItemRadio","NVGoggles"};
		backpack = "B_Kitbag_rgr_Exp";
	};

I've been sitting with this for several days now looked through countless guides and tutorials and still dont manage to get it working.

Any help would be appreciated!
Thank you.


Author Message


Posts: 1189
Rank:


Level: Member

Country: tr
Location:
Occupation: Computer Science student
Age: 20
In-game name: Wak

 
#2 Posted at 2017-01-16 18:41        
     
The thing about CfgInventoryGlobalVariable and CfgMovesFatigue is that they're global values, and you can't change them for a specific unit. Regardless of that; what you're current config is missing is B_Soldier_F, you don't declare that you're using it. Here is a config that should work (untested):

class CfgPatches {
    class THT_Units {
        units[] = {};
        weapons[] = {};
        requiredVersion = 1;
        requiredAddons[] = {"A3_Weapons_F","A3_Characters_F_BLUFOR"};
    };
};

class CfgInventoryGlobalVariable {
    maxSoldierLoad = 1500;
};

class CfgMovesFatigue {
    staminaDuration = 120;
    staminaCooldown = 10;
    staminaRestoration = 30;    
    aimPrecisionSpeedCoef = 5;
    terrainDrainSprint = -1;
    terrainDrainRun = -1;
    terrainSpeedCoef = 0.9;
};

class CfgFactionClasses {
    class Tyrfi_THT_Units {
        displayName = "(THT) Tyrfi Units";
        priority = 3;
        side = 1;
        icon = "";
        flag = "";
    };
};

class B_Soldier_F;
class THT_Tyrfi_Soldier_Base: B_Soldier_F {
    scope = 2;
    // scopeCurator = 2; // Outdated
    // scopeArsenal = 2;  // Outdated
    faction = "Tyrfi_THT_Units";
    // vehicleClass = "Men_derp"; // Non-existent
    uniformClass = "U_B_CombatUniform_mcam"; // Already set in base class
    hiddenSelections[] = {"Camo","insignia"}; // Already set in base class
    hiddenSelectionsTextures[] = {"\a3\characters_f\blufor\data\clothing1_co.paa"}; // Already set in base class
    linkedItems[] = {"V_PlateCarrierGL_rgr","H_HelmetSpecB","ItemMap","ItemCompass","ItemWatch","ItemRadio","NVGoggles"}; // Already set in base class
    respawnLinkedItems[] = {"V_PlateCarrierGL_rgr","H_HelmetSpecB","ItemMap","ItemCompass","ItemWatch","ItemRadio","NVGoggles"}; // Already set in base class
    backpack = "B_Kitbag_rgr_Exp";
};

You can post config code with the c++ highlight tag btw:
[highlight=cplusplus][/highlight]

Sometimes I like to think as I started the whole "earplugs" thing.

W0lle: The only advice I can give you is: Do not try to understand BI. You will not succeed and it only makes your brain go boom. I would even go so far and say that not even they understand their own actions :-D.

#define getDamage getDammage

Advertisement


Author Message

Tyrfi  



Posts: 27
Rank:


Level: Member

Country: se
Location:
Occupation:
Age:
In-game name:

 
#3 Posted at 2017-01-17 03:18        
     
Thank you!! much appreciated <3

Added 1 second later:

Thank you!! much appreciated <3


Author Message


Posts: 1
Rank:


Level: Member

Country: 00
Location:
Occupation:
Age:
In-game name:

 
#4 Posted at 2017-07-21 01:57        
     
# 654wak654 : The thing about CfgInventoryGlobalVariable and CfgMovesFatigue is that they're global values, and you can't change them for a specific unit.
So this means I cannot use these
 terrainDrainSprint = -1;
    terrainDrainRun = -1;
    terrainSpeedCoef = 0.9;
for a player upon spawn and respawn? like this
player terrainDrainSprint = -1;
    player terrainDrainRun = -1;
    player terrainSpeedCoef = 0.9;
? I'm wanting to allow players to not be affected by the hill gradients.