Jump to content
sparfell_19

Questions regarding "BIS_fnc_unitHeadgear"

Recommended Posts

Hello.

I've got trouble using BIS_fnc_unitHeadgear , my main problem is that in my attempt to using it, "allowedFacewear" seems to be ignored contrary to what is written in the BIS wiki : https://community.bistudio.com/wiki/Arma_3_Characters_And_Gear_Encoding_Guide#FIA_headgear_and_facewear_randomization

 

See my configs below :

 

CfgGlasses :

	class G_Aviator;
	class MU_G_Aviator : G_Aviator {
		scope = 1;
		scopeCurator = 1;
		scopeArsenal = 1;
		identityTypes[] = {"G_MU_isas",50};
	};
	class G_Balaclava_blk;
	class MU_G_Balaclava_blk : G_Balaclava_blk {
		scope = 1;
		scopeCurator = 1;
		scopeArsenal = 1;
		identityTypes[] = {"G_MU_isas",50};
	};

Cfgfaces :

class CfgFaces
{
	class Default;
	class Man_A3: Default
	{
		class Default;
		class PersianHead_A3_01 :Default
		{
			identityTypes[] += {"MU_ISAS_head"};
		};
		class AfricanHead_01;
		class AfricanHead_03 :AfricanHead_01
		{
			identityTypes[] += {"MU_ISAS_head"};
		};
	};
};

CfgWeapons :

class H_ShemagOpen_tan;
class MU_H_ShemagOpen_tan :H_ShemagOpen_tan {
	scope = 1;
	scopeCurator = 1;
	scopeArsenal = 1;
	allowedFacewear[] = {"MU_G_Aviator",1};		
};
class H_ShemagOpen_khk;
class MU_H_ShemagOpen_khk :H_ShemagOpen_khk {
	scope = 1;
	scopeCurator = 1;
	scopeArsenal = 1;
	allowedFacewear[] = {"MU_G_Aviator",1};		
};
class H_Shemag_olive;
class MU_H_Shemag_olive :H_Shemag_olive {
	scope = 1;
	scopeCurator = 1;
	scopeArsenal = 1;
	allowedFacewear[] = {"MU_G_Aviator",1};		
};
class H_Bandanna_sand;
class MU_H_Bandanna_sand :H_Bandanna_sand {
	scope = 1;
	scopeCurator = 1;
	scopeArsenal = 1;
	allowedFacewear[] = {"MU_G_Aviator",1};		
};
class H_Cap_blk;
class MU_H_Cap_blk :H_Cap_blk {
	scope = 1;
	scopeCurator = 1;
	scopeArsenal = 1;
	allowedFacewear[] = {"MU_G_Balaclava_blk",1,"MU_G_Aviator",1};		
};

CfgVehicles :

class SoldierEB;
	class O_Soldier_base_F: SoldierEB {
		class EventHandlers;
	};
    class O_MU_islam_base_F : O_Soldier_base_F {
		_generalMacro = "O_MU_islam_base_F"; 
		scope = 0;
		scopeCurator = 0;
		identityTypes[] = {"LanguagePER_F", "MU_ISAS_head", "G_MU_isas"};
		faction = MU_islam_F;
		vehicleClass = "MU_islam_Infantry_O";
		accuracy = 3.900000;
		sensitivity = 2;
		threat[] = {1, 0.100000, 0.100000};
		camouflage = 1.100000;
		minFireTime = 10;
		cost = 150000;
		asr_ai_level = 6;
		icon = "iconMan";
		headgearList[] = {"MU_H_ShemagOpen_tan",0.1,"MU_H_ShemagOpen_khk",0.1,"MU_H_Shemag_olive",0.1,"MU_H_Cap_blk",0.5,"MU_H_Bandanna_sand",0.5,"",1};
		class EventHandlers: EventHandlers
		{
			init = "if (local (_this select 0)) then {[(_this select 0), [], []] call BIS_fnc_unitHeadgear;};";
		};
	};
    class O_MU_islam_R1_F : O_MU_islam_base_F {
		_generalMacro = "O_MU_islam_R1_F";
		scope = 2;
		scopeCurator = 2;
		displayName = $STR_MU_units_islam_R1;
		uniformClass = "U_OG_Guerrilla_6_1";
		linkedItems[] = {"V_TacVest_oli", "ItemMap", "ItemCompass", "ItemWatch", "ItemRadio",};
		respawnLinkedItems[] = {"V_TacVest_oli", "ItemMap", "ItemCompass", "ItemWatch", "ItemRadio",};
		weapons[] = {"arifle_Katiba_F", "hgun_Rook40_F", "Throw", "Put"};
		respawnweapons[] = {"arifle_Katiba_F", "hgun_Rook40_F", "Throw", "Put"};
		magazines[] = {"30Rnd_65x39_caseless_green", "30Rnd_65x39_caseless_green", "30Rnd_65x39_caseless_green", "30Rnd_65x39_caseless_green", "30Rnd_65x39_caseless_green", "30Rnd_65x39_caseless_green", "30Rnd_65x39_caseless_green", "16Rnd_9x21_Mag", "16Rnd_9x21_Mag", "16Rnd_9x21_Mag", "HandGrenade", "HandGrenade", "SmokeShell", "SmokeShellGreen", "Chemlight_red", "Chemlight_red",};
		Respawnmagazines[] = {"30Rnd_65x39_caseless_green", "30Rnd_65x39_caseless_green", "30Rnd_65x39_caseless_green", "30Rnd_65x39_caseless_green", "30Rnd_65x39_caseless_green", "30Rnd_65x39_caseless_green", "30Rnd_65x39_caseless_green", "16Rnd_9x21_Mag", "16Rnd_9x21_Mag", "16Rnd_9x21_Mag", "HandGrenade", "HandGrenade", "SmokeShell", "SmokeShellGreen", "Chemlight_red", "Chemlight_red",};
	};

And when I spawn the "O_MU_islam_R1_F" with zeus, here are the results :

http://imgur.com/Vim2ukp

 

Did I forget something ? Am I doing something wrong ?

Are "Allowedheadgear" and "G_MU_isas" conflicting eachother ?

 

Thanks by advance.

Share this post


Link to post
Share on other sites

BIS_fnc_unitHeadgear support backwards compatibility but it's easier to ditch all the old stuff and only use the arrays when calling it.

like this

init = "[_this select 0, ['TRYK_H_pakol2',1],['TRYK_Beard_BK',0.2,'TRYK_Beard_BK2',0.2,'TRYK_Beard_BK3',0.2,'TRYK_Beard_BK4',0.2]] call BIS_fnc_unitHeadgear";

The first array being headgear and the second one being facewear.

Share this post


Link to post
Share on other sites

BIS_fnc_unitHeadgear support backwards compatibility but it's easier to ditch all the old stuff and only use the arrays when calling it.

like this

init = "[_this select 0, ['TRYK_H_pakol2',1],['TRYK_Beard_BK',0.2,'TRYK_Beard_BK2',0.2,'TRYK_Beard_BK3',0.2,'TRYK_Beard_BK4',0.2]] call BIS_fnc_unitHeadgear";

The first array being headgear and the second one being facewear.

 

Ok, Thanks for your answer. However, I think this is a problem when I want to be ACE compatible without using CBA XEH because I'll need to define eventhandler class in almost each unit class. But I may be wrong, I'll look into it. (maybe several base class with different randomizations)

What is strange is that Tom_48_97 recently updated the character and gear encoding guide according to the new randomization system and it says to use "allowedFacewear" in order to "Implement the face wear randomization". I was secretly expecting an answer from him about that  :D . Maybe I'll send him a PM.

  • Like 1

Share this post


Link to post
Share on other sites

The new function (it was a script previously) support backward compatibility, the guide was written for the script before it was put into a function and refactored.

It's better used as described above since it makes the  unit config more readable and it's easier to modify.

 

If you want to have your addon XEH compatible but don't want to add it as requirement you can create an adapter addon

For more informations about the function params check the wiki page about it.

Share this post


Link to post
Share on other sites

The new function (it was a script previously) support backward compatibility, the guide was written for the script before it was put into a function and refactored.

It's better used as described above since it makes the  unit config more readable and it's easier to modify.

 

If you want to have your addon XEH compatible but don't want to add it as requirement you can create an adapter addon

For more informations about the function params check the wiki page about it.

Problem is, if I use the paramaters inside the function call, I can't define what type of Facewear can support a particular headgear. So the main problem is not solved.

 

Anyway ...

I've been through BIS configs and it appears they are still using allowedFacewear and headgearlist and they are calling the function the same way I am. BUT they are not using Balaclavas or facewear bandanas (for FIA). As a consequence : no clipping problem.

So I guess allowedFacewear is just not working (anymore ?).

 

I will definitly ask them and maybe I'll do a repro addon.

 

 

Thanks again for your time. ;)

Share this post


Link to post
Share on other sites

Here I am :rolleyes:

 

At the first glance, your configs look fine and the property allowedFacewear should work. I will have a look at the system but yes, a repro addon would definitely be helpful by saving me some time. :292:

Share this post


Link to post
Share on other sites

Here I am :rolleyes:

 

At the first glance, your configs look fine and the property allowedFacewear should work. I will have a look at the system but yes, a repro addon would definitely be helpful by saving me some time. :292:

Cool !

I'll do that.

Share this post


Link to post
Share on other sites

The repro addon :

https://www.dropbox.com/s/qwayy5ovwlz6gkn/MU_repro_random_gear.pbo?dl=0

 

It adds a "REPRO soldier" under "OPFOR > Men".

 

The result ingame :

http://imgur.com/viY1m1d

 

The config :

class CfgPatches
{
	class MU_repro_random_gear
	{
		units[] = {"O_MU_repro_r_F"};
		weapons[] = {};
		requiredVersion = 0.1;
		requiredAddons[] = {"A3_Characters_F"};
	};
};

class CfgGlasses
{
	class G_Aviator;
	class MU_G_Aviator : G_Aviator {
		scope = 1;
		scopeCurator = 1;
		scopeArsenal = 1;
		identityTypes[] = {"G_MU_repro",50};
	};
	class G_Balaclava_blk;
	class MU_G_Balaclava_blk : G_Balaclava_blk {
		scope = 1;
		scopeCurator = 1;
		scopeArsenal = 1;
		identityTypes[] = {"G_MU_repro",50};
	};
};

class CfgFaces
{
	class Default;
	class Man_A3: Default
	{
		class Default;
		class PersianHead_A3_01 :Default
		{
			identityTypes[] += {"MU_repro_head"};
		};
		class AfricanHead_01;
		class AfricanHead_03 :AfricanHead_01
		{
			identityTypes[] += {"MU_repro_head"};
		};
	};
};

class CfgWeapons
{
	class H_Shemag_olive;
	class MU_H_Shemag_olive :H_Shemag_olive {
		scope = 1;
		scopeCurator = 1;
		scopeArsenal = 1;
		allowedFacewear[] = {"MU_G_Aviator",1};		
	};
	class H_Bandanna_sand;
	class MU_H_Bandanna_sand :H_Bandanna_sand {
		scope = 1;
		scopeCurator = 1;
		scopeArsenal = 1;
		allowedFacewear[] = {"MU_G_Aviator",1};		
	};
	class H_Cap_blk;
	class MU_H_Cap_blk :H_Cap_blk {
		scope = 1;
		scopeCurator = 1;
		scopeArsenal = 1;
		allowedFacewear[] = {"MU_G_Balaclava_blk",1,"MU_G_Aviator",1};		
	};
};

class CfgVehicles
{
	class SoldierEB;
	class O_Soldier_base_F: SoldierEB
	{
		class EventHandlers;
	};
    class O_MU_repro_soldier_base_F : O_Soldier_base_F
	{
		_generalMacro = "O_MU_repro_soldier_base_F"; 
		scope = 0;
		scopeCurator = 0;
		identityTypes[] = {"LanguagePER_F","MU_repro_head","G_MU_repro"};
		headgearList[] = {"MU_H_Shemag_olive",1,"MU_H_Cap_blk",1,"MU_H_Bandanna_sand",1,"",1};
		class EventHandlers: EventHandlers
		{
			init = "if (local (_this select 0)) then {[(_this select 0), [], []] call BIS_fnc_unitHeadgear;};";
		};
	};
    class O_MU_repro_r_F : O_MU_repro_soldier_base_F {
		_generalMacro = "O_MU_repro_r_F";
		scope = 2;
		scopeCurator = 2;
		displayName = "REPRO soldier";
		uniformClass = "U_OG_Guerrilla_6_1";
		linkedItems[] = {"V_TacVest_oli", "ItemMap", "ItemCompass", "ItemWatch", "ItemRadio"};
		respawnLinkedItems[] = {"V_TacVest_oli", "ItemMap", "ItemCompass", "ItemWatch", "ItemRadio"};
		weapons[] = {"arifle_Katiba_F", "hgun_Rook40_F", "Throw", "Put"};
		respawnweapons[] = {"arifle_Katiba_F", "hgun_Rook40_F", "Throw", "Put"};
		magazines[] = {"30Rnd_65x39_caseless_green", "30Rnd_65x39_caseless_green", "30Rnd_65x39_caseless_green", "30Rnd_65x39_caseless_green", "30Rnd_65x39_caseless_green", "30Rnd_65x39_caseless_green", "30Rnd_65x39_caseless_green", "16Rnd_9x21_Mag", "16Rnd_9x21_Mag", "16Rnd_9x21_Mag", "HandGrenade", "HandGrenade", "SmokeShell", "SmokeShellGreen", "Chemlight_red", "Chemlight_red"};
		Respawnmagazines[] = {"30Rnd_65x39_caseless_green", "30Rnd_65x39_caseless_green", "30Rnd_65x39_caseless_green", "30Rnd_65x39_caseless_green", "30Rnd_65x39_caseless_green", "30Rnd_65x39_caseless_green", "30Rnd_65x39_caseless_green", "16Rnd_9x21_Mag", "16Rnd_9x21_Mag", "16Rnd_9x21_Mag", "HandGrenade", "HandGrenade", "SmokeShell", "SmokeShellGreen", "Chemlight_red", "Chemlight_red"};
	};
};

Share this post


Link to post
Share on other sites

As expected, I have been able to confirm the issue. It appears the function is not at fault and the cause is less obvious than I expected it. Could you, please, create a new ticket on the feedback tacker?

Share this post


Link to post
Share on other sites

I realize this has been dead for quite some time,  however I'm experiencing the same problem. Is anyone aware if a solution was ever found?

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

×